what is the first part of the matrix? "Fill"

icon
Related questions
Question
(lagrangian mechanics-Ordinary differantial equations)
lagrangian formulation of dynamics 
  • what is the first part of the matrix? "Fill"
X trajectory.m x RPmanipulator.m x
RPmanipulator (q, u, ml, m2,I1,12,rl)
LU.m X
findswitch.m
abc.m
X trajectory2.m x +
1
function RHS =
* creates the righthand side of the Lagrange dynamics converted to ordinary
% differential equations
Sthe main equation was given in the general form qdotdot, it was 2nd order,
SWe need to define extra variables to get it down to Ind order:
$ q= ql q2 qldot q2dot
* RHS: right hand side qdot=RHS
* RHS1=qldot
* RHS2-q2dot
* RHS3=qldotdot=from Lagrange equation
* RHS4=q2dotdot=from Lagrange equation
2
3
4
7
8
10
11
12 -
g=9.8; gravitational acc.
13 -
RHS=[$FILL%;
g (4) ;
- (2*m2 *q (2) *q (3) *q(4) +g* (ml*rl+m2*q(2)) *cos (g (1)) -u (1) )/ (Il+12+ml*rl^2+m2*q(2) ^2);
14
15
16
- (-m2*g (2) *a(3) ^2+g*m2*sin (q (1))-u (2))/m2;
17
18 -
end
Current Fold
Transcribed Image Text:X trajectory.m x RPmanipulator.m x RPmanipulator (q, u, ml, m2,I1,12,rl) LU.m X findswitch.m abc.m X trajectory2.m x + 1 function RHS = * creates the righthand side of the Lagrange dynamics converted to ordinary % differential equations Sthe main equation was given in the general form qdotdot, it was 2nd order, SWe need to define extra variables to get it down to Ind order: $ q= ql q2 qldot q2dot * RHS: right hand side qdot=RHS * RHS1=qldot * RHS2-q2dot * RHS3=qldotdot=from Lagrange equation * RHS4=q2dotdot=from Lagrange equation 2 3 4 7 8 10 11 12 - g=9.8; gravitational acc. 13 - RHS=[$FILL%; g (4) ; - (2*m2 *q (2) *q (3) *q(4) +g* (ml*rl+m2*q(2)) *cos (g (1)) -u (1) )/ (Il+12+ml*rl^2+m2*q(2) ^2); 14 15 16 - (-m2*g (2) *a(3) ^2+g*m2*sin (q (1))-u (2))/m2; 17 18 - end Current Fold
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer