Euler's method for numerical approximation

In summary: So instead of using t=0.1, you actually have to use t=0.05 and t=0.1 to get the correct answer.In summary, the conversation is about finding the approximate values of a solution to an initial value problem using the Euler method. The values are calculated at different time intervals (0.1 and 0.05) and compared. It is important to adjust the steps taken to account for the change in step size.
  • #1
Chandasouk
165
0
y' = 3 + t - y, y(0) = 1

A) Find the approximate values of the solution of the given initial value problem at t = 0.1, 0.2, 0.3, 0.4 using the Euler method with h = 0.1.

B) Repeat part A with h = 0.05. Compare the results found in A.

I did part A correctly, but cannot get the right numbers for part B when I use the step size 0.05.

For part A, I did the following
(t0=0, y0=1)

Y1 = y0+f(t0,y0)*h = 1 + f(0,1)(0.1) = 1.2

Similarly,

Y2=y1+f(t1,y1)*h=1 + f(0.1,1.2)(0.1) = 1.39

Etc, etc.

However when I do part B, where h = 0.05, and try calculating Y1

Y1 = y0+f(t0,y0)*h = 1+f(0,1)(0.05) = 1.1

The answer in my book is 1.1975

What am I doing wrong?
 
Physics news on Phys.org
  • #2
Chandasouk said:
However when I do part B, where h = 0.05, and try calculating Y1

Y1 = y0+f(t0,y0)*h = 1+f(0,1)(0.05) = 1.1

The answer in my book is 1.1975

What am I doing wrong?
Everything seems to be correct in what you have posted so far. Remember, [tex]$ y_{n}=y_{n-1}+f(t_{n-1},y_{n-1})*h$[/tex] is an approximation of the value of y(t) at t=n*h.
 
  • #3
The general Euler forumla is:
[tex]
y_{i+1}=y_{i}+y'(y_{i},t_{i})h
[/tex]
so take h=0.05 to obtain:
[tex]
y_{0.05}=1+0.05*(3+0-1)=1.1
[/tex]
Now to calculate y at 0..1:
[tex]
y_{0.1}=1.1+0.05*(3+0.05-1.1)=1.1925
[/tex]
 
  • #4
Oh, thanks. I forgot to account for the step size change, meaning you take more steps to get to 0.1 now.
 
Last edited:

1. What is Euler's method for numerical approximation?

Euler's method is a mathematical algorithm used to approximate the solutions to ordinary differential equations. It is a first-order method that uses small steps to estimate the value of a function at a given point, based on the slope of the function at the previous point.

2. How does Euler's method work?

Euler's method starts with a given initial point and uses the slope of the function at that point to estimate the value of the function at the next point. This process is repeated with smaller and smaller steps, resulting in a series of approximations that converge to the actual solution of the differential equation.

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

Euler's method is a simple and easy-to-understand algorithm that can be applied to a wide range of differential equations. It also requires minimal computational resources, making it a relatively efficient method for numerical approximation.

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

One limitation of Euler's method is that it can produce inaccurate results for functions with high curvature or steep changes. It also has a tendency to accumulate errors over time, which can lead to significant deviations from the actual solution.

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, as this reduces the error caused by the linear approximation. Alternatively, higher-order methods such as the Runge-Kutta method can be used, which provide more accurate results but are more complex to implement.

Similar threads

  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
2K
  • Calculus and Beyond Homework Help
Replies
6
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Calculus and Beyond Homework Help
Replies
12
Views
2K
Replies
3
Views
2K
  • Calculus and Beyond Homework Help
Replies
6
Views
3K
  • Calculus and Beyond Homework Help
Replies
2
Views
2K
  • Calculus and Beyond Homework Help
Replies
8
Views
3K
  • Calculus and Beyond Homework Help
Replies
6
Views
5K
Back
Top