dsolve/numeric/lsode
numerical solution of ordinary differential equations
Calling Sequence
Parameters
Description
Examples
References
dsolve(odesys, numeric, method=lsode)
dsolve(odesys, numeric, method=lsode[choice], vars, options)
dsolve(numeric, method=lsode[choice], procopts, options)
odesys
-
set or list; ordinary differential equation(s) and initial conditions
numeric
literal name; instruct dsolve to find a numerical solution
method=lsode
literal equation; numerical method to use
method=lsode[choice]
equation; numerical method and submethod to use
vars
(optional) dependent variable or a set or list of dependent variables for odesys
options
(optional) equations of the form keyword = value
procopts
options used to specify the ODE system using a procedure (procedure, initial, start, number, and procvars). For more information, see dsolve[numeric,IVP].
The dsolve command with the numeric option and method=lsode or method=lsode[choice] finds a numerical solution using the Livermore Stiff ODE solver. The default choice is adamsfunc, which is defined below.
The lsode method can be used to numerically solve stiff ODE initial value problems. For more information, see dsolve[Stiffness].
The choice for the submethod of the lsode method is one of adamsfunc, adamsfull, adamsdiag, adamsband, backfunc, backfull, backdiag, and backband.
Prefixes:
adams*
Specifies an implicit Adams method of evaluation
back*
Specifies a method based on backward differentiation formulas
Suffixes:
*func
Uses functional iteration (no Jacobian matrix is involved)
*full
Uses chord iteration with an internally generated (difference quotient) full Jacobian
*diag
Uses chord iteration with an internally generated diagonal Jacobian approximation
*band
Uses chord iteration with an internally generated banded Jacobian
If choice is either adamsband or backband, the user must also supply the optional equation ctrl=array with mu and ml set (to specify the bandwidth of the Jacobian matrix). For more details, see dsolve[lsode,advanced].
By setting infolevel[`dsolve/lsode`] or infolevel[dsolve] to 2, information on the last mesh point evaluation is provided in the event of an error.
The following options are available for the basic use form of the lsode method:
'output'
=
keyword or array
'known'
name or list of names
'number'
integer
'procedure'
procedure
'start'
'initial'
array
'procvars'
list
'startinit'
boolean
'implicit'
'optimize'
'abserr'
'relerr'
'initstep'
'minstep'
'maxstep'
'maxfun'
Note: See also information about the advanced use form of the lsode method in dsolve[lsode,advanced].
Specifies the desired output from dsolve, and the known option specifies user-defined known functions, and these options are discussed in dsolve[numeric].
'number', 'procedure', 'start', 'initial', and 'procvars'
These options are used to specify the IVP using procedures. For more information, see dsolve[numeric,IVP].
'startinit','implicit', and 'optimize'
These options control the method and behavior of the computation. For more information on the first two, see dsolve[numeric,IVP], for the last, see dsolve[numeric].
'abserr' and 'relerr'
Control the error introduced in any individual step. The error is computed as a weighted root-mean square norm (rms-norm) of the errors of the individual solution components, and is required to be below 1 for a successful step. The default values are abserr=1.×10−7 and relerr=1.×10−7. For more details about the error control method, and the rms-norm used, see dsolve[Error_Control].
'initstep', 'minstep', and 'maxstep'
Enable more detailed control of the step size. These options are also discussed in dsolve[Error_Control]. By default, minstep=0, maxstep=∞, and initstep is determined by the solver.
An integer that specifies the maximum on the number of evaluations of the ODE or ODE system in one call to the returned procedure. This limits the amount of work done on any individual call (See dsolve[maxfun]). This is relevant for the procedure-style output only. By default this value is set to zero (disabled).
Much finer control over the behavior of the lsode method is possible through use of the ctrl and itask options, including the capability of running partial calculations, specification of the band width of the Jacobian to be used, control over the approximation order used in the method, and so on. These options are somewhat complex, and discussed in detail in dsolve[lsode,advanced].
The computation may return with an error message corresponding to an error condition of the lsode procedure.
Results can be plotted using the function odeplot in the plots package.
Digits≔10:
deqn1≔diff⁡y⁡x,`$`⁡x,3=y⁡x⁢diff⁡y⁡x,x−x
deqn1≔ⅆ3ⅆx3y⁡x=y⁡x⁢ⅆⅆxy⁡x−x
init1≔y⁡1=2.4,D⁡y⁡1=3,D2⁡y⁡1=4
ans1≔dsolve⁡deqn1unioninit1,numeric,method=lsodeadamsfull
ans1 ≔ procx_lsode...end proc
ans1⁡1.5
x=1.5,y⁡x=4.59316878380163,ⅆⅆxy⁡x=6.33685490613476,ⅆ2ⅆx2y⁡x=11.0436021501495
ans2≔dsolve⁡x⁢y⁡x−sin⁡y⁡x=diff⁡y⁡x,x,y⁡0=−5.,numeric,method=lsode
ans2 ≔ procx_lsode...end proc
ans2⁡0.45
x=0.45,y⁡x=−5.90260258275327
ans2⁡0.2
x=0.2,y⁡x=−5.28590204334243
Digits≔20:
deqn3≔diff⁡y⁡x,`$`⁡x,3−y⁡x⁢x⁢diff⁡y⁡x,x=5
deqn3≔ⅆ3ⅆx3y⁡x−y⁡x⁢x⁢ⅆⅆxy⁡x=5
init3≔y⁡0=1,D2⁡y⁡0=−1,D⁡y⁡0=2
ans3≔dsolve⁡deqn3,init3,numeric,method=lsodebackdiag,output=Array⁡0.5,0.75,1
ans3≔xy⁡xⅆⅆxy⁡xⅆ2ⅆx2y⁡x0.51.98615057909005246532.18542301529996787721.91459726902182109130.752.61271364750676360772.91682009915634836934.08195223025532317261.3.50181543464666285454.34715289512684796717.7494282873588280907
Hindmarsh, Alan C.; Stepleman, R. S.; et al. eds. Odepack, a Systemized Collection of ODE Solvers. Amsterdam: North-Holland, 1983.
See Also
dsolve/Error_Control
dsolve[ck45]
dsolve[classical]
dsolve[dverk78]
dsolve[gear]
dsolve[lsode,advanced]
dsolve[maxfun]
dsolve[numeric,IVP]
dsolve[numeric]
dsolve[rkf45]
dsolve[rosenbrock]
dsolve[Stiffness]
dsolve[taylorseries]
plots[odeplot]
Download Help Document