ode23t
Trapezoidal-rule solver for moderately stiff equations and differential-algebraic systems.
Category: Mathematics > Numerical Integration and Differential Equations
Syntax
[t, y] = ode23t(odefun, tspan, y0)
Integrates y' = odefun(t, y).
[t, y] = ode23t(odefun, tspan, y0, options)
Also applies options from odeset, including a 'Mass' matrix.
Description
The implicit trapezoidal rule, with a free interpolant, does not damp oscillations, which makes ode23t the stiff solver to prefer when the solution is oscillatory and you want to keep its amplitude. It accepts a singular mass matrix, so it also solves index-1 differential-algebraic equations.
For strong damping of stiff transients, ode15s or ode23tb are better.
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
Decay toward a cosine
f = @(t, y) -50*(y - cos(t));
[t, y] = ode23t(f, [0 1], 0);
fprintf('%.3f\n', y(end))
Output
0.557