Mercurial > octave-nkf
diff scripts/ode/ode45.m @ 20575:3339c9bdfe6a
Activate FSAL property in dorpri timestepper
* scripts/ode/private/runge_kutta_45_dorpri.m: don't compute
first stage if values from previous iteration are passed.
* scripts/ode/private/integrate_adaptive.m: do not update
cmputed stages if timestep is rejected.
author | Carlo de Falco <carlo.defalco@polimi.it> |
---|---|
date | Sat, 03 Oct 2015 07:32:50 +0200 |
parents | fcb792acab9b |
children | 25623ef2ff4f |
line wrap: on
line diff
--- a/scripts/ode/ode45.m Fri Oct 02 15:07:37 2015 -0400 +++ b/scripts/ode/ode45.m Sat Oct 03 07:32:50 2015 +0200 @@ -106,8 +106,8 @@ endif if (length (vslot) < 2 && ... - (isempty (vodeoptions.TimeStepSize) ... - || isempty (vodeoptions.TimeStepNumber))) + (isempty (vodeoptions.TimeStepSize) ... + || isempty (vodeoptions.TimeStepNumber))) error ("OdePkg:InvalidArgument", ... "second input argument must be a valid vector"); elseif (vslot(2) == vslot(1)) @@ -251,8 +251,8 @@ ## option can be set by the user to another value than default value. if (isempty (vodeoptions.InitialStep) && strcmp (integrate_func, "adaptive")) vodeoptions.InitialStep = vodeoptions.vdirection* ... - starting_stepsize (vorder, vfun, vslot(1), vinit, vodeoptions.AbsTol, ... - vodeoptions.RelTol, vodeoptions.vnormcontrol); + starting_stepsize (vorder, vfun, vslot(1), vinit, vodeoptions.AbsTol, ... + vodeoptions.RelTol, vodeoptions.vnormcontrol); warning ("OdePkg:InvalidArgument", ... "option ''InitialStep'' not set, estimated value %f is used", ... vodeoptions.InitialStep); @@ -359,11 +359,11 @@ if (vmassdependence) ## constant mass matrices have already vmass = @(t,x) vodeoptions.Mass (t, x, vodeoptions.vfunarguments{:}); vfun = @(t,x) vmass (t, x, vodeoptions.vfunarguments{:}) ... - \ vfun (t, x, vodeoptions.vfunarguments{:}); + \ vfun (t, x, vodeoptions.vfunarguments{:}); else ## if (vmassdependence == false) vmass = @(t) vodeoptions.Mass (t, vodeoptions.vfunarguments{:}); vfun = @(t,x) vmass (t, vodeoptions.vfunarguments{:}) ... - \ vfun (t, x, vodeoptions.vfunarguments{:}); + \ vfun (t, x, vodeoptions.vfunarguments{:}); endif endif @@ -385,11 +385,11 @@ ## Postprocessing, do whatever when terminating integration algorithm if (vodeoptions.vhaveoutputfunction) ## Cleanup plotter feval (vodeoptions.OutputFcn, solution.t(end), ... - solution.x(end,:)', "done", vodeoptions.vfunarguments{:}); + solution.x(end,:)', "done", vodeoptions.vfunarguments{:}); endif if (vodeoptions.vhaveeventfunction) ## Cleanup event function handling odepkg_event_handle (vodeoptions.Events, solution.t(end), ... - solution.x(end,:)', "done", vodeoptions.vfunarguments{:}); + solution.x(end,:)', "done", vodeoptions.vfunarguments{:}); endif ## Print additional information if option Stats is set