# Coupled First Order Equations

1. Jul 30, 2010

### Jwill

I have a large project involving Runge Kutta numerical solutions of differential equations. I understand the Runge Kutta method and I've done it before, but my problem involves taking the differential equation

y''=sin(3y(t)), t>=0

and reexpressing this IVP into coupled first order equations. I have seen examples where people have done something similiar like set

z'=sin(3y(t))
y'=z

and there is a guy in my class that swears that this is right, but frankly that doesn't make sense to me in this case. If someone could help me understand how to do this correctly, I feel like I have a decent understanding of the numerical solution method. I have been asked to use the first order Runge Kutta method, but I have never used this method with coupled equations that looks anything like this...

2. Jul 31, 2010

### HallsofIvy

Why doesn't it make sense to you? If y'= z, and z'= sin(3y) then y"= z'= sin(3y) as you want.

In order to use Runge-Kutta on this problem do two simultaneous solutions, solving for both y and z at each step, then using the new values of y and z in the next step.

3. Jul 31, 2010

### Jwill

If that is correct then I must not understand how to do the stage constants for the iteration.

If
$$\frac{dz}{dt} = sin(3y(t))$$

$$\frac{dy}{dt} = z$$

then

$$\frac{dz}{dt} = f[t, y(t)]$$

$$\frac{dy}{dt} = f[t, z(t)]$$

(I think)

How are they "coupled" in that I don't see that they have a dependency on each other. I understand the runge kutta method when they have a dependency on each other, but how does solving for z or y help you solve for the other?... I don't see how the stage constants rely on each other.

I would understand if it was

$$\frac{dy}{dt} = f[t, y(t), z(t)]$$

$$\frac{dz}{dt} = F[t, y(t), z(t)]$$

If you could help me understand this, I'd appreciate it. It would make since if y and z were in both first order equations.

4. Jul 31, 2010

### Jwill

Well.... anyway my attempt at this was:

$$k1 = z_{i}$$

$$l1 = sin(3.*(y_{i}));$$

$$k2 = z_{i}+\frac{h}{2}*l1$$

$$l2 = sin(3*(y_{i}+\frac{h}{2}*k1))$$

$$k3 = z_{i}+\frac{h}{2}*l2$$

$$l3 = sin(3*(y_{i}+\frac{h}{2}*k2))$$

$$k4 = z_{i}+h*l2$$

$$l4 = sin(3*(y_{i}+h*k2))$$

$$z_{i+1} = z_{i} + \frac{h}{6}*(l1+2*l2+2*l3+l4)$$

$$y_{i+1} = y_{i} + \frac{h}{6}*(k1+2*k2+2*k3+k4)$$

I doubt this is correct... In the event that it is, could someone explain it to me better. Either way, I would like to understand this.

5. Aug 1, 2010

### HallsofIvy

As I have said in another forum, you are right. The first pair of equations is incorrect, the second pair is correct.