classical - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


dsolve/numeric/classical

numerical solution of ordinary differential equations

 

Calling Sequence

Parameters

Description

Examples

References

Calling Sequence

dsolve(odesys, numeric, method=classical)

dsolve(odesys, numeric, method=classical[choice], vars, options)

dsolve(numeric, method=classical[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=classical

-

literal equation; numerical method to use

method=classical[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=classical or method=classical[choice] finds a numerical solution by using one of the classical numerical methods as described in the following.

  

These methods use a fixed step size, provide no error estimation or correction, and are provided primarily for educational purposes. If practical numerical solution of ODE initial value problems (IVP) is required, it is suggested that any of the other methods mentioned in dsolve[numeric,IVP] help page be used instead.

• 

A number of classical methods are available through use of the choice option in the method=classical[choice] selection. The default is foreuler, the forward Euler method.

• 

The available choices of the classical method are described for the problem y'=ft,y, where Yi is the estimated value of the solution at the time ti, h is the fixed step size titi1, and for each formula the value of the solution Yn+1 at time tn+1 is being computed.

• 

foreuler is the forward Euler method specified by the equation:

Yn+1=Yn+hftn,Yn

• 

heunform is the Heun formula (also known as the improved Euler method). It uses the forward Euler method to predict the solution, and then applies the trapezoid rule as a corrector. It is specified by the pair of equations:

Yp=Yn+hftn,Yn

Yn+1=Yn+hftn,Yn+ftn+1,Yp2

• 

impoly is the improved polygon method (also known as the modified Euler method), as specified by the equation:

Yn+1=Yn+hftn+h2,Yn+hftn,Yn2

• 

rk2 is the second-order classical Runge-Kutta method, as specified by:

k1=ftn,Yn

k2=ftn+h,hk1+Yn

Yn+1=Yn+hk1+k22

  

Note: This is the same as the Heun formula.

• 

rk3 is the third-order classical Runge-Kutta method, as specified by:

k1=ftn,Yn

k2=ftn+h2,Yn+hk12

k3=ftn+h,Yn+hk1+2k2

Yn+1=Yn+hk1+4k2+k36

• 

rk4 is the fourth-order classical Runge-Kutta method, as specified by:

k1=ftn,Yn

k2=ftn+h2,Yn+hk12

k3=ftn+h2,Yn+hk22

k4=ftn+h,hk3+Yn

Yn+1=Yn+hk1+2k2+2k3+k46

  

This is not to be confused with method=rkf45, which uses a Fehlberg fourth-fifth order Runge-Kutta method.

• 

adambash is the Adams-Bashforth method (a predictor method), as specified by:

Yn+1=Yn+h55ftn,Yn59ftn1,Yn1+37ftn2,Yn29ftn3,Yn324

• 

abmoulton is the Adams-Bashforth-Moulton method (a predictor-corrector method), as specified by:

Yn+1=Yn+h9ftn+1,Yn+1+19ftn,Yn5ftn1,Yn1+ftn2,Yn224,

  

where ftn+1,Yn+1 is found by first applying the Adams-Bashforth method (the predictor), then using the above Adams-Bashforth-Moulton method (the corrector).

• 

Note that both adambash and abmoulton are multipoint methods that require the initial condition and three other equally spaced starting values. These starting values are obtained by computing the first 3 steps using the rk4 method. In addition, since fixed spacing is required for use of these methods, the final step used in obtaining requested solution values also uses the rk4 method (as there is no guarantee that solution values will only be requested at exact multiples of the step size).

• 

The following options are available for the classical 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

'stepsize'

=

numeric

'corrections'

=

integer

  

 

  

'output'

  

Specifies the desired output from dsolve, and the known option specifies user-defined known functions. For more information, see dsolve[numeric].

  

 

  

'maxfun'

  

Specifies a maximum on the number of evaluations of the right-hand side of the first order ODE system. This option can be disabled by specifying maxfun=0. The default value for classical methods is 50000. For more information, see dsolve[maxfun].

  

 

  

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

  

 

  

'stepsize'

  

Specifies the static size of each step. Note that classical does not use error correction estimates to adapt the step size. The default step size is h=minTf3T03,0.005 for forward integration and h=maxTf3T03,−0.005 for backward integration, respectively, where the problem is solved over the interval from T0 to Tf.

  

 

  

'corrections'

  

A positive integer that specifies the number of corrections that should be applied for the abmoulton method at each step. It is recommended that this number not exceed 4 (values greater than 4 generally do not produce more accurate results, and result in longer running times).

  

 

• 

Results can be plotted using the odeplot function in the plots package.

Examples

dsys1diffyt,`$`t,3=yt+diffxt,t,diffxt,`$`t,2=xtytdiffyt,`$`t,2

dsys1ⅆ3ⅆt3yt=yt+ⅆⅆtxt,ⅆ2ⅆt2xt=xtytⅆ2ⅆt2yt

(1)

init1y0=1,Dy0=2,D2y0=1,x0=4,Dx0=4.3

init1y0=1,Dy0=2,D2y0=−1,x0=4,Dx0=4.3

(2)

ans1dsolvedsys1,init1,numeric,method=classicalabmoulton,corrections=2

ans1procx_classical...end proc

(3)

ans11.0

t=1.0,xt=13.1246093792716,ⅆⅆtxt=18.7876915350014,yt=3.76283413230601,ⅆⅆtyt=5.31760397608216,ⅆ2ⅆt2yt=10.2504683623596

(4)

deq2diffyx,`$`x,2=yx

deq2ⅆ2ⅆx2yx=yx

(5)

init2y0=1,Dy0=1

init2y0=1,Dy0=1

(6)

Digits20:

ans2dsolvedeq2,init2,numeric,method=classicalheunform,output=Array0.01,0.1,1,stepsize=0.001

ans2xyxⅆⅆxyx0.011.01005016540201317151.01005016540201317150.11.10517089966994158801.10517089966994158801.2.71828137575176083992.7182813757517608399

(7)

Digits10:

deq3diffyt,`$`t,4diffyt,`$`t,3=ytt2

deq3ⅆ4ⅆt4ytⅆ3ⅆt3yt=ytt2

(8)

init3y0=3.56,Dy0=12,D2y0=4,D3y0=6.544

init3y0=3.56,Dy0=12,D2y0=−4,D3y0=6.544

(9)

ans3dsolvedeq3unioninit3,numeric,method=classicalrk3,output=listprocedure:

sol3evalyt,ans3

sol3proct...end proc

(10)

sol30

3.56

(11)

sol30.56

9.87504792480695

(12)

References

  

Boyce, W.E., and DiPrima, R.C. Elementary Differential Equations and Boundary Value Problems. 5th ed. New York: Wiley, 1992.

  

Conte, S.D., and C. de Boor. Elementary Numerical Analysis, An Algorithmic Approach. McGraw-Hill, 1980.

  

Fox, L., and Mayers, D.F. Numerical Solution of Ordinary Differential Equations for Scientists and Engineers. Chapman & Hall, 1987.

  

Lambert, J.D. Computational Methods in Ordinary Differential Equations. New York: Wiley, 1973.

See Also

dsolve[ck45]

dsolve[dverk78]

dsolve[gear]

dsolve[lsode]

dsolve[maxfun]

dsolve[numeric,IVP]

dsolve[numeric]

dsolve[rkf45]

dsolve[rosenbrock]

dsolve[taylorseries]

plots[odeplot]