- #1
Haydo
- 20
- 0
Homework Statement
Convert the following second-order differential equation into a system of first-order equations and solve y(1) and y'(1) with 4th-order Runge-kutta for h=0.5.
##y''(t)+sin(y(t))=0,\ y(0)=1,\ y'(0)=0##
Homework Equations
The Runge-kutta method might be applicable, but I know how to do that part no problem.
The Attempt at a Solution
The issue I'm having is converting it into a proper system of equations.
I let:
##x_1=y,\ x_2=y'##
Thus:
##x_1'=x_2,\\ x_2'=y''=-sin(y)=-sin(x_1)##
with
##x_1(0)=1,\ x_2(0)=0##
This yields:
##\begin{pmatrix}x_1\\x_2\end{pmatrix}'=
\begin{pmatrix}x_2\\-sin(x_1)\end{pmatrix}##
I need to put this in the form:
##\overrightarrow{x'}=A\overrightarrow{x}##
so that I can solve it using runge-kutta. Any ideas?