ode23s
One-step solver for stiff differential equations, based on a modified Rosenbrock formula.
Category: Mathematics > Numerical Integration and Differential Equations
Syntax
[t, y] = ode23s(odefun, tspan, y0)
Integrates the stiff system y' = odefun(t, y).
[t, y] = ode23s(odefun, tspan, y0, options)
Also applies options from odeset; supplying 'Jacobian' improves speed.
Description
As a one-step method it needs no history, so it restarts cleanly after a discontinuity and can be more efficient than ode15s at crude tolerances. It forms and factors the Jacobian at each step, so for large systems giving a sparse Jacobian matters.
Use it when ode45 takes very small steps although the solution looks smooth.
Input arguments
odefun- Handle
dydt = odefun(t, y). tspan[t0 tf]or a vector of output times.y0- Vector of initial values.
Output arguments
t, y- Time points and solution, laid out as for
ode45.
Example
Stiff decay
f = @(t, y) -100*(y - cos(t));
[t, y] = ode23s(f, [0 1], 0);
fprintf('%.3f\n', y(end))
Output
0.549