-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathG_Matrix.m
27 lines (25 loc) · 1.06 KB
/
G_Matrix.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function G_a = G_Matrix(m_b,m_1,m_2,Ixx,Iyy,Izz,Ix1,Iy1,Iz1,Ix2,Iy2,Iz2,l1,l2,x,y,z,phi,theta,psi,n1,n2,x_dot,y_dot,z_dot,phi_dot,theta_dot,psi_dot,n1_dot,n2_dot)
%G_MATRIX
% G_A = G_MATRIX(M_B,M_1,M_2,IXX,IYY,IZZ,IX1,IY1,IZ1,IX2,IY2,IZ2,L1,L2,X,Y,Z,PHI,THETA,PSI,N1,N2,X_DOT,Y_DOT,Z_DOT,PHI_DOT,THETA_DOT,PSI_DOT,N1_DOT,N2_DOT)
% This function was generated by the Symbolic Math Toolbox version 7.1.
% 21-Mar-2017 11:50:11
t2 = cos(theta);
t3 = cos(n1);
t4 = sin(n1);
t5 = sin(phi);
t6 = cos(phi);
t7 = l1.*t3.*(1.0./2.0);
t8 = l2.*t4.*(1.0./2.0);
t9 = t7+t8;
t10 = sin(theta);
t11 = l1.*t4.*(1.0./2.0);
t13 = l2.*t3.*(1.0./2.0);
t12 = t11-t13;
t14 = t2.*t6.*t12;
t15 = t2.*t5.*t9;
t16 = t14+t15;
t17 = l1.*t2.*t3.*t5.*(1.0./2.0);
t18 = l1.*t2.*t4.*t6.*(1.0./2.0);
t19 = t17+t18;
t20 = m_2.*t16.*(-4.9e1./5.0)-m_1.*t19.*(4.9e1./5.0);
G_a = [0.0;0.0;m_1.*(4.9e1./5.0)+m_2.*(4.9e1./5.0)+m_b.*(4.9e1./5.0);t20;m_1.*(l1.*t3.*t6.*t10.*(1.0./2.0)-l1.*t4.*t5.*t10.*(1.0./2.0)).*(-4.9e1./5.0)-m_2.*(t6.*t9.*t10-t5.*t10.*t12).*(4.9e1./5.0);0.0;t20;0.0];