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

 > Digits := 10:
 > deq1 := {diff(y(x),x$3) = y(x)*diff(y(x),x)-x};  ${\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)  > init1 := {(D@@2)(y)(1) = 4, D(y)(1) = 3, y(1) = 2.4 };  ${\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)  > ans1 := dsolve(deq1 union init1, numeric, method=gear[polyextr], initstep=0.015, minstep=Float(1,-11), abserr=Float(1,-5), relerr=Float(1,-5)):  > ans1(1.01);  $\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)  > dsys2 := {x*y(x) - sin(y(x)) = diff(y(x), x), y(0) = -5.};  ${\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)  > ans2 := dsolve(dsys2, numeric, method=gear, maxord=3):  > ans2(0.45);  $\left[{x}{=}{0.45}{,}{y}{}\left({x}\right){=}{-5.90260241046659}\right]$ (5)  > ans2(0.9);  $\left[{x}{=}{0.9}{,}{y}{}\left({x}\right){=}{-7.81336992184499}\right]$ (6)  > Digits := 25:  > deq3 := diff(y(z), z$3) - y(z)*z*diff(y(z),z) = 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)
 > init3 := y(0) = 1, (D@@2)(y)(0) = -1, D(y)(0) = 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)
 > ans3 := dsolve({deq3, init3}, numeric, method=gear[bstoer],                  maxpts=4):
 > ans3(-1);
 $\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)
 > ans3(0);
 $\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.