dsolve/numeric/ck45 - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

dsolve/numeric/ck45

find numerical solution of ordinary differential equations

 

Calling Sequence

Parameters

Description

Examples

References

Calling Sequence

dsolve(odesys, numeric, method=ck45, vars, options)

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

-

literal equation; numerical method to use

vars

-

(optional) any indeterminate function of one variable, or a set or list of them, representing the unknowns of the ODE problem

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=ck45 finds a numerical solution using a Cash-Karp fourth-fifth order Runge-Kutta method with degree four interpolant. This is another non-stiff method, the default being dsolve/rkf45, of the type=numeric solution for initial value problems when the stiff argument is not used.

Modes of Operation

The ck45 method has two distinct modes of operation (for procedure-type outputs).

• 

With the range option

  

When used with the range option, the method computes the solution for the IVP over the specified range, storing the solution information internally, and uses that information to rapidly interpolate the desired solution value for any call to the returned procedure(s).

  

Though possible, it is not recommended that the returned procedure be called for points outside the specified range.

  

This method can be used in combination with the refine option of odeplot to produce an adaptive plot. (That is, odeplot uses the precomputed points to produce the plot when refine is specified.)

  

It is not recommended that this method be used for problems in which the solution can become singular, because each step is stored, and many steps may be taken when near a singularity, so memory usage can become a significant issue.

  

The storage of the interpolant used by this method can be disabled by using the interpolation=false option described below. This is recommended for high accuracy solutions where storage of the interpolant (in addition to the discrete solution) requires too much memory. Disabling the interpolant is not generally recommended because the solution values are obtained from an interpolation of the 5 closest points, and does not necessarily provide an interpolant with order 4 error.

• 

Without the range option

  

When used without the range option, the IVP solution values are not stored, but rather computed when requested.

  

Because not all solution values are stored, computation must restart at the initial values whenever a point is requested between the initial point and the most recently computed point (to avoid reversal of the integration direction), so it is advisable to collect solution values moving away from the initial value.

Options

• 

The following options are available for the ck45 method.

'output'

=

keyword or array

'known'

=

name or list of names

'abserr'

=

numeric

'relerr'

=

numeric

'initstep'

=

numeric

'interr'

=

boolean

'maxfun'

=

integer

'number'

=

integer

'procedure'

=

procedure

'start'

=

numeric

'initial'

=

array

'procvars'

=

list

'startinit'

=

boolean

'implicit'

=

boolean

'optimize'

=

boolean

'compile'

=

boolean or auto

'range'

=

numeric..numeric

'events'

=

list

'event_pre'

=

keyword

'event_maxiter'

=

integer

'event_iterate'

=

keyword

'event_initial'

=

boolean

'complex'

=

boolean

  

 

  

output

  

Specifies the desired output from dsolve. The keywords procedurelist, listprocedure, or operator provide procedure-type output, the keyword piecewise provides output in the form of piecewise functions over a specified range of independent variable values, and a 1-D array or Array provide output at fixed values of the independent variable. For more information, see dsolve/numeric.

  

 

  

known

  

Specifies user-defined known functions. For more information, see dsolve/numeric.

  

 

  

abserr, relerr, and initstep

  

Specify the desired accuracy of the solution, and the starting step size for the method. For more information, see Error_Control. The default values for ck45 are abserr=1e-7 and relerr=1e-6. The value for initstep, if not specified, is determined by the method, taking into account the local behavior of the ODE system.

  

 

  

interr

  

By default this is set to true, and controls whether the solution interpolant error (including the interpolant on index-1 variables for DAE problems) is integrated into the error control. When set to false, areas where the solutions is varying rapidly (e.g. a discontinuity in a derivative due to a piecewise) may have a much larger solution error than dictated by the specified error tolerances. When set to true, the step size is reduced to minimize error in these regions, but for problems where there is a jump discontinuity in the variables, the integration may fail with an error indicating that a singularity is present. In the latter case where an error is thrown, it may be advantageous to model the discontinuities using events (see dsolve/Events).

  

 

  

maxfun

  

Specifies a maximum on the number of evaluations of the right-hand side of the first order ODE system. This option is disabled by specifying maxfun=0. The default value for ck45 is 30000.

  

 

  

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 startinit and implicit, see dsolve/numeric/IVP. For more information on optimize, see dsolve/numeric.

  

 

  

compile

  

This option specifies that the internally generated procedures that are used to compute the numeric solution be compiled for efficiency. Note that this option will only work if Digits is set within the hardware precision range, and the input function contains only evalhf capable functions (e.g. only elementary mathematical functions like exp, sin, and ln).  See dsolve/Efficiency. By default this value is set to false. If set to true and a compile is not possible, an error will be thrown. If set to auto and a compile is not possible, the uncompiled procedures will be used directly.

  

 

  

range

  

Determines the range of values of the independent variable for which solution values are required. Use of this option significantly changes the behavior of the method for the procedure-style output types discussed in dsolve/numeric (see description of with/without range in Modes of Operation section of this help page).

  

 

  

events, event_pre, event_maxiter, event_iterate, event_initial

  

These options are used to specify and control the behavior of events for the numerical solution. These options are discussed in detail in dsolve/Events.

  

 

  

