Share
Explore BrainMass

Ordinary Differential Equation : dy/dx = -y-sinx defined on the domain {x: -pi < x < pi} using 4th order Runge-Kutta.

In the solution of the ODE : dy/dx = -y-sinx defined on the domain
{x: -pi < x < pi} using 4th order Runge-Kutta

I am trying to provide step-by-step detail of the first two steps (h=pi/30).

Solution Preview

Recall the 4th order Runge-Kutta algorithm:
To approximate the solution to equation, dy/dx = f(x,y), we construct a sequence of approximate solutions (x_n, y_n), with x_(n+1) = x_n + h .

Given (x_n,y_n), we say:
k_1 = h f(x_n,y_n)
k_2 =h f(x_n + h/2,y_n + k_1/2)
k_3 = h f(x_n + h/2, y_n + k_2/2)
k_4 = h f(x_n + h, y_n + k_3) [NOTE we sample at the endpoint, i.e. x_n+h, this ...

Solution Summary

The Runge-Kutta method is applied to an ODE.

$2.19