changeset 22605:177e0c71bcc0 stable

make sure the additional function arguments are always passed to odefun. * scripts/ode/ode23.m : pass additional function arguments to odefun * scripts/ode/ode45.m : pass additional function arguments to odefun * scripts/ode/private/integrate_adaptive.m : do not use odeget but assume all required option fields exist * scripts/ode/private/starting_stepsize.m : add default value for additional function arguments to odefun
author Carlo de Falco <carlo.defalco@polimi.it>
date Thu, 06 Oct 2016 21:39:27 +0200
parents 610f88ed2b78
children df3194ba4847
files scripts/ode/ode23.m scripts/ode/ode45.m scripts/ode/private/integrate_adaptive.m scripts/ode/private/starting_stepsize.m
diffstat 4 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ode/ode23.m	Thu Oct 06 15:41:06 2016 -0400
+++ b/scripts/ode/ode23.m	Thu Oct 06 21:39:27 2016 +0200
@@ -211,7 +211,7 @@
                                              init, odeopts.AbsTol,
                                              odeopts.RelTol,
                                              strcmp (odeopts.NormControl,
-                                             "on"));
+                                             "on"), odeopts.funarguments);
   endif
 
 
--- a/scripts/ode/ode45.m	Thu Oct 06 15:41:06 2016 -0400
+++ b/scripts/ode/ode45.m	Thu Oct 06 21:39:27 2016 +0200
@@ -195,7 +195,7 @@
                                              init, odeopts.AbsTol,
                                              odeopts.RelTol,
                                              strcmp (odeopts.NormControl,
-                                             "on"));
+                                             "on"), odeopts.funarguments);
   endif 
 
 
--- a/scripts/ode/private/integrate_adaptive.m	Thu Oct 06 15:41:06 2016 -0400
+++ b/scripts/ode/private/integrate_adaptive.m	Thu Oct 06 21:39:27 2016 +0200
@@ -73,13 +73,13 @@
   x_new = x_old = x = x0(:);
 
   ## Get first initial timestep
-  dt = odeget (options, "InitialStep", [], "fast");
+  dt = options.InitialStep;
   if (isempty (dt))
     dt = starting_stepsize (order, func, t, x, options.AbsTol, options.RelTol,
                             strcmp (options.NormControl, "on"), options.funarguments);
   endif
 
-  dir = odeget (options, "direction", [], "fast");
+  dir = options.direction;
   dt = dir * min (abs (dt), options.MaxStep);
 
   options.comp = 0.0;
--- a/scripts/ode/private/starting_stepsize.m	Thu Oct 06 15:41:06 2016 -0400
+++ b/scripts/ode/private/starting_stepsize.m	Thu Oct 06 21:39:27 2016 +0200
@@ -36,7 +36,8 @@
 ## @seealso{odepkg}
 
 function h = starting_stepsize (order, func, t0, x0,
-                                AbsTol, RelTol, normcontrol, args)
+                                AbsTol, RelTol, normcontrol,
+                                args = {})
 
   ## compute norm of initial conditions
   d0 = AbsRel_Norm (x0, x0, AbsTol, RelTol, normcontrol);