# HG changeset patch # User Carlo de Falco # Date 1475782767 -7200 # Node ID 177e0c71bcc0c5e2e4f98cd1d4581810ed399042 # Parent 610f88ed2b789f9f9bdb648a47460fa980a64dbb 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 diff -r 610f88ed2b78 -r 177e0c71bcc0 scripts/ode/ode23.m --- 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 diff -r 610f88ed2b78 -r 177e0c71bcc0 scripts/ode/ode45.m --- 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 diff -r 610f88ed2b78 -r 177e0c71bcc0 scripts/ode/private/integrate_adaptive.m --- 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; diff -r 610f88ed2b78 -r 177e0c71bcc0 scripts/ode/private/starting_stepsize.m --- 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);