Vous êtes sur la page 1sur 2

Ordinary differential equations

Differential equations are of the form,

dy f ( x, y) dx

with a known initial condition : y( x0 ) y0

Solutions to the above equations may be needed in two flavors,

1. Initial Value Problem (IVP) where we would like to solve the above Equation to find y for x0 <x <xfinal. 2. Boundary Value Problem (BVP) We will deal with IVP first. All algorithms work by dividing the region between x0 and xmax into a grid of N+1 discrete points at the locations x = xi, where i ranges from 0 to N. The spacing between the points may be uniform or non-uniform. The coordinate of the first node, x0 is the same as the initial point, which is also called x0. The final grid node, called xN, is located at the final value of x, xmax.

A non-uniform grid, with different spacing between different nodes, is illustrated below. ------------------------------------------~ x0 x1 x2 x3 ~----------------------- xN-2 xN-1 xN

For a uniform grid, all values of xi are the same. In this case, the uniform grid spacing, in a onedimensional problem h. I.e., h = xi xi-1 for all values of i. There are N values of hi, with i ranging from 1 to N in the definition of x. (There is one more grid point, xi, than the number of grid steps, hi.) If the grid spacing is uniform, we can calculate the value of h from the following equation.

x max x0 N

Taylor series expansion gives

y ( x 0 h) y ( x 0 )

dy 1 d2y 2 1 d3y 3 h h h .... dx 0 2! dx 2 0 3! dx 3 0

Explicit ODE Integrators: In explicit methods, yk+1 depends on previous values of x and y e.g

yk 1 y k x f ( xk , yk )
Implicit ODE Integrators:

In implicit methods, yk+1 depends on previous

values of x and y e.g

y k 1 y k x f ( xk 1 , y k 1 )
Note that the solution at the advanced point, y1; now appears on both sides of the stepping formula, and we therefore must solve a nonlinear equation to compute y1: Thus, the price we pay in general when using implcit methods is the solution of systems of nonlinear (algebraic) equations

Multistep Methods We have previously seen various methods, especially Runge-Kutta methods, which can obtain accurate solutions for the numerical integration of ordinary differential equations. However, there methods require a large amount of work per step. Several derivative evaluations are required at each step and this can increase the work if the derivatives are complex. The large number of derivative evaluations per step is required in these methods to obtain a high order truncation error. These methods have the advantage of being self-starting; the integration step from xi to xi+1 does not require any information from grid points before x xi. An alternative approach is to use information from past integration steps to derive a higher order expression for integration the differential equation. An obvious disadvantage of this approach is that the resulting methods will not be self-starting. Consequently, it will be necessary to provide some other method, such as a Runge-Kutta method, to start the integration with a multistep method. Multistep methods are usually predictor corrector methods. We have already seen an example of a predictor-corrector method in Huens method, which was a modification of the Euler method. In that method we used a predicted value of yi+1 to compute an estimate of the derivative f(xi+1, yi+1). We then used that estimated derivate to compute a final (corrected) value of yi+1. Multistep predictor-corrector methods proceed in the same way. In addition, the difference between the predictor and the corrector can be used as an estimate of the error for step-size control.

Vous aimerez peut-être aussi