-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdXfun.m
More file actions
62 lines (60 loc) · 4.77 KB
/
dXfun.m
File metadata and controls
62 lines (60 loc) · 4.77 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
function dX = dXfun(I1,I2,m1,m2,mb,L1,L2,g,Th1,Th2,S,dTh1,dTh2,dS,t)
%dXfun
% dX = dXfun(I1,I2,M1,M2,MB,L1,L2,G,Th1,Th2,S,dTh1,dTh2,dS,T)
% This function was generated by the Symbolic Math Toolbox version 9.2.
% 27-Apr-2023 12:07:25
t2 = cos(Th1);
t3 = cos(Th2);
t4 = sin(Th2);
t5 = L1.^2;
t6 = L1.^3;
t7 = L2.^2;
t8 = L2.^3;
t9 = S.^2;
t10 = S.^3;
t11 = dTh1.^2;
t12 = dTh2.^2;
t13 = m2.^2;
t14 = mb.^2;
t15 = -Th2;
t16 = I1.*I2.*1.6e+1;
t17 = Th1+t15;
t18 = I2.*m1.*t5.*4.0;
t19 = I1.*m2.*t7.*4.0;
t22 = I2.*m2.*t5.*1.6e+1;
t23 = I2.*mb.*t5.*1.6e+1;
t24 = I1.*mb.*t9.*1.6e+1;
t29 = m1.*m2.*t5.*t7;
t30 = m2.*mb.*t5.*t7.*4.0;
t31 = m1.*mb.*t5.*t9.*4.0;
t32 = t5.*t7.*t13.*4.0;
t33 = m2.*mb.*t5.*t9.*1.6e+1;
t34 = t5.*t9.*t14.*1.6e+1;
t20 = cos(t17);
t21 = sin(t17);
t25 = t20.^2;
t26 = t20.^3;
t27 = t21.^2;
t28 = t21.^3;
t35 = t23.*t27;
t36 = I2.*mb.*t5.*t27.*-1.6e+1;
t37 = L2.*S.*m2.*mb.*t5.*t25.*1.6e+1;
t38 = t27.*t30;
t39 = t25.*t32;
t41 = m2.*mb.*t5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