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

In summary: But yes, you can just say that according to Euler's method $y(0.5)\approx 1.7616$.In summary, using Euler's method with a step size of 0.1, $y(0.5)$ was estimated to be approximately 1.7616 for the solution of the initial-value problem $y'=y(x+1)$, $y(0)=1$.
  • #1
ineedhelpnow
651
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
  • #2
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:
 
  • #3
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)$
 
  • #4
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)
 
  • #5
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.
 
  • #6
is $x_0=0$ and $y_0=1$?
 
  • #7
ineedhelpnow said:
is $x_0=0$ and $y_0=1$?

Yes.
 
  • #8
$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?
 
  • #9
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.
 

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

What is Euler's Method?

Euler's Method is a numerical method used to approximate the solution of a first-order differential equation. It involves using small steps to estimate the value of the solution at a specific point, given the initial value and the derivative of the function.

How is Euler's Method used to estimate a function at a specific point?

To estimate a function at a specific point, Euler's Method uses the initial value of the function and the derivative of the function to calculate the slope of the tangent line at that point. This slope is then used to determine the value of the function at a slightly later point, and this process is repeated until the desired point is reached.

What is the formula for Euler's Method?

The formula for Euler's Method is: yn+1 = yn + hf(xn, yn), where h is the step size, xn is the current x-value, and yn is the current y-value. This formula is used to calculate the value of the function at the next step, yn+1.

What is the significance of the step size in Euler's Method?

The step size in Euler's Method determines the accuracy of the estimated solution. A smaller step size will result in a more accurate estimation, but it will also require more calculations. A larger step size will be less accurate, but it will require fewer calculations. It is important to find a balance between accuracy and efficiency when choosing the step size.

What are the advantages and limitations of using Euler's Method?

The advantages of using Euler's Method include its simplicity and ease of implementation. It is also a useful tool for estimating solutions to differential equations that cannot be solved analytically. However, there are limitations to this method, such as the possibility of overestimating or underestimating the solution due to the step size. It also does not work well for highly nonlinear functions or when the step size is too large.

Similar threads

Replies
5
Views
2K
Replies
11
Views
3K
Replies
9
Views
3K
Replies
5
Views
2K
Replies
5
Views
4K
Back
Top