MME 523
Numerical Solutions of
Differential Equations
Euler’s Method
Scope:
We are interested in solving first
order differential equations with intial conditions.
This means a problem of the form
dy/dt = f(y,t) y(0)
= y0 (given)
This in turn means that we know the
slope of the tangent line at any location, and that we know where we began. We would like to be able to approximately
predict where we will be at any time, t.
Comment:
This is not the same as numerical
integration (Trapezoidal Rule etc) because the variable y may also appear on
the right side.
Interpretation:
we are given the initial position as well as the velocity at all times and wish to
determine the location at any
time. Useful if you happen to be
launching rockets at terrorists, or water balloons from rooftops.
Euler’s Method
pick an increment in time, Dt
assume, as
f(y0,0)
which means that Dt units of time later the y value will be approximately
y1 = y0 + f(y0,0) Dt
At this location (y1, Dt) play the same game again assuming a constant slope and getting a new y
value at t
= 2 Dt of
y2 = y1 + f(y1,
Dt) Dt
This process may be
continued indefinitely iteratively generating a sequence of points of the form
yi+1 = yi
+ f(yi, Dt) Dt for i=0,1,2,
. . . .
Your job
work this into an Excel spreadsheet
and apply it to
the following problems:
Problem 1:
Estimate
the solution to
dy/dt = 1 – t + 4y y(0) =1
using Dt
= .05 providing y values up to t =
2.0 seconds.
Optional:
can you get Excel to plot the
estimated solution??
Problem 2:
Revise your work from
Problem 1 by reducing Dt to .01
Problem 3:
Revise your work from
Problem 1 by reducing Dt to .001
At this point let me know and I will
provide you with the exact solution so you may compare results. Specifically
work up a spreadsheet with the estimates from Problems 1,2
and 3 in columns for t=.1, .2, .3,…
2.0 seconds with an additional column
showing the exact values Hence there
should be 5 columns of data.
Please attempt the following:
Can you make any statement as to how the error after 2 seconds
depends on Dt ??
In other words, as Dt
decreases, how does
the error decrease?
You may need to add
additional, error, columns to your spreadsheet to do this.
Problem 4:
Use Euler’s Method to
estimate the solution
for t between 0 and 3 seconds for the problem
dy/dt = (t + y)1/2 y(0) = 3
taking
Dt = .025