# Runge-Kutta 4 in polar coordinates

How is the Runge-Kutta method implemented on this differential equation:

$$\frac{d^2 \theta}{dt} = -\frac{g}{l} \theta$$

(pendulum motion) which is in polar coordinates?

Let: $c = \frac{g}{l}$

So the first step is:

$$a1 = y_2 dt$$ $$b1 = -c y_1 dt$$

Is this correct? How do I continue from here?

• It does not matter what type of coordinates you use when applying RK, only the form of the equation. First write the equation as a coupled system of first order equations. Taking $y_1=\theta$ and $y_2 = \frac{d\theta}{dt}$ the system can be written $\pmatrix{\frac{dy_1}{dt}\\ \frac{dy_2}{dt}} = \pmatrix{y_2\\-\frac{g}{l}y_1}$. This equation is now on the standard form $\frac{d\vec{y}}{dt} = \vec{f}(\vec{y})$ and you can apply the standard Runge-Kutta. – Winther Jan 30 '16 at 16:34
• @Winther I have updated my answer, could you have a look? – DoubleOseven Jan 30 '16 at 17:06
• I don't understand what you are trying to do with these three equations. Some words might help. See this page for how to apply the RK method. – Winther Jan 30 '16 at 17:07
• @Winther I have already looked at that page, but because I have a vector equation I get cofused. I have edited the question :) – DoubleOseven Jan 30 '16 at 17:09
• For a similar problem see math.stackexchange.com/questions/1633224/… with code and corrections. – Lutz Lehmann Jan 30 '16 at 17:12