Hello!
I am currently working on a script which solves a system of 4 ODE's in matlab. The script doesn't seem to give the right output, is there anyone who can point me in the right direction on getting it to work? I included the system of ode's I want to solve and the code I am currently using.
M1 = 0.5M2 = 0.3D1 = 0.1D2 = 0.3P1 = 0.30*160e6P2 = 0.20*160e6a12 = 0.1a21 = 6% define first order ODE
f = @(t,z) [z(2); z(2)*(-D1/M1)+P1-(a12/M1)*sin(z(1)-z(3)); z(4); (-D2/M2)*z(4)+(P2/M2)-((a21/M2)*sin(z(3)-z(1)))]%solve using ode45 function
[t,s] = ode45(f,[0 20],[0 0 0 0]);
Best Answer