@@ -162,7 +162,13 @@ if @isdefined(ModelingToolkit)
162162 @named d = Step (start_time = 1.0 , duration = 10.0 , offset = 0.0 , height = 1.0 ) # Disturbance
163163 model_outputs = [model. inertia1. w, model. inertia2. w, model. inertia1. phi, model. inertia2. phi] # This is the state realization we want to control
164164 inputs = [model. torque. tau. u]
165- op = [model. torque. tau. u => 0.0 ]
165+ op = [
166+ model. inertia1. w => 1.0
167+ model. inertia2. w => 1.0
168+ model. inertia1. phi => 1.0
169+ model. inertia2. phi => 1.0
170+ model. torque. tau. u => 0.0
171+ ]
166172 matrices, ssys = ModelingToolkit. linearize (
167173 wr (model), inputs, model_outputs; op,
168174 guesses = [model. inertia2. flange_a. phi => 0.0 , model. inertia1. flange_b. phi => 0.0 ]
@@ -197,7 +203,7 @@ if @isdefined(ModelingToolkit)
197203 connect (add. output, :u , model. torque. tau)
198204 ]
199205 @named closed_loop = System (connections, t, systems = [model, state_feedback, add, d])
200- S = get_sensitivity (closed_loop, :u )
206+ S = get_sensitivity (closed_loop, :u ; op = x_costs )
201207end
202208
203209@testset " Indexing MTKParameters with ParameterIndex" begin
0 commit comments