Euler's Numerical method help

207 Views Asked by At

Consider this differential equation,

$dy/dx = x + \sin(y)$

with initial condition $y = 0.5$ when $x = 1.2$:

  1. Write down the recurrence relation for Euler's numerical method applied above.
  2. With step size h = 0.1, calculate the approximations to y(1.3) and y(1.4).
  1. This is my answer:

    $$Y_i+1 = Y_i + 0.1(X_i + \sin(Y_i))$$

  2. I have problem solving this one...

    From my txtbk reference, I sub $i = 1$ into the eqn thus giving me

    $Y_1 = Y_0 + 0.1(1.2 + \sin(0.5)) = 0.1679$

    Then, $i = 2$

    $Y_2 = Y_1 + 0.1(1.3 + \sin(0.6)$

Im sure my method in part 2 is wrong and I don't really understand how to solve it via my txtbk.

1

There are 1 best solutions below

2
On

We have the differential equation $ y'(x) = x + \sin(y)$ with initial condition $y(1.2) = 0.5$.

Euler's method states that we may approximate the value of the function at $y(x+\delta x)$ for some 'small step' $\delta x$ by assuming the function is approximately linear between $x$ and $x+\delta x$. I.e:

$$y(x+\delta x) \approx y(x) + y'(x)\cdot \delta x $$

Thus, for a step size of $\delta x = 0.1$, starting at $x=1.2$ we would have:

$$y(1.2+0.1) \approx y(1.2) + y'(1.2)\cdot 0.1 $$ $$y(1.3) = 0.5 + (1.2+\sin(0.5))\cdot 0.1$$ $$ = 0.5 + 0.167942554 $$

So you dropped the $0.5$ term in your calculation, i.e - what you call $Y_0$. Hopefully this makes things clearer for you. Can you figure out $y(1.4)$ now?