@@ -40,7 +40,7 @@ Body component with mass and inertia
4040
4141# Parameters:
4242- `m`: [kg] mass of the body
43- - `j `: [kg.m²] inertia of the body with respect to the origin of `frame` along the z-axis of `frame`
43+ - `I `: [kg.m²] inertia of the body with respect to the origin of `frame` along the z-axis of `frame`
4444- `r`: [m, m] Translational position x,y-position
4545- `gy`: [m/s²] gravity field acting on the mass in the y-direction, positive value acts in the positive direction defaults to -9.807
4646- `radius`: [m] Radius of the body in animations
@@ -71,13 +71,13 @@ Body component with mass and inertia
7171 end
7272
7373 vars = @variables begin
74- f (t)[1 : 2 ]
75- r (t)[1 : 2 ] = r
76- v (t)[1 : 2 ]
77- a (t)[1 : 2 ]
78- phi (t) = phi
79- ω (t)
80- α (t)
74+ f (t)[1 : 2 ], [description = " Force " ]
75+ ( r (t)[1 : 2 ] = r), [description = " x,y position " ]
76+ v (t)[1 : 2 ], [description = " x,y velocity " ]
77+ a (t)[1 : 2 ], [description = " x,y acceleration " ]
78+ ( phi (t) = phi), [description = " Rotation angle " ]
79+ ω (t), [description = " Angular velocity " ]
80+ α (t), [description = " Angular acceleration " ]
8181 end
8282
8383 eqs = [
@@ -92,7 +92,7 @@ Body component with mass and inertia
9292 # newton's law
9393 f .~ [frame. fx, frame. fy]
9494 f + [0 , m* gy] .~ m* a# ifelse(gy !== nothing, fy / m + gy, fy / m),
95- I * α ~ frame. j
95+ I * α ~ frame. tau
9696 ]
9797
9898 return compose (ODESystem (eqs, t, vars, pars; name),
@@ -183,7 +183,7 @@ A fixed translation between two components (rigid rod)
183183 # balancing force including lever principle
184184 frame_a. fx + frame_b. fx ~ 0
185185 frame_a. fy + frame_b. fy ~ 0
186- frame_a. j + frame_b. j + r0' * [frame_b. fy, - frame_b. fx] ~ 0
186+ frame_a. tau + frame_b. tau + r0' * [frame_b. fy, - frame_b. fx] ~ 0
187187 end
188188end
189189
@@ -248,8 +248,8 @@ Linear 2D translational spring
248248
249249 @equations begin
250250 phi_rel ~ frame_b. phi - frame_a. phi
251- frame_a. j ~ 0
252- frame_b. j ~ 0
251+ frame_a. tau ~ 0
252+ frame_b. tau ~ 0
253253 s_relx ~ frame_b. x - frame_a. x
254254 s_rely ~ frame_b. y - frame_a. y
255255 f_x ~ c_x * (s_relx - s_relx0)
@@ -313,10 +313,10 @@ Linear (velocity dependent) damper
313313 d0y ~ ifelse (l < s_small, r0[2 ], r0[2 ] / l)
314314 frame_a. fx ~ d0x * f
315315 frame_a. fy ~ d0y * f
316- frame_a. j ~ 0
316+ frame_a. tau ~ 0
317317 frame_a. fx + frame_b. fx ~ 0
318318 frame_a. fy + frame_b. fy ~ 0
319- frame_a. j + frame_b. j ~ 0
319+ frame_a. tau + frame_b. tau ~ 0
320320
321321 # lossPower ~ -f * v
322322 end
@@ -382,7 +382,7 @@ Linear 2D translational spring damper model
382382 phi_rel (t) = 0
383383 f_x (t)
384384 f_y (t)
385- j (t)
385+ tau (t)
386386 end
387387
388388 begin
@@ -399,9 +399,9 @@ Linear 2D translational spring damper model
399399 v_rely ~ D (s_rely)
400400 ω_rel ~ D (phi_rel)
401401
402- j ~ c_phi * (phi_rel - phi_rel0) + d_phi * ω_rel
403- frame_a. j ~ - j
404- frame_b. j ~ j
402+ tau ~ c_phi * (phi_rel - phi_rel0) + d_phi * ω_rel
403+ frame_a. tau ~ - tau
404+ frame_b. tau ~ tau
405405 f_x ~ c_x * (s_relx - s_relx0) + d_x * v_relx
406406 f_y ~ c_y * (s_rely - s_rely0) + d_y * v_rely
407407 frame_a. fx ~ - f_x
0 commit comments