From: Leo B. <l_b...@us...> - 2014-04-07 20:38:59
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Maxima CAS". The branch, master has been updated via f67df3d289ba39981fb5642c8d7598b65526a63d (commit) from 4fcaa850d05ee3b01d93067a2f62a2f528fea336 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f67df3d289ba39981fb5642c8d7598b65526a63d Author: Leo Butler <l_b...@us...> Date: Mon Apr 7 16:38:35 2014 -0400 Fix cryptic/incorrect error message in rkf45. Map float over odes, interval and initial to coerce constants like %pi to floats. Define f_rhs so that its arguments are mode_declared as floats. See the thread begun by Ted Woollett at http://permalink.gmane.org/gmane.comp.mathematics.maxima.general/45146 diff --git a/share/contrib/rkf45/rkf45.mac b/share/contrib/rkf45/rkf45.mac index f48278c..ee09c69 100644 --- a/share/contrib/rkf45/rkf45.mac +++ b/share/contrib/rkf45/rkf45.mac @@ -102,14 +102,19 @@ rkf45(odes,funcs,initial,interval,[options]):=block( if (not(listp(odes))) then odes:[odes], if (not(listp(funcs))) then funcs:[funcs], if (not(listp(initial))) then initial:[initial], + /* coerce odes, interval and initial to floats */ + [odes,interval,initial]:float([odes,interval,initial]), /* Define right-hand-side function */ local(f_rhs), - define(funmake(f_rhs,cons(interval[1],funcs)),odes), + block([vars:cons(interval[1],funcs)], + define(funmake(f_rhs,vars),buildq([odes:odes,v:funmake(mode_declare,flatten(map(lambda([t],[t,'float]),vars)))],block(v,odes)))), translate(f_rhs), /* Initialize */ xi:interval[2], yi:initial, /* Check initial values */ - if member(false,map(numberp,apply(f_rhs,cons(xi,yi)))) then error("Error: initial should be a list of numbers, but found",funcs,"instead."), + if not every(map(numberp,initial)) then error("Error: initial should be a list of numbers, but found",initial,"instead."), + block([initial_values:apply(f_rhs,cons(xi,yi))], + if not every(map(numberp,initial_values)) then error("Error: odes should evaluate to a list of numbers at initial, but found",initial_values,"instead.")), /* Set up the rest */ estimated_errors:[1e30,-1e30], step_extrema:[1e30,-1e30], ----------------------------------------------------------------------- Summary of changes: share/contrib/rkf45/rkf45.mac | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) hooks/post-receive -- Maxima CAS |