ode15i

Variable-order solver for fully implicit differential equations f(t, y, y') = 0.

Category: Mathematics > Numerical Integration and Differential Equations

Syntax

[t, y] = ode15i(odefun, tspan, y0, yp0)

Integrates odefun(t, y, yp) = 0 from consistent initial values y0, yp0.

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

Also applies options from odeset.

Description

Unlike the other ODE solvers, ode15i does not require the equation to be solved for y', so it can handle implicit problems and many differential-algebraic systems. It uses backward differentiation formulas of variable order.

The initial values must be consistent, that is, they must make the residual zero at t0. Use decic to repair a guess that is almost right.

Input arguments

odefun
Handle res = odefun(t, y, yp) returning the residual vector.
tspan
[t0 tf] or a vector of output times.
y0, yp0
Initial values of the solution and of its derivative; they must satisfy the equation (see decic).

Output arguments

t, y
Time points and solution, laid out as for ode45.

Example

y' + y = 0 in implicit form

f = @(t, y, yp) yp + y;
[t, y] = ode15i(f, [0 1], 1, -1);
fprintf('%.3f %.3f\n', y(end), exp(-1))
Output
0.368 0.368

See also

decic ode15s odeset ode45