I am wondering how I can convert the function $\theta'' + k \sin(\theta) = 0$ into a system of first order ODEs? I understand that I should set for example:
$y_2' = \theta''$
$y_2 = y_1' = \theta'$
$y_1 = \theta $
And then generally it is easy to set up the $(y_2', y_1')$ matrix. However I am wondering how I can do it as the variable is a function of sine?
Set $y_1 = \theta$, and then we have:
$y_1' = \theta' = y_2$
$y_2' = \theta'' = -k \sin y_1$
As a system, we would write $Y = A y + f$, that is:
$$Y = \begin{pmatrix} y_1' \\ y_2' \end{pmatrix} = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}\begin{pmatrix} y_1 \\ y_2 \end{pmatrix} + \begin{pmatrix} 0 \\ -k \sin y_1 \end{pmatrix}$$