Title Page

Contents

1. Introduction

2. Key Idea

3. Root finding in one dimension

4. Linear equations

5. Numerical integration

6. First order ordinary differential equations

7. Higher order ordinary differential equations

8. Partial differential equations

The discussion so far has been for first order ordinary differential equations. All the methods given may be applied to higher ordinary differential equations, provided it is possible to write an explicit expression for the highest order derivative and the system has a complete set of initial conditions. Consider some equation

(96) |

where at *t *=* t*_{0}
we know the values of *y*,
*dy*/*dt*,
*d*^{2}*y*/*dt*^{2},
…, *d ^{n}*

x_{0}' = x_{1} | |

x_{1}' = x_{2} | |

x_{2}' = x_{3} | |

. . . | |

x_{n-}_{2}' = x_{n-}_{1} | |

x_{n-}_{1}' = f(t,x_{0},x_{1},…,x_{n-}_{2}), | (97) |

and use the standard methods for updating each *x _{i}*
for some

For second (and higher) order odes, two (or more) initial/boundary conditions are required. If these two conditions do not correspond to the same point in time/space, then the simple extension of the first order methods outlined in section 7.1 can not be applied without modification. There are two relatively simple approaches to solve such equations.

Suppose we are solving a second order equation of
the form *y" *=* f*(*t*,*y*,*y'*)
subject to *y*(0) = *c*_{0}
and *y*(1) = *c*_{1}.
With the shooting method we apply the *y*(0)=*c*_{0}
boundary condition and make some *guess* that *y'*(0) = a_{0}.
This gives us two *initial* conditions so that we may apply
the simple time-stepping methods already discussed in section7.1 .
The calculation proceeds until we have a value for *y*(1).
If this does not satisfy *y*(1) = *c*_{1}
to some acceptable tolerance, we revise our guess for *y'*(0)
to some value a_{1},
say, and repeat the time integration to obtain an new value for
*y*(1).
This process continues until we *hit* *y*(1)=*c*_{1}
to the acceptable tolerance. The number of iterations which will
need to be made in order to achieve an acceptable tolerance will
depend on how good the refinement algorithm for a
is. We may use the root finding methods discussed in section 3 to
undertake this refinement.

The same approach can be applied to higher order
ordinary differential equations. For a system of order *n*
with *m*
boundary conditions at *t = t*_{0}
and *n-m*
boundary conditions at *t = t*_{1},
we will require guesses for *n-m*
initial conditions. The computational cost of refining these *n-m*
guesses will rapidly become large as the dimensions of the space
increase.

The alternative is to rewrite the equations using
a finite difference approximation with step size D*t = *(*t*_{1}-*t*_{0})/*N*
to produce a system of *N+*1
simultaneous equations. Consider the second order linear system

y" + ay' + by = c, | (98) |

with boundary conditions *y*(*t*_{0}) = a
and *y'*(*t*_{1}) = b.
If we use the central difference approximations

y'=~ (_{i} Y_{i}_{+1} - Y_{i-}_{1})/2Dt, | (99a) |

y"=~ (_{i} Y_{i}_{+1} - 2Y+_{i} Y_{i-}_{1})/Dt^{2}, | ( 99 b) |

we can write the system as

Y_{0} = a, | |

^{1}/_{2}aDt)Y_{0} + (bDt^{2}-2)Y_{1} + (1-^{1}/_{2}aDt)Y_{2} = cDt^{2}, | |

^{1}/_{2}aDt)Y_{1} + (bDt^{2}-2)Y_{2} + (1-^{1}/_{2}aDt)Y_{3} = cDt^{2}, | |

^{1}/_{2}aDt)Y_{n-}_{1} + (bDt^{2}-2)Y_{n-}_{1} + (1-^{1}/_{2}aDt)YD_{n} = ct^{2}, | |

Y_{n} - Y_{n-}_{1} = bDt | (100) |

Higher order linear equations may be catered for in a similar manner and the matrix representing the system of equations will remain banded, but not as sparse as tridiagonal. The solution may be undertaken using the modified LU decomposition introduced in section4.4 .

Nonlinear equations may also be solved using this approach, but
will require an iterative solution of the resulting matrix system
**Ax = b**
as the matrix

Start of this section

Title Page

Contents

Stuart Dalziel, last page update: 17 February 1998