ode_stiff
Builtin index · Signal processing
ode_stiff(f, tspan, y0, [rtol=1e-6], [atol=1e-9], [max_step=], [t_eval=], [events=], [direction=0], [terminal=false], [max_steps=500000])
Input: f, tspan, y0, rtol, atol, max_step, t_eval, events, direction, terminal, max_steps · Output: no output
What it is
Stiff solver: the Shampine-Reichelt Rosenbrock 2(3) pair (MATLAB's ode23s), A-stable, with a forward-difference Jacobian recomputed after every accepted step (n + 1 extra evaluations of f, counted in nfev) -- there is no jac=. Use it when ode45 needs very many tiny steps (Robertson's kinetics to t = 40 at the default tolerances takes about 150 steps here; ode45 needs about 35,000). It is only second order, so asking for tight tolerances is expensive, and its error estimate is conservative on forced problems (a smooth driven stiff problem still takes thousands of steps, though far fewer than ode45); a singular I - h*d*J shrinks the step. Same arguments, result record and events as ode45.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
ode_stiff(f, tspan, y0, [rtol=1e-6], [atol=1e-9], [max_step=], [t_eval=], [events=], [direction=0], [terminal=false], [max_steps=500000]) | f —Stiff solver: the Shampine-Reichelt Rosenbrock 2(3) pair (MATLAB's ode23s), A-stable, with a forward-difference Jacobian recomputed after every accepted step (n + 1 extra evaluations of f, counted in nfev) -- there is no jac=.tspan —not documented yety0 —not documented yetrtol optional (default 1e-6)not documented yetatol optional (default 1e-9)not documented yetmax_step optionalnot documented yett_eval optionalnot documented yetevents optionalSame arguments, result record and events as ode45.direction optional (default 0)not documented yetterminal optional (default false)not documented yetmax_steps optional (default 500000)not documented yet | not documented yet | Use it when ode45 needs very many tiny steps (Robertson's kinetics to t = 40 at the default tolerances takes about 150 steps here; ode45 needs about 35,000). It is only second order, so asking for tight tolerances is expensive, and its error estimate is conservative on forced problems (a smooth driven stiff problem still takes thousands of steps, though far fewer than ode45); a singular I - h*d*J shrinks the step. |
Examples
No documentation example calls this form yet. The Signal processing chapter is where one belongs.
How it works
and general minimization. Only a user-defined function (by name, the same convention pmap/spawn use) can be the target of any of these — not a builtin. fzero(f, a, b, [tol=1e-10], [max_iter=100]) — Brent's method: robust root finding (guaranteed convergence given a bracket [a,b] where f changes sign), no derivative needed. The "something better than plain bisection" choice.
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.