How many steps does Euler's method take to achieve a specific error tolerance?

  • Thread starter roam
  • Start date
  • Tags
    Method
In summary, the conversation discusses the use of Euler's method and 4th order Runge-Kutta method to approximate a solution to a given problem. The error in each method is calculated and a question is raised about the number of steps needed for Euler's method to produce an error no larger than that of Runge-Kutta method. The conversation refers to using a textbook equation for finding the number of steps and suggests using a program or spreadsheet to confirm the result.
  • #1
roam
1,271
12

Homework Statement



I need some help with the last part of the following problem:

http://img834.imageshack.us/img834/8366/eulere.jpg [Broken]

The Attempt at a Solution



My approximation to the solution to the IVP at t=-0.8 using 1 step of the Euler's method was:

x(-0.8)=0.8

Whereas the approximation with 1 step of 4th order Runge-Kutta method was:

x(-0.8)=0.8214

And since the exact solution is

[itex]x(-0.8) = e^{-0.8 +1} -2 \times (-0.8) -2 = 0.8214027582[/itex]

the error in Euler's method would be

[itex]|0.8214027582-0.8| =0.0214027582[/itex]

And the error for Runge-Kutta is

[itex]|0.8214027582-0.8214| =2.7582 \times 10^{-6}[/itex]

I'm stuck here. So how many steps does Euler's method take to produce an answer with an error no larger than 2.7582 x 10-6 (the error of Runge-Kutta)?

I tried to use the following equation:

[itex]e_n \leq \frac{k}{n}[/itex]

Where k is a constant and n is the number of steps and en is the error. I then tried to solve for the constant bu substituting in the values from Euler's method:

[itex]0.021402758 = \frac{k}{1} \ \implies k =0.021402758[/itex]

Then substituting in the new error

[itex]2.7582 \times 10^{-6}=\frac{0.021402758}{n} \ \implies n = 7760[/itex]

But doesn't 7760 steps seem too much? Where did I go wrong? I appreciate it if anyone could help me with this problem.
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
7760 seems to be OK. You could confirm this using a program or a spreadsheet with Δt = (0.2 / 7760) to see if it corresponds with your answer.
 
Last edited:
  • #3
But I am wondering if I've even used the correct method for finding the number of steps?
 
  • #4
roam said:
I tried to use the following equation:
[itex]e_n \leq \frac{k}{n}[/itex]
roam said:
But I am wondering if I've even used the correct method for finding the number of steps?
What was the source of the error equation you used, class notes, a textbook, ... ?
 
  • #5
rcgldr said:
What was the source of the error equation you used, class notes, a textbook, ... ?

It's from a textbook...

Edit: page 635 of the textbook called "Differential Equations" by Blanchard, Devany and Hall.
 
Last edited:
  • #6
roam said:
I am wondering if I've even used the correct method for finding the number of steps?
It appears that you have. As mentioned before if you want to check this, you could confirm this using a program or a spreadsheet using Euler method with Δt = (0.2 / 7760) to see if it corresponds with your answer (for the spread sheet you would need to use 7761 rows, the initial state and 7760 steps).
 

1. What is Euler's method?

Euler's method is a numerical method used to approximate the solution to a differential equation. It involves breaking down the equation into smaller steps and using the slope at each step to calculate the next point on the curve.

2. When is Euler's method typically used?

Euler's method is typically used when it is not possible to find an exact analytical solution to a differential equation. It is also used to validate and check the results of more complex numerical methods.

3. What are the benefits of using Euler's method?

Euler's method is relatively simple to implement and requires minimal computational resources. It is also a good introductory method for understanding more complex numerical methods.

4. What are the limitations of Euler's method?

Euler's method has a relatively large error compared to other numerical methods, especially for large step sizes. It also does not account for curvature in the solution and can produce inaccurate results for certain types of differential equations.

5. How can the accuracy of Euler's method be improved?

The accuracy of Euler's method can be improved by using smaller step sizes. Other methods, such as the Runge-Kutta method, can also be used to reduce the error and improve accuracy.

Similar threads

Replies
7
Views
2K
  • Calculus and Beyond Homework Help
Replies
4
Views
3K
  • Calculus and Beyond Homework Help
Replies
2
Views
669
  • Calculus and Beyond Homework Help
Replies
4
Views
2K
Replies
6
Views
769
  • Differential Equations
Replies
1
Views
717
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Programming and Computer Science
Replies
15
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
3K
Back
Top