ode113

Variable-order Adams-Bashforth-Moulton solver for nonstiff differential equations.

Category: Mathematics > Numerical Integration and Differential Equations

Syntax

[t, y] = ode113(odefun, tspan, y0)

Integrates y' = odefun(t, y) over tspan from the initial condition y0.

[t, y] = ode113(odefun, tspan, y0, options)

Also applies options from odeset.

sol = ode113(___)

Returns a structure for use with deval.

Description

A multistep method reuses earlier derivative values, so each step needs few evaluations of odefun. That makes ode113 efficient when the function is expensive to evaluate and the solution is smooth, and it handles stringent tolerances well.

It is not suited to stiff problems (use ode15s) nor to solutions with sharp discontinuities, where a one-step method like ode45 is better.

Input arguments

odefun
Handle dydt = odefun(t, y) returning a column vector.
tspan
[t0 tf], or a longer vector of times at which to report the solution.
y0
Vector of initial values.
options
Structure from odeset (tolerances, events, and so on).

Output arguments

t
Column vector of time points.
y
Array with one row per time and one column per component.

Example

Exponential decay

[t, y] = ode113(@(t, y) -y, [0 1], 1);
fprintf('%.4f %.4f\n', y(end), exp(-1))
Output
0.3679 0.3679

See also

ode45 ode15s odeset deval