Handout Six Part II
November 3, 2011
1
Supplementary Notes : Solving an Initial Value Problem for
an Ordinary Differential Equation
It is not the aim of these notes to teach a course on the numerical solution of ordinary differential equations
(ODE’s). However you do need to be able to understand the methodology behind the subject so you are
able to ‘code up’ a simple method. A numerical method for solving an ordinary differential equation is
a procedure that produces approximate solutions to the differential equation at progressive points along
the independent variable. It does this using the given differential equation and an accompanying initial
condition as a starting point.
You will only need to write Fortran programs for problems of the form;
y
=
dy
dx
=
f
(
x, y
)
→
differential equation
(1)
y
0
=
y
(
x
0
)
→
initial condition
(2)
The first equation is simply the differential equation, it gives us the ‘rate of change’ of the dependent
variable
y
with respect to the independent variable
x
.
The second equation tells us that at a known
point of the independent variable
x
the value of the function
y
(
x
) is known and is
y
0
. With these initial
conditions we can attempt to produce a numerical solution to the ODE over a range of values in
x
. This
is done by starting at
x
0
where we know the solution
y
0
as it is given, and making an approximation
for
y
at
x
=
x
0
+
h
. The differential equation is then used, along with a small step
h
in the
x
direction
to give an estimate
δy
of the change in
y
that the small step
h
in
x
would produce.
There are many
different methods for solving ODE’s, some very much more complicated than others. In this handout we
will look at seven of the simpler methods around. The Euler method, Heun’s method, Nystrom’s and a
third order RungeKutta method.
1.1
The Order of a Numerical Method
In general the higher the order of a numerical method the more accurate it is. The order of a numerical
method is given as an positive integer. Euler’s method is of order one, so it the lowest possible order you
can have. If the exact solution of an ordinary differential equation is a polynomial of order
k
then the
numerical solution and the exact solution will be identical (except for computational truncation error) if
the numerical method is of order
k
or above.
1.2
Simple Numerical Methods
First we will look at a few of the simplest of numerical methods for ODE’s. Then a couple of methods
well known group of ‘RungeKutta’ based solutions. Finally a couple of ‘predictorcorrector’ methods.
1.2.1
Euler’s Method
Euler’s method is probably the most simple of all numerical methods for solving ordinary differential
equations numerically. Given the point (
x
n
, y
n
) and the gradient
f
n
at that point, where
f
n
=
f
(
x
n
, y
n
),
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Euler’s method makes the assumption that over the sufficiently small step,
h
, in
x
the function is ap
proximately linear. This allows us to write down an approximation for
y
n
+1
at
x
n
+1
=
x
+
h
.
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '10
 BROOKS
 Differential Equations, Numerical Analysis, Equations, Partial differential equation, Heun's method, Runge–Kutta methods, Numerical ordinary differential equations

Click to edit the document details