![]()
![]()
Lab for Euler's Method
![]()
Purpose. Euler's
method and the Modified Euler's method have accuracies of order O(h)
and O(
).
Construct numerical solutions of of order O(h) and O(
),
and attempt to estimate the accuracy of our computed solutions.
HINT. First get the subroutine
Euler to work, then modify it in one line to obtain MEuler. Then you
have two methods to solve I.V.P.'s.
Euler's Method for
O.D.E.'s. To approximate the solution of the initial value
problem
over [a, b] by computing
.
Modified Euler's Method for O.
D. E.'s. To approximate the solution of the initial value
problem
over [a, b] by computing
.
Report to be handed in.
Computer Problems.
![]()
Exercise 1. Solve the I.V.P.
with y(0) = 1 over [0.0, 0.4].
Use Euler's method with 4 subintervals of [0.0, 0.4] to
get a numerical approximation to the solution.
Show the calculations for each step.
Compare the Euler solution with the known analytic solution
.
Exercise 2. Solve the I.V.P.
with y(0) = 1 over [0.0, 0.4].
Use the modified Euler's method with 4 subintervals to get a
numerical approximation to the solution.
Show the calculations for each step.
Compare the Euler solution with the known analytic solution
.
Exercise 3. Solve the Initial Value Problem
t
<= 5.
Compute solutions based on 20 subintervals and plot the results.
![]()
![[Graphics:eu.txtgr18.gif]](eu.txtgr18.gif)
![]()
![[Graphics:eu.txtgr19.gif]](eu.txtgr19.gif)
![]()
![[Graphics:eu.txtgr20.gif]](eu.txtgr20.gif)
Do an error analysis by looking at the difference between the two methods. Although the "true" solution is NOT known, this is one way to estimate the accuracy.
![]()
![[Graphics:eu.txtgr22.gif]](eu.txtgr22.gif)
Exercise 4. Solve the Initial Value Problem
t
<= 5.
Compute solutions based on 40 subintervals and plot the results.
![]()
![[Graphics:eu.txtgr26.gif]](eu.txtgr26.gif)
![]()
![[Graphics:eu.txtgr27.gif]](eu.txtgr27.gif)
![]()
![[Graphics:eu.txtgr28.gif]](eu.txtgr28.gif)
Do an error analysis by looking at the difference between the two methods. Although the "true" solution is NOT known, this is one way to estimate the accuracy.
![]()
![[Graphics:eu.txtgr30.gif]](eu.txtgr30.gif)
Exercise 5. Solve the Initial Value Problem
t
<= 5.
Compute solutions based on 80 subintervals and plot the results.
![]()
![[Graphics:eu.txtgr34.gif]](eu.txtgr34.gif)
![]()
![[Graphics:eu.txtgr35.gif]](eu.txtgr35.gif)
![]()
![[Graphics:eu.txtgr36.gif]](eu.txtgr36.gif)
Do an error analysis by looking at the difference between the two methods. Although the "true" solution is NOT known, this is one way to estimate the accuracy.
![]()
![[Graphics:eu.txtgr38.gif]](eu.txtgr38.gif)
Exercise 6. Answer this question too!
How is the error decreasing in 3 - 5 ?
Read the book and explain why this is happening.
Is this what we expect with Euler's method which is a method of order
O[h] ?
Give reference to an equation in the text regarding this
behavior.
![]()
![]()
(c) John H. Mathews, 1998