complex

  

Accepts a boolean value indicating if the problem is (or will become) complex valued. By default this is detected based on the input system and initial data, but in cases where the input system is procedure defined, or the system is initially real, it may be necessary to specify complex=true to obtain the solution. It is assumed that for an initially real system that becomes complex, the point at which this transition occurs is considered to be a singularity, so if complex=true is not specified, the integration will halt at that point.

Additional Information

• 

By setting infolevel[dsolve] to 2, information on the last mesh point evaluation is provided in the event of an error.

• 

The ck45 method is capable of computing high-accuracy solutions for IVPs because the precision of the computation can be increased by changing the Digits environment variable. However, it is recommended that the higher order dverk78 or gear methods be used instead.

• 

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

Examples

Solution with a range - solution over 0..1 is stored:

dsys1ⅆⅆtxt=yt,ⅆⅆtyt=xt+yt,x0=2,y0=1

dsys1:=ⅆⅆtxt=yt,ⅆⅆtyt=xt+yt,x0=2,y0=1

(1)

dsol1dsolvedsys1,numeric,method=ck45,output=listprocedure,range=0..1:

dsol1xsubsdsol1,xt:dsol1ysubsdsol1,yt:

dsol1x0,dsol1y0

2.,1.

(2)

dsol1x0.4,dsol1y0.4

2.69118406139209,2.60811663032515

(3)

dsol1x1.0,dsol1y1.0

5.58216687757548,7.82688820381604

(4)

Solution without a range - each point is computed when requested:

dsol2dsolvedsys1,numeric,method=ck45,output=procedurelist:

dsol20

t=0.,xt=2.,yt=1.

(5)

dsol20.4

t=0.4,xt=2.69118406139209,yt=2.60811663032515

(6)

dsol21.0

t=1.0,xt=5.58216687757548,yt=7.82688820381604

(7)

array solution:

dsys3D2xt=yt,D2yt=Dxt+yt

dsys3:=D2xt=yt,D2yt=Dxt+yt

(8)

init3x0=1,Dx0=0,y0=0,Dy0=1

init3:=x0=1,y0=0,Dx0=0,Dy0=1

(9)

dsol3dsolvedsys3∪init3,numeric,method=ck45,output=Array0,0.6,1.1,1.5,2.3,2.5

dsol3:=txtⅆⅆtxtytⅆⅆtyt0.1.0.0.1.0.6000000000000000.9634120496230400.1848064802664010.6311283617888471.148218529889441.100000000000000.7669148443273880.6543600006617301.269965857633941.421274844989121.500000000000000.3877484807843341.282704331163531.888433768310191.670452811947872.300000000000001.394576816327823.372724076462943.379310299233871.978147260135122.500000000000002.139341597855014.088058637948263.773067699947511.94871704009325

(10)

procedurelist output:

deqn4ⅆ3ⅆt3yt2ⅆ2ⅆt2yt+2yt

deqn4:=ⅆ3ⅆt3yt2ⅆ2ⅆt2yt+2yt

(11)

init4y0=1,Dy0=1,D2y0=1

init4:=y0=1,Dy0=1,D2y0=1

(12)

dsol4dsolvedeqn4∪init4,numeric,method=ck45,relerr=1.10-8,abserr=1.10-8,maxfun=0,output=procedurelist

dsol4:=procx_ck45...end proc

(13)

dsol40.05

t=0.05,yt=1.05124946387462,ⅆⅆtyt=1.04995674032366,ⅆ2ⅆt2yt=0.997371824249566

(14)

dsol40.45

t=0.45,yt=0.648630780960807,ⅆⅆtyt=0.571757531626938,ⅆ2ⅆt2yt=0.870897129164657

(15)

Piecewise output for complex-valued problem:

deqn5ⅆⅆtyt=Iyt

deqn5:=ⅆⅆtyt=Iyt

(16)

init5y0=1

init5:=y0=1

(17)

dsol5dsolvedeqn5∪init5,numeric,method=ck45,output=piecewise,complex=true,range=0..π:

lengthdsol5

6472

(18)

dsol52t=0|dsol52t=0

y0=0.99999999972.70999810-13I

(19)

dsol52t=evalf[15]π|dsol52t=evalf[15]π

y3.14159265358979=1.0000003343.01619926010-8I

(20)

References

  

Enright, W.H.; Jackson, K.R.; Norsett, S.P.; and Thomsen, P.G. "Interpolants for Runge-Kutta Formulas." ACM TOMS, Vol. 12, (1986): 193-218.

  

Cash, J.R.; Karp, A.H. "A Variable Order Runge-Kutta Method for Initial Value Problems with Rapidly Varying Right-Hand Sides". ACM Transactions on Mathematical Software, Vol. 16(3), (1990): 201-222.

See Also

dsolve/classical

dsolve/dverk78

dsolve/Error_Control

dsolve/Events

dsolve/gear

dsolve/lsode

dsolve/maxfun

dsolve/numeric

dsolve/numeric/IVP

dsolve/rkf45

dsolve/rosenbrock

dsolve/Stiffness

dsolve/taylorseries

infolevel

plots[odeplot]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam