## Mathematics & Science
Learning Center |
|||||||||||||||||||||||||||||||||

## Numerical Methods for Solving Differential Equations## Euler's Method## Theoretical Introduction
## Summary of Euler's MethodIn order to use Euler's Method to generate a numerical solution to an initial value problem of the form:
we decide upon what interval, starting at the initial condition, we desire
to find the solution. We chop this interval into small subdivisions of length
h
h f(x, _{n}y)_{n}to find the coordinates of the points in our numerical solution. We terminate this process when we have reached the right end of the desired interval. ## A Preliminary ExampleJust to get a feel for the method in action, let's work a preliminary example completely by hand. Say you were asked to solve the initial value problem:
numerically, finding a value for the solution at ## Applying the MethodClearly, the description of the problem implies that the interval we'll be
finding a solution on is [0,1]. The differential equation given tells us the
formula for
and the initial condition tells us the values of the coordinates of our starting point: *x*= 0_{o}*y*= 0_{o}
We now use the Euler method formulas to generate values for
The
hor:
So:
And the
h
f(x, _{o}y)_{o}or:
h
(x + 2_{o}y)_{o}or:
So:
Summarizing, the second point in our numerical solution is: *x*_{1}= 0.25*y*_{1}= 0
We now move on to get the next point in the solution,
( The
or:
So:
And the
or:
or:
So:
Summarizing, the third point in our numerical solution is: *x*_{2}= 0.5*y*_{2}= 0.0625
We now move on to get the fourth point in the solution,
( The
or:
So:
And the
or:
or:
So:
Summarizing, the fourth point in our numerical solution is: *x*_{3}= 0.75*y*_{3}= 0.21875
We now move on to get the fifth point in the solution,
( The
or:
So:
And the
or:
or:
So:
Summarizing, the fourth point in our numerical solution is: *x*_{4}= 1*y*_{4}= 0.515625
We could summarize the results of all of our calculations in a tabular form, as follows:
A question you should always ask yourself at this point of using a numerical method to solve a problem, is "How accurate is my solution?" Sadly, the answer is "Not very!" This problem can actually be solved without resorting to numerical methods (it's linear). The true solution turns out to be:
If we use this formula to generate a table similar to the one above, we can see just how poorly our numerical solution did:
We can get an even better feel for the inaccuracy we have incurred if we compare the graphs of the numerical and true solutions, as shown here: The numerical solution gets worse and worse as we move further to the right.
We might even be prompted to ask the question "What good is a solution that is
this bad?" The answer is "Very little good at all!" So should we quit using
this method? No! By the way, the reason I used such a large step size when we went through this problem is because we were working it by hand. When we move on to using the computer to do the work, we needn't be so afraid of using tiny step-sizes. To illustrate that Euler's Method isn't always this terribly bad, look at
the following picture, made for exactly the same problem, only using a step
size of As you can see, the accuracy of this numerical solution is much higher than
before, I think that we have adequately demonstrated the concepts underlying the Euler's Method algorithm. We have seen the derivation of the required formulas from both a graphical and a formulaic point-of-view. We've even gone through an example of using the method for a small number of points. Now it's time to get out the big guns! This method is one that truly belongs on a computer! Let's now go and see how we would implement these ideas in |
|||||||||||||||||||||||||||||||||

ODE Laboratories: A Sabbatical Project by Christopher A. Barker©2017 San Joaquin Delta College, 5151 Pacific Ave., Stockton, CA 95207, USA e-mail: cbarker@deltacollege.edu |