@@ -108,6 +108,25 @@ syss = structural_simplify(sys2)
108
108
# @test isequal(unbound_outputs(syss), [y])
109
109
@test isequal (bound_outputs (syss), [sys. y])
110
110
111
+ using ModelingToolkitStandardLibrary
112
+ using ModelingToolkitStandardLibrary. Mechanical. Rotational
113
+ t = ModelingToolkitStandardLibrary. Mechanical. Rotational. t
114
+ @named inertia1 = Inertia (; J = 1 )
115
+ @named inertia2 = Inertia (; J = 1 )
116
+ @named spring = Spring (; c = 10 )
117
+ @named damper = Damper (; d = 3 )
118
+ @named torque = Torque ()
119
+ eqs = [
120
+ connect (torque. flange, inertia1. flange_a)
121
+ connect (inertia1. flange_b, spring. flange_a, damper. flange_a)
122
+ connect (inertia2. flange_a, spring. flange_b, damper. flange_b)
123
+ ]
124
+ model = ODESystem (eqs, t; systems = [torque, inertia1, inertia2, spring, damper], name= :name )
125
+ model_outputs = [inertia1. w, inertia2. w, inertia1. phi, inertia2. phi]
126
+ model_inputs = [torque. tau. u]
127
+ matrices, ssys = linearize (model, model_inputs, model_outputs)
128
+ @test length (ModelingToolkit. outputs (ssys)) == 4
129
+
111
130
# # Code generation with unbound inputs
112
131
113
132
@variables t x (t)= 0 u (t)= 0 [input = true ]
0 commit comments