cclogo.gif (38585 bytes)   Seminole State Homepage   |   Calculus I   |   Calculus II    |    Calculus III   |   Diff Eq    |    Calculus Homepage cclogo.gif (38585 bytes)

 

Examples--Numerical Methods

Euler's Method

Check out 10 steps of Euler's Method applied to

y' = 1 - t + 4y     y(0) = 1

EC:  Find the analytical solution to the equation above.  The graph of the analytical solution is given below.

 

 

Example

Here is an example of the first step (finding y1) in applying Euler's Method.

xo = 1, yo = e1/2, h = 0.1

y1 = yo + (xoyo)(0.1) 

The analytical solution is shown in red above and the line segment in green above is representing applying Euler's Method once to find y1.  Below is a graph of part of the analytical solution of the differential equation above along with the tangent to the graph at the point where x = 1.

A Nice Euler's Method Example For The TI  (The Analytical Solution Is Shown Below)

The arrow above means press the STORE key.

The second ENTER generates y1.  Pressing ENTER again will produce y2.  Do you know why?  Press the ENTER key repeatedly to generate additional Euler solution values (y3, y4, . . .).  With yo = 10 you should get approximately y1 = 19, y2 = 34.39, y3 = 56.95, y4 = 81.47, y5 = 96.57, y6 = 99.88.  The points along with the analytical solution are plotted in the graph on the right below.

 
To the left is the graph of the solution to the logistics equation 

dy/dx = .01y(100-y),   y(0) = 10.

The solution is y = 100ex / (ex + 9).

 

 
Euler's Method Extra Credit

Generate the data points for the example above with x going from 0 to 250 and a step size of 2.5.  The picture at the right shows the analytical solution in red and the data points in blue for x going from 0 to 40 with a step size of 2.5.  Ideally you will use a computer for this and generate a graph of the data points using your computer and/or graphing calculator.  What appears to be happening?

 

 

You could do this on your TI by entering the following:

Keep pressing the enter key after the last command to compute additional values for y.

Compare your results to this excel sheet.  pi/4 was rounded to 0.785398

Click on the picture above to see the slope field added.

 

Try the First Order DE Solution Grapher on this one and then try changing the derivative to cos(xy).

 

Here is an excel graph with h = 0.3927 (pi/8) and

h = 0.19635 (pi/16).

 

Maple Worksheet with graphs

Maple Worksheet    Maple Worksheet Fields

Here is an audio/visual demonstrating implementing Euler's Method on a TI-84 with a step size of pi/4 over an interval from 0 to 4pi.  Click on the picture at the right to see the result using a step size of pi/8 over an interval from 0 to 2pi.  The small boxes represent the Euler solutions.

 
Another Euler's Method Example Compared to an Analytical Solution
First Order Linear Approach

Graph of the Analytical Solution (in Red) with Discrete Euler Solution Points (in Blue)

Excel Graph with a Step Size of pi/8

 


 

Improved Euler's Method Compared To Euler's Method--One Step
Euler's Method First Step

Improved Euler's Method First Step

The picture below illustrates the first step in applying Euler's Method to the differential equation given above.  In the picture y1 would be the y-value (1.2) at the right end of the green tangent line segment.  The actual solution value for y when x = x1 would be the y-value (1.21) at the right end of the red graph of the analytical solution, y = x2.  The picture below on the right (with two green line segments) shows the first step in applying the Improved Euler's Method to the same equation.

 

Here is an Excel graph comparing the Euler solution, Improved Euler solution and the analytical solution to

y'(x) = cos(x),  y(0) = 0   over the interval from 0 to 2pi with a step size of pi/8. 

Here is an animation showing the first two steps of the Improved Euler Method applied to

y'(x) = 2cos(x),    y(0) = 1            Quicktime Version

with a step size of pi/4 and comparing the result to two steps of Euler's Method.

 


 

Formulas for Applying the Improved Euler's Method and a Classical Fourth Order Runge-Kutta Method

Maple Worksheet comparing Runge-Kutta and Euler Methods

Here is a very nice Improved Euler's Method applet by David Protas of California State University that will both draw a graph of the Improved Euler solution and generate a table of values.

Here is a nice java applet demonstrating a variety of numerical methods.

Here is an Excel worksheet that explores Euler's Method applied to dy/dx = sin(xy).  In the data sheets the first column corresponds to x-values and the other columns correspond to y-values for various initial conditions.  Here is a Maple slope field picture with Runge-Kutta solutions corresponding to initial conditions of y(0) = 1, y(0) = 1.5, and y(0) = 2.

Another Excel worksheet, this one exploring Euler's Method applied to dy/dx = (y^2)cos(x), y(0) = 1/2.

return

 

 

 

 


          This site contains links to other Internet sites.  These links are not endorsements of any products or services in such sites, and no information  

           in such site has been endorsed or approved by this site.

        Lane Vosbury, Mathematics, Seminole State College   email:  vosburyl@seminolestate.edu

        This page was last updated on 08/21/14          Copyright 2002          webstats