So, basically the solution can be implemented as follows
A=1;
B=1;
C=1;
t_interval = [0,10];
init_cond = [0,0,0,0]';
[t,y] = ode45(@(t,Y) odefcn(t,Y,A,B,C) , t_interval , init_cond);
plot(t,y(:,1),'b',t,y(:,2),'r');
where your system of equations transformed into ode by sobstitution x'=z, y'=w, and the order of variables is Y=[x,y,z,w]:
function dYdt = odefcn(t,Y,A,B,C)
dYdt = [ Y(3);
Y(4);
A*(Y(3)-Y(4)) + B*Y(1)^3;
C*(Y(4)-Y(3)) + B*Y(2)^3];
end
Of course, you will notice that starting by null conditions (init_cond=[0,0,0,0]) the solution you get is x(t)=y(t)=0 for each t. Because they solve the equation. Change initial conditions according to your original problem.
Best Answer