MHB Estimate $y(0.5)$ using Euler's Method

Click For Summary
SUMMARY

This discussion focuses on estimating the value of y(0.5) using Euler's Method for the initial-value problem defined by the differential equation y' = y(x + 1) with the initial condition y(0) = 1. The step size used is h = 0.1, and the calculations yield an approximation of y(0.5) = 1.7616 after five iterations. The actual solution is y(0.5) ≈ 1.868, indicating that while Euler's Method provides a reasonable estimate, it is less accurate than more advanced methods like Heun's or Runge-Kutta.

PREREQUISITES
  • Understanding of Euler's Method for numerical solutions of differential equations
  • Familiarity with initial-value problems in calculus
  • Basic knowledge of Taylor series and error analysis in numerical methods
  • Ability to perform arithmetic operations and function evaluations
NEXT STEPS
  • Learn about Heun's Method for improved accuracy in numerical approximations
  • Study the Runge-Kutta methods for solving ordinary differential equations
  • Explore error analysis techniques specific to numerical methods
  • Practice solving different initial-value problems using various numerical methods
USEFUL FOR

Students and professionals in mathematics, engineering, and computer science who are interested in numerical methods for solving differential equations, particularly those looking to enhance their understanding of approximation techniques and error analysis.

ineedhelpnow
Messages
649
Reaction score
0
use euler's method with step size 0.1 to estimate y(0.5), where y(x) is the solution of the initial-value problem y'=y(x+1), y(0)=1. round your answer to four decimal places.

this is all I've done so far

$y'=y(x+1)$
$y(0)=1$
$h=0.1$
$x_{0}=0$
$y_{0}=1$

$x_{1}=x_{0}+h=0+0.1=0.1$
$x_{2}=x_{1}+h=0.1+0.1=0.2$
...etc. (im assuming that i stop once i reach $x_{n}=1$)

and then according to the book $y_{n}=y_{n-1}+hF(x_{n-1},y_{n-1})$ and n=1,2,3...

i think i understand how to do it but for my $F(x_{0},y_{0})$, $F(x_{1},y_{1})$,... do i plug the x and y into $y'=xy-x^2$ ?
 
Physics news on Phys.org
ineedhelpnow said:
use euler's method with step size 0.1 to estimate y(0.5), where y(x) is the solution of the initial-value problem y'=y(x+1), y(0)=1. round your answer to four decimal places.

this is all I've done so far

$y'=y(x+1)$
$y(0)=1$
$h=0.1$
$x_{0}=0$
$y_{0}=1$

$x_{1}=x_{0}+h=0+0.1=0.1$
$x_{2}=x_{1}+h=0.1+0.1=0.2$
...etc. (im assuming that i stop once i reach $x_{n}=1$)

and then according to the book $y_{n}=y_{n-1}+hF(x_{n-1},y_{n-1})$ and n=1,2,3...

i think i understand how to do it but for my $F(x_{0},y_{0})$, $F(x_{1},y_{1})$,... do i plug the x and y into $y'=xy-x^2$ ?

Your function $F(x,y)$ would be defined by $y' = F(x,y)$.
In other words:
$$F(x,y) = y \cdot (x+1)$$

That means that you have:
$$y_{n}
= y_{n-1}+h\cdot F(x_{n-1},y_{n-1})
= y_{n-1}+h\cdot y_{n-1}\cdot (x_{n-1} + 1)$$

Not sure where you got $y'=xy-x^2$. :confused:
 
oops my bad. i was looking at my problem and another example at the same time so i put the equation of the other example. the one from my problem is $y'=y(x+1)$
 
uuum...i spent 1 hour solving for $x_1$ to $x_{10}$ and $y_1$ to $y_{10}$ but the problem says to estimate y(0.5) so i think that means i was only supposed to go up to $x_5$ and $y_5$. is that right? did i seriously spend 45 minutes doing extra work that is totally unnecessary? (Speechless) (Angry)
 
ineedhelpnow said:
uuum...i spent 1 hour solving for $x_1$ to $x_{10}$ and $y_1$ to $y_{10}$ but the problem says to estimate y(0.5) so i think that means i was only supposed to go up to $x_5$ and $y_5$. is that right? did i seriously spend 45 minutes doing extra work that is totally unnecessary? (Speechless) (Angry)

Yep.
 
is $x_0=0$ and $y_0=1$?
 
ineedhelpnow said:
is $x_0=0$ and $y_0=1$?

Yes.
 
$x_{1}=0+0.1=0.1$

$x_{2}=0.1+0.1=0.2$

$x_{3}=0.2+0.1=0.3$

$x_{4}=0.3+0.1=0.4$

$x_{5}=0.4+0.1=0.5$$y_{1}=1+0.1F(0,1)=1+0.1(1)=1.1$

$y_{2}=1.1+0.1F(0.1,1.1)=1.1+0.1(1.21)=1.221$

$y_{3}=1.221+0.1F(0.2,1.221)=1.221+0.1(1.4652)=1.36752$

$y_{4}=1.36752+0.1F(0.3,1.36752)=1.36752+0.1(1.77778)=1.545298$

$y_{5}=1.545298+0.1F(0.4,1.545298)=1.545298+0.1(2.1634172)=1.76163972$

is that right? so is y(0.5)=1.7616?
 
ineedhelpnow said:
$x_{1}=0+0.1=0.1$

$x_{2}=0.1+0.1=0.2$

$x_{3}=0.2+0.1=0.3$

$x_{4}=0.3+0.1=0.4$

$x_{5}=0.4+0.1=0.5$$y_{1}=1+0.1F(0,1)=1+0.1(1)=1.1$

$y_{2}=1.1+0.1F(0.1,1.1)=1.1+0.1(1.21)=1.221$

$y_{3}=1.221+0.1F(0.2,1.221)=1.221+0.1(1.4652)=1.36752$

$y_{4}=1.36752+0.1F(0.3,1.36752)=1.36752+0.1(1.77778)=1.545298$

$y_{5}=1.545298+0.1F(0.4,1.545298)=1.545298+0.1(2.1634172)=1.76163972$

is that right? so is y(0.5)=1.7616?

Your method is correct.

The actual solution is:
$$y=e^{\frac 1 2 x(x+2)}$$
Meaning:
$$y(0.5)=e^{\frac 1 2 \cdot 0.5(0.5+2)} = e^{0.625} \approx 1.868$$

Your value seems a fair approximation.
 
  • #10
oh wow that's a big difference. so should i just say that according to euler's method $y(0.5)\approx 1.7616$
 
  • #11
ineedhelpnow said:
oh wow that's a big difference. so should i just say that according to euler's method $y(0.5)\approx 1.7616$

The expected error in each step is of order $h^2$.
Since we have 5 steps, we can expect an error of some constant times $5 \cdot 0.1^2 = 0.05$.
An error of about $0.1$ seems about right.

You'd get a better approximation with the method of Heun.
The generally preferred method is the one of Runge-Kutta, which will effectively be right on target, even with a fairly big step size.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 65 ·
3
Replies
65
Views
8K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 9 ·
Replies
9
Views
3K