System of Second Order ODE rewriting
    3 views (last 30 days)
  
       Show older comments
    
Hi everyone,
I am trying to solve the following system of 2 second order coupled non linear differential equation (position and attitude of a drone):
dy1^2/dt2 = (1/M)*wRB*F*u + f (wRb depend on y1 3x1 position vector)
dy2^2/dt2 = -inv(J)*cross(dy2/dt,J*dy2/dt) + inv(J)*H*u (y2 the attitude vector, roll,pitch and yaw)
wRb is a 3x3 matrix changing each time step, F a 3x6 constant matrix, u a 6x1 vector and f a 3x1 vector.
J is a 3x3 matrix, H a 3x6 constant matrix.
I have some trouble to rewrite it correctly, here it is what I have on my file (initial condition are all at 0)
 function dX = dyn(t,x,parameters...)
 X1(:)=x
 dX1(:)=X2(:)
 dX2(1:3)=(1/M)*wRB*u + f
 dX2(4:6)=-inv(J)*cross(X2(4:6),J*X2(4:6)) + inv(J)*H*u
I just would like to know if the transformation of the 2 second order equation in first order equation is right or not ?
Thanks in advance
0 Comments
Answers (0)
See Also
Categories
				Find more on Ordinary Differential Equations in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!