Using the forward Euler method to solve y''(t) = f(t), with y(0) = 0 and y'(0)…
1997
Using the forward Euler method to solve y''(t) = f(t), with y(0) = 0 and y'(0) = 0, and step size h, the values of y in the first four iterations are:
- A.
0, h f(0), h(f(0) + f(h)), h(f(0) + f(h) + f(2h))
- B.
0, 0, h^2 f(0), h^2(2f(0) + f(h))
- C.
0, 0, h^2 f(0), 3h^2 f(0)
- D.
0, 0, h f(0) + h^2 f(0), h f(0) + h^2 f(0) + h f(h)
Show answer & explanation
Correct answer: B
Convert the second-order equation to a first-order system by taking v(t) = y'(t). Then
y' = v, and v' = f(t).
Forward Euler with step size h gives:
v_{k+1} = v_k + h f(kh),
y_{k+1} = y_k + h v_k.
Given y_0 = 0 and v_0 = 0:
y_0 = 0.
y_1 = y_0 + h v_0 = 0.
v_1 = v_0 + h f(0) = h f(0).
y_2 = y_1 + h v_1 = h^2 f(0).
v_2 = v_1 + h f(h) = h(f(0) + f(h)).
y_3 = y_2 + h v_2 = h^2 f(0) + h^2(f(0) + f(h)) = h^2(2f(0) + f(h)).
Therefore the first four values of y are 0, 0, h^2 f(0), and h^2(2f(0) + f(h)).