@@ -16,7 +16,7 @@ Flange fixed in housing at a given angle.
16
16
flange = Flange ()
17
17
end
18
18
@parameters begin
19
- phi0 = 0.0 , [description = " Fixed offset angle of flange" ]
19
+ phi0 = 0.0 , [description = " Fixed offset angle of flange" , unit = u " rad " ]
20
20
end
21
21
@equations begin
22
22
flange. phi ~ phi0
45
45
"""
46
46
@mtkmodel Inertia begin
47
47
@parameters begin
48
- J, [description = " Moment of inertia" ]
48
+ J, [description = " Moment of inertia" , unit = u " kg*m^2 " ]
49
49
end
50
50
@components begin
51
51
flange_a = Flange ()
55
55
@symcheck J > 0 || throw (ArgumentError (" Expected `J` to be positive" ))
56
56
end
57
57
@variables begin
58
- phi (t) = 0.0 , [description = " Absolute rotation angle" ]
59
- w (t) = 0.0 , [description = " Absolute angular velocity" ]
60
- a (t) = 0.0 , [description = " Absolute angular acceleration" ]
58
+ phi (t) = 0.0 , [description = " Absolute rotation angle" , unit = u " rad " ]
59
+ w (t) = 0.0 , [description = " Absolute angular velocity" , unit = u " rad*s^-1 " ]
60
+ a (t) = 0.0 , [description = " Absolute angular acceleration" , rad = u " rad*s^-2 " ]
61
61
end
62
62
@equations begin
63
63
phi ~ flange_a. phi
@@ -94,8 +94,8 @@ Linear 1D rotational spring
94
94
@symcheck c > 0 || throw (ArgumentError (" Expected `c` to be positive" ))
95
95
end
96
96
@parameters begin
97
- c, [description = " Spring constant" ]
98
- phi_rel0 = 0.0 , [description = " Unstretched spring angle" ]
97
+ c, [description = " Spring constant" , unit = u " N*m*rad^-1 " ]
98
+ phi_rel0 = 0.0 , [description = " Unstretched spring angle" , unit = u " rad " ]
99
99
end
100
100
@equations begin
101
101
tau ~ c * (phi_rel - phi_rel0)
@@ -129,7 +129,7 @@ Linear 1D rotational damper
129
129
@symcheck d > 0 || throw (ArgumentError (" Expected `d` to be positive" ))
130
130
end
131
131
@parameters begin
132
- d, [description = " Damping constant" ]
132
+ d, [description = " Damping constant" , unit = u " N*m*s*rad^-1 " ]
133
133
end
134
134
@equations begin
135
135
tau ~ d * w_rel
@@ -159,10 +159,10 @@ Linear 1D rotational spring and damper
159
159
- `phi_rel0`: [`rad`] Unstretched spring angle
160
160
"""
161
161
@mtkmodel SpringDamper begin
162
- @extend phi_rel, w_rel, tau = partial_comp = PartialCompliantWithRelativeStates ()
162
+ @extend phi_rel, w_rel, a_rel, tau = partial_comp = PartialCompliantWithRelativeStates ()
163
163
@variables begin
164
- tau_c (t), [description = " Spring torque" ]
165
- tau_d (t), [description = " Damper torque" ]
164
+ tau_c (t), [description = " Spring torque" , unit = u " N*m " ]
165
+ tau_d (t), [description = " Damper torque" , unit = u " N*m " ]
166
166
end
167
167
@parameters begin
168
168
d, [description = " Damping constant" ]
@@ -206,8 +206,14 @@ This element characterizes any type of gear box which is fixed in the ground and
206
206
ratio, [description = " Transmission ratio" ]
207
207
end
208
208
@variables begin
209
- phi_a (t) = 0.0 , [description = " Relative angle between shaft a and the support" ]
210
- phi_b (t) = 0.0 , [description = " Relative angle between shaft b and the support" ]
209
+ function phi_a (t)
210
+ 0.0 ,
211
+ [description = " Relative angle between shaft a and the support" , unit = u " rad" ]
212
+ end
213
+ function phi_b (t)
214
+ 0.0 ,
215
+ [description = " Relative angle between shaft b and the support" , unit = u " rad" ]
216
+ end
211
217
end
212
218
@equations begin
213
219
phi_a ~ flange_a. phi - phi_support
@@ -245,14 +251,13 @@ Friction model: "Armstrong, B. and C.C. de Wit, Friction Modeling and Compensati
245
251
- `tau_brk`: [`N⋅m`] Breakaway friction torque
246
252
"""
247
253
@mtkmodel RotationalFriction begin
248
- @extend w_rel, tau = partial_comp = PartialCompliantWithRelativeStates ()
254
+ @extend phi_rel, w_rel, a_rel , tau = partial_comp = PartialCompliantWithRelativeStates ()
249
255
@parameters begin
250
- f, [description = " Viscous friction coefficient" ]
251
- tau_c, [description = " Coulomb friction torque" ]
252
- w_brk, [description = " Breakaway friction velocity" ]
253
- tau_brk, [description = " Breakaway friction torque" ]
256
+ f, [description = " Viscous friction coefficient" , unit = u " N*m*s/rad " ]
257
+ tau_c, [description = " Coulomb friction torque" , unit = u " N*m " ]
258
+ w_brk, [description = " Breakaway friction velocity" , unit = u " rad*s^-1 " ]
259
+ tau_brk, [description = " Breakaway friction torque" , unit = " N*m " ]
254
260
end
255
-
256
261
begin
257
262
str_scale = sqrt (2 * exp (1 )) * (tau_brk - tau_c)
258
263
w_st = w_brk * sqrt (2 )
0 commit comments