Numerical Methods20825 marksNumerical: Runge-Kutta 4th orderRunge-Kutta fourth order method
Solve fracdydx = x2 + y, with y(0) = 1 for x = 1.5, using RK fourth order method.
Solve $\frac{dy}{dx} = x^2 + y$, with $y(0) = 1$ for $x = 1.5$, using RK fourth order method. [5]
- ODE: $\dfrac{dy}{dx} = f(x,y) = x^2 + y$ - Initial condition: $x0 = 0$, $y0 = 1$ - Target: $y$ at $x = 1.5$ - Step size (chosen): $h = 0.5$, giving 3 steps: $0 \to 0.5 \to 1.0 \to 1.5$ $$k1 = h f(xn, yn),\quad k2 = h f!\left(xn+\tfrac h2, yn+\tfrac{k1}{2}\right)$$ $$k3 = h f!\left(xn+\tfrac h...