If Runge-Kutta method of order 4 is used to solve the D.E. dy/dx = f(x), y(0)…
If Runge-Kutta method of order 4 is used to solve the D.E. dy/dx = f(x), y(0) = 0 in the interval [0, h] with step size h, then the value of the expression k₁ + k₂ + k₃ + k₄ is ____.
Answer: B. h[f(0) + 2f(h/2) + f(h)] — Solution: Given dy/dx = f(x), y(0) = 0 on [0,h]. Since f depends only on x, the y-values do not change the argument of f; take x0 = 0, y0 = 0. k1 = h f(x0,…
- A.
h[f(0) + f(h/2) + f(h)]
- B.
h[f(0) + 2f(h/2) + f(h)]
- C.
h[f(0) + 3f(h/2) + f(h)]
- D.
h[f(0) + 4f(h/2) + f(h)]
Attempted by 5 students.
Show answer & explanation
Correct answer: B
Solution:
Given dy/dx = f(x), y(0) = 0 on [0,h]. Since f depends only on x, the y-values do not change the argument of f; take x0 = 0, y0 = 0.
k1 = h f(x0, y0) = h f(0).
k2 = h f(x0 + h/2, y0 + k1/2) = h f(h/2) (y does not affect f).
k3 = h f(x0 + h/2, y0 + k2/2) = h f(h/2) (again evaluates at h/2).
k4 = h f(x0 + h, y0 + k3) = h f(h).
Now sum the stages:
k1 + k2 + k3 + k4 = h f(0) + h f(h/2) + h f(h/2) + h f(h) = h[ f(0) + 2 f(h/2) + f(h) ].
Therefore the value of k1 + k2 + k3 + k4 is h[f(0) + 2f(h/2) + f(h)].