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

Click For Summary

Discussion Overview

The discussion revolves around 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 \). Participants explore the application of Euler's Method with a step size of 0.1, detailing their calculations and addressing potential misunderstandings regarding the process.

Discussion Character

  • Homework-related
  • Mathematical reasoning
  • Exploratory
  • Debate/contested

Main Points Raised

  • One participant outlines the initial conditions and the formula for Euler's Method, seeking clarification on how to apply it correctly.
  • Another participant corrects a misunderstanding regarding the function \( F(x,y) \), clarifying that it should be defined as \( F(x,y) = y(x+1) \).
  • There is a discussion about the extent of calculations needed, with one participant expressing frustration over potentially unnecessary work in calculating values beyond \( y(0.5) \).
  • Multiple participants confirm the initial values \( x_0 = 0 \) and \( y_0 = 1 \) as correct.
  • Calculations for \( y_1 \) through \( y_5 \) are presented, leading to an estimated value of \( y(0.5) \approx 1.7616 \).
  • A later reply introduces the actual solution to the differential equation, suggesting that the Euler approximation is a fair estimate but noting a significant difference from the exact solution.
  • Discussion includes comments on the expected error of the Euler method and mentions alternative methods like Heun's method and Runge-Kutta for potentially better approximations.

Areas of Agreement / Disagreement

Participants generally agree on the application of Euler's Method and the calculations leading to the estimate of \( y(0.5) \). However, there is no consensus on the accuracy of the Euler approximation compared to the actual solution, and participants express varying opinions on the error involved.

Contextual Notes

Participants note that the expected error in Euler's Method is of order \( h^2 \), and the discussion highlights the potential for significant discrepancies between the Euler estimate and the actual solution, depending on the method used.

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 5 ·
Replies
5
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 9 ·
Replies
9
Views
3K