Euler's Method and improved Euler's Method - Computational Project 1 | MATH 3350, Study Guides, Projects, Research of Mathematics

Material Type: Project; Professor: Long; Class: Higher Mathematics for Engineers and Scientists I: Honors; Subject: MATHEMATICS; University: Texas Tech University; Term: Spring 2008;

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 03/11/2009

koofers-user-l46
koofers-user-l46 đŸ‡ș🇾

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Computational Project 1, Math 3350
Dr. Kevin Long
DUE Monday, 11 Feb
In this project you will compute approximate solutions for several initial value problems using both Euler’s method
and the improved Euler’s method. You’ll then compare your approximate solutions to exact solutions, and measure
how the error depends on the step size.
For each of the four problems
1. dy
dx =−αy, y(0) = 1, α =1
4
2. dy
dx =ysin x, y(0) = 2
3. dy
dx =ÎČy2cos x, y (0) = 4
3, ÎČ =1
2
4. dy
dx =−αy + sin x, y(0) = 0, α =1
4
do the following steps.
1. Compute the exact solution yexact, using whatever method is appropriate to that problem.
2. Check your exact solution, verifying that it satisfies both the initial conditions and the differential equation.
3. Write a Matlab function to evaluate the right-hand side (RHS) f(x, y)for the given differential equation.
4. Using your RHS function together with the simple IVP driver and Euler stepper functions provided on the course
web page, compute approximate numerical solutions to the IVP using Euler’s method using 16, 32, 64, and 128
steps. Solve on the interval x∈[0,2π].
(a) Plot on a single figure the exact solution and the four approximate numerical solutions to this problem. Use
different symbols for each. Use the Matlab legend function to show the association between graphical
symbols and number of steps.
(b) Compute the error |yexact −ynum|at the end point x= 2πfor each approximate solution.
(c) Assuming the error varies as hp, estimate the order of accuracy pfrom your results.
5. Repeat step 4 above using the improved Euler method.
Suppose that design specifications require your simulations to be accurate to 10−5at the final step. Using your results,
estimate the number of Euler steps and improved Euler steps needed to reach that accuracy for this problem. Estimate
the cost difference (measured in number of RHS function evaluations) for using one method over the other. Which
method would you recommend using?
Document this work with a written report. Please refer to the web page for guidelines on writing your report
and an example of a project report.
1

Partial preview of the text

Download Euler's Method and improved Euler's Method - Computational Project 1 | MATH 3350 and more Study Guides, Projects, Research Mathematics in PDF only on Docsity!

Computational Project 1, Math 3350 Dr. Kevin Long DUE Monday, 11 Feb

In this project you will compute approximate solutions for several initial value problems using both Euler’s method and the improved Euler’s method. You’ll then compare your approximate solutions to exact solutions, and measure how the error depends on the step size.

For each of the four problems

dy dx

= −αy, y(0) = 1, α =

dy dx = y sin x, y(0) = 2

dy dx

= ÎČy^2 cos x, y(0) =

, ÎČ =

dy dx

= −αy + sin x, y(0) = 0, α =

do the following steps.

  1. Compute the exact solution yexact, using whatever method is appropriate to that problem.
  2. Check your exact solution, verifying that it satisfies both the initial conditions and the differential equation.
  3. Write a Matlab function to evaluate the right-hand side (RHS) f (x, y) for the given differential equation.
  4. Using your RHS function together with the simple IVP driver and Euler stepper functions provided on the course web page, compute approximate numerical solutions to the IVP using Euler’s method using 16, 32, 64, and 128 steps. Solve on the interval x ∈ [0, 2 π].

(a) Plot on a single figure the exact solution and the four approximate numerical solutions to this problem. Use different symbols for each. Use the Matlab legend function to show the association between graphical symbols and number of steps. (b) Compute the error |yexact − ynum| at the end point x = 2π for each approximate solution. (c) Assuming the error varies as hp, estimate the order of accuracy p from your results.

  1. Repeat step 4 above using the improved Euler method.

Suppose that design specifications require your simulations to be accurate to 10 −^5 at the final step. Using your results, estimate the number of Euler steps and improved Euler steps needed to reach that accuracy for this problem. Estimate the cost difference (measured in number of RHS function evaluations) for using one method over the other. Which method would you recommend using? Document this work with a written report. Please refer to the web page for guidelines on writing your report and an example of a project report.