@@ -13,15 +13,15 @@ Flange fixed in housing at a given position.
13
13
"""
14
14
@mtkmodel Fixed begin
15
15
@parameters begin
16
- s0
16
+ s0
17
17
end
18
18
19
19
@components begin
20
- flange = Flange (; s = 0.0 )
20
+ flange = Flange (; s = 0.0 )
21
21
end
22
22
23
23
@equations begin
24
- flange. s ~ s0
24
+ flange. s ~ s0
25
25
end
26
26
end
27
27
@@ -45,12 +45,12 @@ Sliding mass with inertia
45
45
"""
46
46
@mtkmodel Mass begin
47
47
@parameters begin
48
- m = 0.0 , [description = " Mass of sliding mass [kg]" ]
48
+ m = 0.0 , [description = " Mass of sliding mass [kg]" ]
49
49
end
50
50
@variables begin
51
- s
52
- v (t) = 0.0 , [description = " Absolute linear velocity of sliding mass [m/s]" ]
53
- a (t) = 0.0 , [description = " Absolute linear acceleration of sliding mass [m/s^2]" ]
51
+ s
52
+ v (t) = 0.0 , [description = " Absolute linear velocity of sliding mass [m/s]" ]
53
+ a (t) = 0.0 , [description = " Absolute linear acceleration of sliding mass [m/s^2]" ]
54
54
end
55
55
@extend flange_a, flange_b, s = pr = PartialRigid (; L = 0.0 , s = s)
56
56
@equations begin
@@ -78,12 +78,12 @@ Linear 1D translational spring
78
78
@mtkmodel Spring begin
79
79
@extend flange_a, flange_b, s_rel, f = pc = PartialCompliant ()
80
80
@parameters begin
81
- c = 0.0 , [description = " Spring constant [N/m]" ]
82
- s_rel0 = 0.0 , [description = " Unstretched spring length [m]" ]
81
+ c = 0.0 , [description = " Spring constant [N/m]" ]
82
+ s_rel0 = 0.0 , [description = " Unstretched spring length [m]" ]
83
83
end
84
84
85
85
@equations begin
86
- f ~ c * (s_rel - s_rel0)
86
+ f ~ c * (s_rel - s_rel0)
87
87
end
88
88
end
89
89
@@ -104,13 +104,13 @@ Linear 1D translational damper
104
104
@mtkmodel Damper begin
105
105
@extend flange_a, flange_b, v_rel, f = pc = PartialCompliantWithRelativeStates ()
106
106
@parameters begin
107
- d = 0.0 , [description = " Damping constant [Ns/m]" ]
107
+ d = 0.0 , [description = " Damping constant [Ns/m]" ]
108
108
end
109
109
@variables begin
110
- lossPower (t) = 0.0 , [description = " Power dissipated by the damper [W]" ]
110
+ lossPower (t) = 0.0 , [description = " Power dissipated by the damper [W]" ]
111
111
end
112
112
@equations begin
113
- f ~ d * v_rel
114
- lossPower ~ f * v_rel
113
+ f ~ d * v_rel
114
+ lossPower ~ f * v_rel
115
115
end
116
116
end
0 commit comments