Solve moderately stiff ODEs and DAEs — trapezoidal rule
[
, wheret
,y
] = ode23t(odefun
,tspan
,y0
)tspan = [t0 tf]
, integrates the system of differential equations
fromt0
totf
with initial conditionsy0
。Each row in the solution arrayy
corresponds to a value returned in column vectort
。
All MATLAB®ODE solvers can solve systems of equations of the form
, or problems that involve a mass matrix,
。解决所有使用类似的语法。的ode23s
solver only can solve problems with a mass matrix if the mass matrix is constant.ode15s
andode23t
can solve problems with a mass matrix that is singular, known as differential-algebraic equations (DAEs). Specify the mass matrix using theMass
option ofodeset
。
[
additionally finds where functions of(t,y), called event functions, are zero. In the output,t
,y
,te
,ye
,ie
] = ode23t(odefun
,tspan
,y0
,options
)te
is the time of the event,ye
is the solution at the time of the event, andie
is the index of the triggered event.
For each event function, specify whether the integration is to terminate at a zero and whether the direction of the zero crossing matters. Do this by setting the'Events'
property to a function, such asmyEventFcn
or@myEventFcn
, and creating a corresponding function: [value
,isterminal
,direction
] =myEventFcn
(t
,y
). For more information, seeODE Event Location。
returns a structure that you can use withsol
= ode23t(___)deval
to evaluate the solution at any point on the interval[t0 tf]
。You can use any of the input argument combinations in previous syntaxes.
ode23t
is an implementation of the trapezoidal rule using a “free” interpolant. This solver is preferred overode15s
if the problem is only moderately stiff and you need a solution without numerical damping.ode23t
also can solve differential algebraic equations (DAEs)[1],[2]。
[1] Shampine, L. F., M. W. Reichelt, and J.A. Kierzenka, “Solving Index-1 DAEs in MATLAB and Simulink”,SIAM Review, Vol. 41, 1999, pp. 538–552.
[2] Shampine, L. F. and M. E. Hosea, “Analysis and Implementation of TR-BDF2,”Applied Numerical Mathematics 20, 1996.