ode89

Eighth- and ninth-order Runge-Kutta solver for nonstiff equations with very tight tolerances.

Category: Mathematics > Numerical Integration and Differential Equations

Syntax

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

Integrates y' = odefun(t, y).

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

Also applies options from odeset.

Description

ode89 is the highest-order explicit solver of the family. It pays off for very smooth solutions integrated over long spans at strict tolerances, where it reaches a given accuracy with the fewest function evaluations.

Like all explicit methods, it takes very small steps on stiff problems; use ode15s there.

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

Strict tolerance

opts = odeset('RelTol', 1e-12, 'AbsTol', 1e-14);
[t, y] = ode89(@(t, y) -y, [0 1], 1, opts);
fprintf('%.10f %.10f\n', y(end), exp(-1))
Output
0.3678794412 0.3678794412

See also

ode78 ode45 ode113 odeset