[Math] Euler method for second order ODE

numerical methodsordinary differential equations

"
1. Write this second order ode as a first order ode.

$y''(t)=y(t)+y'(t)+t$

$y(0) = 1$

$y'(0) = 0$

  1. Use the Euler Method with h = 0.1. What approximation of $(y(h), y'(h))$ do you get?"

I think I understand the first problem. I substitute y with $u_1$ and $y'$ with $u_2$ which gives: $y' = u_2, y''=u_1 + u_2 + t$. Is that correct?

If so, I don't really know where to go from there.

Best Answer

Expanding the comment of Winther: Yes, but write $y''=u_2'$ to get the first order system: \begin{align} u_1'&=u_2&\text{ and }\\ u_2'&=u_1+u_2+t. \end{align} Now apply Euler's method one step: \begin{align} y(h)=u_1(h)&\approx u_1(0)+h\,u_2(0)&&=1+h\cdot0&\text{ and }\\ y'(h)=u_2(h)&\approx u_2(0)+h\,\bigl[u_1(0)+u_2(0)+0\bigr]&&=0+hâ‹…[1+0+0]. \end{align}

In the next step you would get \begin{align} y(2h)=u_1(2h)&\approx u_1(h)+h\,u_2(h)&&≈1+h\cdot h&\text{ and }\\ y'(2h)=u_2(2h)&\approx u_2(h)+h\,\bigl[u_1(h)+u_2(h)+h\bigr]&&≈h+h⋅[1+h+h]. \end{align} et