Most ordinary differential equations arising in
real-world applications
cannot be solved exactly.
These ode can be analyized qualitatively.
However,
qualitative analysis may not be able to give accurate
answers.
A numerical method can be used to get
an accurate approximate solution
to a differential
equation. There are many programs and packages
for
solving differential equations. With today's
computer, an accurate
solution can be obtained
rapidly. In this section we focus on Euler's
method,
a basic numerical method for solving initial
value problems.
Consider the differential equation:
The first step is to convert the above second-order
ode into two
first-order ode. This is a
standard operation. Let v(t)=y'(t).
Then v'(t)=y''(t).
We then get two differential equations. The
first
is easy
The second is obtained by rewriting the original
ode. Using the fact
that y''=v' and y'=v,
The initial conditions are y(0)=1 and y'(0)=v(0)=2.
We are now ready to approximate the two first-order
ode by Euler's
method. A derivation
of Euler's method
is given the numerical methods
section for first-order
ode. We first discretize the time interval.
Let
0=t_0. Let t_1<t_2<t_3< ... be other points.
We approximate
the solution at these gridpoints.
For simplicity we will assume that
the points are
equispaced. In general they need not be.
Let us define
z_k be the approximation to y(t) at t_k
and let w_k be the
approximation to w(t) at t_k. For
our example we get the following
recursion formulas for
z_k and w_k:
The initial conditions are z_0=y(0)=1 and w_0=v(0)=2. HEre Dt is the
spacing
between gridpoints.
Suppose our goal is to compute the solution to the model
differential
equation at time t=1. The exact solution,
obtained using an advanced
algorithm, is 4.1278. The
following table summarizes the results obtained
using
Euler's method. Note that the error decreases as
the number
of gridpoints N increases. Here
the spacing between points is 1/N.
Intervals N | Approximate y(1) | Error |
2 | 3.500 | 0.628 |
4 | 3.777 | 0.351 |
8 | 3.933 | 0.194 |
16 | 4.024 | 0.103 |
32 | 4.074 | 0.054 |
Summary
Consider the second-order ode:
Suppose the goal is solve the problem on the interval
[t_0,T]. The
following list summarizes the steps in
solving the problem by Euler'
method.
to compute the approximate solution for k=0,1,2,...
Send comments to:
reddy@math.orst.edu
Address:
Department of Mathematics, Oregon State University, Corvallis, OR, 97331