Error Control for Numerical Solution of IVPs in Maple

Description


•

dsolve[numeric] approximates the solution of an initial value problem (IVP) for a system of ordinary differential equations (ODEs). Although ODEs arise in various forms, they can always be rewritten as a first order system, so to explain error control, it is assumed that the ODEs have the form

•

At each step the solver makes a truncation and/or discretization error that depends on the method and the length of the step. The cumulative effect of these errors depends on the stability of the IVP near the solution . If the IVP is stable near the solution (solutions with nearby initial data do not diverge from one another), errors are not amplified, but if the IVP is unstable near the solution (solutions with nearby initial data diverge), errors are amplified.

•

Adaptive solvers estimate the discretization error at each step and control it by adjusting the step size. The cumulative error in the numerical solution depends on the stability of the IVP, but for moderately stable problems, the solvers are tuned so that the error is comparable to the tolerances on the discretization error. For the efficient solution of an IVP, the solvers use the largest step size that results in a discretization error smaller than the tolerances. That is, a large step size is used if the solution is easy to approximate and a small one if it is difficult.

•

The Maple numerical IVP solvers control the discretization error by means of the options abserr, relerr, minstep, maxstep, and initstep. Note that the classical methods do not estimate the discretization error or vary the step size to control it.

•

The options that pertain to error control are:

abserr

relerr

initstep

maxstep

minstep



•

Not all options apply to all methods, and exceptions are noted in the discussion of each option. In all cases, the default values are specific to each method. For additional information, consult the individual method help pages.

•

abserr and relerr are tolerances for the discretization error. abserr is an absolute error tolerance and relerr is a relative error tolerance. The exact meaning of these tolerances is dependent upon the solver. To explain this, let the dependent variables at the ith step be and the estimated discretization error be .


must be satisfied for all simultaneously, .


Note: some of the solvers (all but taylorseries mentioned above) allow for a percomponent absolute error tolerance, so in this case the inequality becomes:


must be satisfied for all simultaneously, .

•

lsode measures the error in the sense of rootmeansquare:

•

The other options, minstep, maxstep, and initstep, are generally intended as fine tuning options and must be used with care.


The minstep parameter places a minimum on the size of the steps taken by the solver, and forces an error if the solver cannot achieve the required error tolerance without reducing the step below the minimum. This can be used to recognize singularities, and can also be used to limit the cost of the of the computation, though a better way to accomplish this is to limit the number of evaluations of , see dsolve[maxfun].


The maxstep parameter places a maximum on the size of the steps taken by the solver, so that even if the step control indicates that a larger step is possible, the size of the step will not exceed the imposed limit. This can be used to ensure that the solver does not lose the scale of the problem.


You can specify to the solver the scale of the problem near the initial point by supplying an initial step size as initstep. The solver uses this step size if the error of the step is acceptable. Otherwise, it reduces the step size and tries again.


The minstep and maxstep options are not available for the solvers rkf45, ck45, rosenbrock, and the related dae extension methods, as they require control of these parameters to provide a good solution.



Examples


>


 (1) 
The first example solves this IVP with the default rkf45 method and default error tolerances. The errf function measures the difference between the computed solution and the exact solution. This example shows how the error can vary over the interval of integration. The remaining examples show the effect of tighter tolerances on the error.
The rkf45 method with default error tolerances. Note that we need the option maxfun=0 to remove the limit on the number of function evaluations performed for the integration out to t=900:
>


 (2) 
>


 (3) 
>


 (4) 
The following plot shows the growth of the global error over the first portion of the interval of computation.
>


The rkf45 method with tighter error tolerances:
>


 (5) 
>


 (6) 
>


 (7) 
>


The dverk78 method with the same tolerances. This solver is more efficient than rkf45 at these tolerances, so it is not necessary to increase the default maxfun.
>


 (8) 
>


 (9) 
>


 (10) 
This solution is sufficiently accurate that, to compute the error accurately, we must use more than the default 10 digits of accuracy in Maple.
>


>


The dverk78 method with even tighter error tolerances:
>


 (11) 
>


 (12) 
>


 (13) 
>


>




See Also


dsolve[ck45], dsolve[classical], dsolve[dverk78], dsolve[gear], dsolve[lsode], dsolve[maxfun], dsolve[numeric,IVP], dsolve[numeric], dsolve[rkf45], dsolve[rosenbrock], dsolve[taylorseries]

