 dsolve/numeric/gear - Maple Programming Help

Home : Support : Online Help : Mathematics : Differential Equations : dsolve : numeric : Methods : dsolve/gear

dsolve/numeric/gear

numerical solution of ordinary differential equations

 Calling Sequence dsolve($\mathrm{odesys}$, numeric, method=gear) dsolve($\mathrm{odesys}$, numeric, method=gear[choice], vars, options) dsolve(numeric, method=gear[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=gear - literal equation; numerical method to use method=gear[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 options numeric and method=gear or method=gear[choice] finds a numerical solution using a Gear single-step extrapolation method.
 • The choice for the gear method are bstoer and polyextr.  The default bstoer choice is a Burlirsch-Stoer rational extrapolation method and the polyextr choice uses polynomial extrapolation.
 • By setting infolevel[dsolve/gear] or infolevel[dsolve] to 2, information about the last mesh point evaluation is provided in the event of an error.
 • The following options are available for the gear method.

 'output' = keyword or array 'known' = name or list of names 'maxfun' = integer 'number' = integer 'procedure' = procedure 'start' = numeric 'initial' = array 'procvars' = list 'startinit' = boolean 'implicit' = boolean 'optimize' = boolean 'abserr' = numeric 'relerr' = numeric 'initstep' = numeric 'maxstep' = numeric 'minstep' = numeric 'maxord' = integer 'maxpts' = integer

 'output','known'
 The 'output' option specifies the desired output from dsolve, and the known option specifies user-defined known functions. These options are discussed in dsolve[numeric].
 'maxfun'
 Specifies a maximum on the number of evaluations of the right-hand side of the first order ODE system (See dsolve[maxfun]). This option can be disabled by specifying $\mathrm{maxfun}=0$. By default this option is disabled.
 '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'
 Specify the desired accuracy of the solution, and are discussed in dsolve[Error_Control]. The default values for gear are $\mathrm{abserr}=1.{10}^{-7}$ and $\mathrm{relerr}=1.{10}^{-7}$.
 'minstep', 'maxstep', and 'initstep'
 Provide finer control over the step size used in the method, and are also discussed in dsolve[Error_Control]. By default $\mathrm{minstep}=0.00001$, $\mathrm{maxstep}$ is disabled, and $\mathrm{initstep}=0.00001$. When setting $\mathrm{minstep}$ ensure that the value is adequately small to allow for the first few steps.
 'maxord'
 A positive integer, specifying the maximum order of extrapolation allowed. It must be less than $11$ (values of $6$ or less are recommended). The default value is $4$.
 'maxpts'
 A positive integer, specifying the maximum number of different single unit step sizes used in the extrapolation process (values less than $10$ are recommended). The default is $6$.
 • The computation may return with an error message corresponding to an error condition of the gear procedure.
 • Results can be plotted using the function odeplot in the plots package.

Examples

 > $\mathrm{Digits}≔10:$
 > $\mathrm{deq1}≔\left\{\mathrm{diff}\left(y\left(x\right),\mathrm{}\left(x,3\right)\right)=y\left(x\right)\mathrm{diff}\left(y\left(x\right),x\right)-x\right\}$
 ${\mathrm{deq1}}{≔}\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\{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\}$
 ${\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{deq1}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{union}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{init1},\mathrm{numeric},\mathrm{method}=\mathrm{gear}\left[\mathrm{polyextr}\right],\mathrm{initstep}=0.015,\mathrm{minstep}=\mathrm{Float}\left(1,-11\right),\mathrm{abserr}=\mathrm{Float}\left(1,-5\right),\mathrm{relerr}=\mathrm{Float}\left(1,-5\right)\right):$
 > $\mathrm{ans1}\left(1.01\right)$
 $\left[{x}{=}{1.01}{,}{y}{}\left({x}\right){=}{2.43020104070930}{,}\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right){=}{3.04031295467142}{,}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right){=}{4.06288854913227}\right]$ (3)
 > $\mathrm{dsys2}≔\left\{xy\left(x\right)-\mathrm{sin}\left(y\left(x\right)\right)=\mathrm{diff}\left(y\left(x\right),x\right),y\left(0\right)=-5.\right\}$
 ${\mathrm{dsys2}}{≔}\left\{{x}{}{y}{}\left({x}\right){-}{\mathrm{sin}}{}\left({y}{}\left({x}\right)\right){=}\frac{{ⅆ}}{{ⅆ}{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right){,}{y}{}\left({0}\right){=}{-5.}\right\}$ (4)
 > $\mathrm{ans2}≔\mathrm{dsolve}\left(\mathrm{dsys2},\mathrm{numeric},\mathrm{method}=\mathrm{gear},\mathrm{maxord}=3\right):$
 > $\mathrm{ans2}\left(0.45\right)$
 $\left[{x}{=}{0.45}{,}{y}{}\left({x}\right){=}{-5.90260241046659}\right]$ (5)
 > $\mathrm{ans2}\left(0.9\right)$
 $\left[{x}{=}{0.9}{,}{y}{}\left({x}\right){=}{-7.81336992184499}\right]$ (6)
 > $\mathrm{Digits}≔25:$
 > $\mathrm{deq3}≔\mathrm{diff}\left(y\left(z\right),\mathrm{}\left(z,3\right)\right)-y\left(z\right)z\mathrm{diff}\left(y\left(z\right),z\right)=5$
 ${\mathrm{deq3}}{≔}\frac{{{ⅆ}}^{{3}}}{{ⅆ}{{z}}^{{3}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({z}\right){-}{y}{}\left({z}\right){}{z}{}\left(\frac{{ⅆ}}{{ⅆ}{z}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({z}\right)\right){=}{5}$ (7)
 > $\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}$ (8)
 > $\mathrm{ans3}≔\mathrm{dsolve}\left(\left\{\mathrm{deq3},\mathrm{init3}\right\},\mathrm{numeric},\mathrm{method}=\mathrm{gear}\left[\mathrm{bstoer}\right],\mathrm{maxpts}=4\right):$
 > $\mathrm{ans3}\left(-1\right)$
 $\left[{z}{=}{-1.}{,}{y}{}\left({z}\right){=}{-2.348282662951510120622879}{,}\frac{{ⅆ}}{{ⅆ}{z}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({z}\right){=}{5.767096382629485105229235}{,}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{z}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({z}\right){=}{-8.239613529231847035339209}\right]$ (9)
 > $\mathrm{ans3}\left(0\right)$
 $\left[{z}{=}{0.}{,}{y}{}\left({z}\right){=}{1.}{,}\frac{{ⅆ}}{{ⅆ}{z}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({z}\right){=}{2.}{,}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{z}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({z}\right){=}{-1.}\right]$ (10)

References

 Gear, C.W. Numerical Initial Value Problems in Ordinary Differential Equations. Prentice-Hall, 1971.