lsode - Maple Help

dsolve/numeric/lsode

numerical solution of ordinary differential equations

 Calling Sequence dsolve(odesys, numeric, method=lsode) dsolve(odesys, numeric, method=lsode[choice], vars, options) dsolve(numeric, method=lsode[choice], procopts, options)

Parameters

 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].

Description

 • 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].
 Prefixes:
 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' = numeric 'initial' = array 'procvars' = list 'startinit' = boolean 'implicit' = boolean 'optimize' = boolean 'abserr' = numeric 'relerr' = numeric 'initstep' = numeric 'minstep' = numeric 'maxstep' = numeric 'maxfun' = integer

 'output'
 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 $\mathrm{abserr}=1.×{10}^{-7}$ and $\mathrm{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, $\mathrm{minstep}=0$, $\mathrm{maxstep}=\mathrm{\infty }$, and initstep is determined by the solver.
 'maxfun'
 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 $\mathrm{ctrl}$ and $\mathrm{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.

Examples

 > $\mathrm{Digits}≔10:$
 > $\mathrm{deqn1}≔\left\{\frac{{ⅆ}^{3}}{ⅆ{x}^{3}}y\left(x\right)=y\left(x\right)\left(\frac{ⅆ}{ⅆx}y\left(x\right)\right)-x\right\}$
 ${\mathrm{deqn1}}{≔}\left\{\frac{{{ⅆ}}^{{3}}}{{ⅆ}{{x}}^{{3}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right){=}{y}{}\left({x}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right){-}{x}\right\}$ (1)
 > $\mathrm{init1}≔\left\{{\mathrm{D}}^{\left(2\right)}\left(y\right)\left(1\right)=4,\mathrm{D}\left(y\right)\left(1\right)=3,y\left(1\right)=2.4\right\}$
 ${\mathrm{init1}}{≔}\left\{{y}{}\left({1}\right){=}{2.4}{,}{\mathrm{D}}{}\left({y}\right){}\left({1}\right){=}{3}{,}{{\mathrm{D}}}^{\left({2}\right)}{}\left({y}\right){}\left({1}\right){=}{4}\right\}$ (2)
 > $\mathrm{ans1}≔\mathrm{dsolve}\left(\mathrm{deqn1}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}∪\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{init1},\mathrm{numeric},\mathrm{method}={\mathrm{lsode}}_{\mathrm{adamsfull}}\right)$
 ${\mathrm{ans1}}{≔}{\mathbf{proc}}\left({\mathrm{x_lsode}}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (3)
 > $\mathrm{ans1}\left(1.5\right)$
 $\left[{x}{=}{1.5}{,}{y}{}\left({x}\right){=}{4.59316878380163}{,}\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right){=}{6.33685490613476}{,}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right){=}{11.0436021501495}\right]$ (4)
 > $\mathrm{ans2}≔\mathrm{dsolve}\left(\left\{xy\left(x\right)-\mathrm{sin}\left(y\left(x\right)\right)=\frac{ⅆ}{ⅆx}y\left(x\right),y\left(0\right)=-5.\right\},\mathrm{numeric},\mathrm{method}=\mathrm{lsode}\right)$
 ${\mathrm{ans2}}{≔}{\mathbf{proc}}\left({\mathrm{x_lsode}}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (5)
 > $\mathrm{ans2}\left(0.45\right)$
 $\left[{x}{=}{0.45}{,}{y}{}\left({x}\right){=}{-5.90260258275327}\right]$ (6)
 > $\mathrm{ans2}\left(0.2\right)$
 $\left[{x}{=}{0.2}{,}{y}{}\left({x}\right){=}{-5.28590204334243}\right]$ (7)
 > $\mathrm{Digits}≔20:$
 > $\mathrm{deqn3}≔\frac{{ⅆ}^{3}}{ⅆ{x}^{3}}y\left(x\right)-y\left(x\right)x\left(\frac{ⅆ}{ⅆx}y\left(x\right)\right)=5$
 ${\mathrm{deqn3}}{≔}\frac{{{ⅆ}}^{{3}}}{{ⅆ}{{x}}^{{3}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right){-}{y}{}\left({x}\right){}{x}{}\left(\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right){=}{5}$ (8)
 > $\mathrm{init3}≔y\left(0\right)=1,{\mathrm{D}}^{\left(2\right)}\left(y\right)\left(0\right)=-1,\mathrm{D}\left(y\right)\left(0\right)=2$
 ${\mathrm{init3}}{≔}{y}{}\left({0}\right){=}{1}{,}{{\mathrm{D}}}^{\left({2}\right)}{}\left({y}\right){}\left({0}\right){=}{-1}{,}{\mathrm{D}}{}\left({y}\right){}\left({0}\right){=}{2}$ (9)
 > $\mathrm{ans3}≔\mathrm{dsolve}\left(\left\{\mathrm{deqn3},\mathrm{init3}\right\},\mathrm{numeric},\mathrm{method}={\mathrm{lsode}}_{\mathrm{backdiag}},\mathrm{output}=\mathrm{Array}\left(\left[0.5,0.75,1\right]\right)\right)$
 ${\mathrm{ans3}}{≔}\left[\begin{array}{c}{\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[\left[\begin{array}{cccc}x& y{}\left(x\right)& \frac{ⅆ}{ⅆx}{}y{}\left(x\right)& \frac{ⅆ}{ⅆx}{}\left(\frac{ⅆ}{ⅆx}{}y{}\left(x\right)\right)\end{array}\right]\right]\right)\\ {\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[\left[\begin{array}{cccc}0.5& 1.9861505790900524653& 2.1854230152999678772& 1.9145972690218210913\\ 0.75& 2.6127136475067636077& 2.9168200991563483693& 4.0819522302553231726\\ 1.& 3.5018154346466628545& 4.3471528951268479671& 7.7494282873588280907\end{array}\right]\right]\right)\end{array}\right]$ (10)

References

 Hindmarsh, Alan C.; Stepleman, R. S.; et al. eds. Odepack, a Systemized Collection of ODE Solvers. Amsterdam: North-Holland, 1983.