This is part 1 of the assignment for Simulation of Engineering Systems 3

State Space:

For the left hand side: , , , For the right hand side , ,

let

State Space:

function xdot = rover(x,u);
 
global Vo;
 
global Gc;
 
global Bs;
 
global Kt;
 
global Ke;
 
global Ky;
 
global Jw;
 
global Jm;
 
global Rm;
 
global L;
 
global Pr;
 
xdot(1,1) = (Vo+Gc*Pr-Gc*x(9)-R*x(1)-Ke*x(2) ) /L;
 
xdot(2,1) = (Kt*x(1)-Bs*x(2)+Bs*x(3))/Jm;
 
xdot(3,1) = (Bs*x(2)-Bs*x(3))/Jw;
 
xdot(4,1) = (Vo - Gc*Pr + Gc*x(9)-R*x(4)-Ke*x(5))/L;
 
xdot(5,1) = (Kt*x(4) - Bs*x(5) + Bs*x(6))/Jm;
 
xdot(6,1) = (Bs*x(5)-Bs*x(6))/Jw;
 
xdot(7,1) = (2*Kt*Kv*x(7)*x(4))/(Rw*Vt) + (2*Kt*Kv*x(7)*x(1))/(Rw*Vt) - Ks*x(7) + Vt*x(8);
 
xdot(8,1) = (2*Ky*Kt*Rm*x(1))/Rw - (2*Ky*Kt*Rm*x(4))/Rw + Kd*x(7) - Vt*x(8);
 
xdot(9,1) = x(8);

legend('MatLab', 'Simulink')