Module for Euler's Method for O.D.E.'s
Check out the new Numerical Analysis Projects page.
The first method we shall study for solving differential equations is called Euler's method, it serves to illustrate the concepts involved in the advanced methods. It has limited use because of the larger error that is accumulated with each successive step. However, it is important to study Euler's method because the remainder term and error analysis is easier to understand.
Let
be the interval over which we construct the solution to the
well-posed I. V. P. (initial value problem)
with
. Actually,
we will not find a differentiable function that satisfies the I. V.
P. Instead, a discrete set of points
is
generated, and the points are used for an approximation (i.e.
). How
do we proceed to construct a "set of points" that will "satisfy a
differential equation approximately"? First we choose the abscissa's
for the points. For convenience, we subdivide the interval
into m equally spaced subintervals and select the mesh points
where
.
The value h is called the step size,
. For
notation purposes, we let
,
and proceed to solve approximately
over
with
.
We assume that
are continuous and expand
in a Taylor series about
. For
each value
there exists a value
that lies between
so that
![]()
.
Using the substitutions
and
, we
get an expression for
:
![]()
.
If the step size h is chosen small enough, then we may neglect the
second-order term (involving
)
and get
,
which is Euler's approximation. (Note that
is an approximation to
.
The process is repeated and generates a
sequence of points that approximates the solution curve
.
Algorithm (Euler's
Method) The
general step for Euler's method is
, and
for
.
Error analysis for
Euler's Method
When we obtained the
formula
for
Euler's method, the neglected term for each step has the form
. If
this was the only error at each step, then at the end of the interval
,
after
steps have been made, the accumulated error would be
![]()
![]()
.
The error is more complicated, but this estimate predominates.
Theorem (Precision
of Euler's Method) Assume
that
is
the solution to the I.V.P.
with
. If
and
is
the sequence of approximations generated by Euler's method, then the
global error
and local error
are expressed in the following relationships,
,
and
![]()
.
The error at the right end of the
interval is called the final
global error (F.G.E.)
.
Remark. The
global truncation error
is
used to study the behavior of the error for various step
sizes. It can be used to give us an idea of how much
computing effort must be done to obtain an accurate
approximation.
Numerical methods used in this
module. Use Euler's method and the modified
Euler's method. Construct numerical solutions of
order
and
,
respectively. The theory for the modified Euler method is
not presented at this time, we are to trust that its development is
similar, but the order for the error is better and is known to be
.
The subroutines Euler and MEuler
will be used.
Animations (Euler's
Method Euler's
Method). Internet
hyperlinks to animations.
Program
(Euler's Method). To
compute a numerical approximation for the solution of the initial
value problem
with
over
at a discrete set of points using the formula
.
Mathematica Subroutine (Euler's Method).
![[Graphics:Images/EulerMod_gr_61.gif]](Images/EulerMod_gr_61.gif)
Animations (Modified
Euler's Method Modified
Euler's
Method). Internet
hyperlinks to animations.
Program
(Modified Euler's Method). To
compute a numerical approximation for the solution of the initial
value problem
with
over
at a discrete set of points using the formula
.
Mathematica Subroutine (Modified Euler's Method).
![[Graphics:Images/EulerMod_gr_66.gif]](Images/EulerMod_gr_66.gif)
Example 1. Solve
the I.V.P.
.
Example 2. Use
Mathematica to find the analytic solution and graph for the
I.V.P.
.
Example 3. Plot the error for Euler's method and the modified Euler's method.
Example 4. Reduce
the step size by
and see what happens to the error.
Recalculate points for Euler's method, the Modified Euler's method,
and the analytic solution using n = 30.
Then Plot the error for Euler's method and the Modified Euler's
method.
Old Lab Project (Euler's
Method for O.D.E.'s Euler's
Method for
O.D.E.'s).
Internet hyperlinks to an old lab project.
Research Experience for Undergraduates
Euler's
Method for O. D. E.'s Euler's
Method for O. D. E.'s
Internet hyperlinks to web sites and a bibliography of
articles.
Downloads (Euler's
Method for O. D. E.'s Euler's
Method for O. D.
E.'s).
Download this Mathematica notebook.
(c) John H. Mathews 2003