(adsbygoogle = window.adsbygoogle || []).push({}); 1. The problem statement, all variables and given/known data

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. Relevant equations

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

3. The attempt at a solution

Matlab Code:

clc;

clear all;

close all;

format long g;

N=input('current value of N')

deltat=20./N;

y=1;

z=0;

h = deltat;

t = 0:h:20;

i=0;

for i = 1:length(t)

T(i) = i*h;

Y(i) = y;

k1 = (z);

l1 = sin(3.*(y));

k2 = ((z)+(h./2).*l1);

l2 = sin(3.*((y)+(h./2).*k1));

k3 = ((z)+(h./2).*l2);

l3 = sin(3.*((y)+(h./2).*k2));

k4 = ((z)+h.*l3);

l4 = sin(3.*(y+h.*k3));

z = z + (h./6).*(l1+2.*l2+2.*l3+l4);

y = y + (h./6).*(k1+2.*k2+2.*k3+k4);

end

Y = Y'

plot(T,Y);

1. The problem statement, all variables and given/known data

2. Relevant equations

3. The attempt at a solution

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Coupled First Order Equations

**Physics Forums | Science Articles, Homework Help, Discussion**