I have 2 coupled second order equations as below: $$ \ddot{y}(t) + a\dot{y}(t) + by(t)=q(t) $$ $$ \ddot{q}(t) + c\dot{q}(t) + dq(t) = A\ddot{y}(t)$$
I'm wondering if it is possible to solve this system using Runge Kutta 4th order? My problem here is the second derivative of y in the second equation. How to handle it?
EDIT: Here below is the system of equations I considered:
$$ \dot{y}(t) = w(t) $$ $$ \ddot{y}(t) = \dot{w}(t) = -aw(t) - by(t)+q(t) $$ $$ \dot{q}(t) = z(t) $$ $$ \ddot{q}(t) = \dot{z}(t) = A\dot{w}(t)-cz(t) - dq(t)$$
Let's imagine I have results at tn and I want results at tn+1. Then I computes K1, knwing $w(t_{n})$, $z(t_{n})$, $y(t_{n})$, $q(t_{n})$: $$ k_{y,1} = w(t_{n}) $$ $$ k_{q,1} = z(t_{n}) $$ $$ k_{w,1} = -aw(t_{n}) - by(t_{n})+q(t_{n}) $$ $$ k_{z,1} = A\dot{w}(t_{n})-cz(t_{n}) - dq(t_{n}) $$
Here there's already a problem: I don't know $\dot{w}(t_{n})$.
Next step is to compute K2: $$ k_{y,2} = w(t_{n}) + k_{w,1}*\frac{dt}{2}$$ $$ k_{q,2} = z(t_{n}) + k_{z,1}*\frac{dt}{2} $$ $$ k_{w,2} = -a\left(w(t_{n}) + k_{w,1}*\frac{dt}{2})\right) - b\left(y(t_{n}) + k_{y,1}*\frac{dt}{2})\right)+\left(q(t_{n}) + k_{q,1}*\frac{dt}{2})\right) $$ $$ k_{z,2} = A\left(\dot{w}(t_{n}) + k_{\dot{w},1}*\frac{dt}{2})\right)-c\left(z(t_{n}) + k_{z,1}*\frac{dt}{2})\right) - d\left(q(t_{n}) + k_{q,1}*\frac{dt}{2})\right) $$ Here again, I don't know $\dot{w}(t_{n})$ nor $k_{\dot{w},1}$ and I don't see any way to compute them.
One just need to realize that: $$\ddot{q}(t)=\dot{z}(t)=A\dot{w}(t)−cz(t)−dq(t)$$
can also be written as:
$$\ddot{q}(t)=\dot{z}(t)=A\left( −aw(t)−by(t)+q(t) \right)−cz(t)−dq(t)$$
thanks to first equation. And now the problem is simple and only rely on $w(t_{n})$, $z(t_{n})$, $y(t_{n})$, $q(t_{n})$