@@ -130,15 +130,15 @@ prob = ODEProblem(ssys, Pair[], (0, 10))
130130#  sol = solve(prob, Rodas5())
131131#  plot(sol)
132132
133- matrices, _ =  get_sensitivity (sys_outer, :inner_plant_input )
133+ matrices, _ =  get_sensitivity (sys_outer, sys_outer . inner . plant_input )
134134
135135using  ControlSystemsBase #  This is required to simplify the results to test against known solution
136136lsys =  sminreal (ss (matrices... ))
137137@test  lsys. A[] ==  - 2 
138138@test  lsys. B[] *  lsys. C[] ==  - 1  #  either one negative
139139@test  lsys. D[] ==  1 
140140
141- matrices_So, _ =  get_sensitivity (sys_outer, :inner_plant_output )
141+ matrices_So, _ =  get_sensitivity (sys_outer, sys_outer . inner . plant_output )
142142lsyso =  sminreal (ss (matrices_So... ))
143143@test  lsys ==  lsyso ||  lsys ==  - 1  *  lsyso *  (- 1 ) #  Output and input sensitivities are equal for SISO systems
144144
@@ -241,7 +241,6 @@ Si = ss(matrices...)
241241    t,
242242    systems =  [P_inner, feedback, ref])
243243
244- @test_nowarn  Blocks. find_analysis_points (sys_inner)
245244P_not_broken, _ =  linearize (sys_inner, :u , :y )
246245@test  P_not_broken. A[] ==  - 2 
247246P_broken, _ =  linearize (sys_inner, :u , :y , loop_openings =  [:u ])
@@ -265,9 +264,9 @@ Sinner = sminreal(ss(get_sensitivity(sys_inner, :u)[1]...))
265264    t,
266265    systems =  [P_outer, sys_inner])
267266
268- Souter =  sminreal (ss (get_sensitivity (sys_outer, :sys_inner_u )[1 ]. .. ))
267+ Souter =  sminreal (ss (get_sensitivity (sys_outer, sys_outer . sys_inner . u )[1 ]. .. ))
269268
270- Sinner2 =  sminreal (ss (get_sensitivity (sys_outer, :sys_inner_u , loop_openings =  [:y2 ])[1 ]. .. ))
269+ Sinner2 =  sminreal (ss (get_sensitivity (sys_outer, sys_outer . sys_inner . u , loop_openings =  [:y2 ])[1 ]. .. ))
271270
272271@test  Sinner. nx ==  1 
273272@test  Sinner ==  Sinner2
@@ -333,7 +332,7 @@ eqs = [connect(r.output, F.input)
333332       connect (F. output, sys_inner. add. input1)]
334333sys_outer =  ODESystem (eqs, t, systems =  [F, sys_inner, r], name =  :outer )
335334
336- matrices, _ =  get_sensitivity (sys_outer, [:inner_plant_input ,  :inner_plant_output ])
335+ matrices, _ =  get_sensitivity (sys_outer, [sys_outer . inner . plant_input, sys_outer . inner . plant_output ])
337336
338337Ps =  tf (1 , [1 , 1 ]) |>  ss
339338Cs =  tf (1 ) |>  ss
@@ -347,7 +346,7 @@ So = CS.feedback(1, Ps * Cs)
347346@test  tf (G[1 , 2 ]) ≈  tf (- CS. feedback (Cs, Ps))
348347@test  tf (G[2 , 1 ]) ≈  tf (CS. feedback (Ps, Cs))
349348
350- matrices, _ =  get_comp_sensitivity (sys_outer, [:inner_plant_input ,  :inner_plant_output ])
349+ matrices, _ =  get_comp_sensitivity (sys_outer, [sys_outer . inner . plant_input, sys_outer . inner . plant_output ])
351350
352351G =  CS. ss (matrices... ) |>  sminreal
353352Ti =  CS. feedback (Cs *  Ps)
@@ -360,23 +359,23 @@ To = CS.feedback(Ps * Cs)
360359
361360#  matrices, _ = get_looptransfer(sys_outer, [:inner_plant_input, :inner_plant_output])
362361matrices, _ =  get_looptransfer (
363-     sys_outer, :inner_plant_input )
362+     sys_outer, sys_outer . inner . plant_input )
364363L =  CS. ss (matrices... ) |>  sminreal
365364@test  tf (L) ≈  - tf (Cs *  Ps)
366365
367366matrices, _ =  get_looptransfer (
368-     sys_outer, :inner_plant_output )
367+     sys_outer, sys_outer . inner . plant_output )
369368L =  CS. ss (matrices... ) |>  sminreal
370369@test  tf (L[1 , 1 ]) ≈  - tf (Ps *  Cs)
371370
372371#  Calling looptransfer like below is not the intended way, but we can work out what it should return if we did so it remains a valid test
373- matrices, _ =  get_looptransfer (sys_outer, [:inner_plant_input ,  :inner_plant_output ])
372+ matrices, _ =  get_looptransfer (sys_outer, [sys_outer . inner . plant_input, sys_outer . inner . plant_output ])
374373L =  CS. ss (matrices... ) |>  sminreal
375374@test  tf (L[1 , 1 ]) ≈  tf (0 )
376375@test  tf (L[2 , 2 ]) ≈  tf (0 )
377376@test  sminreal (L[1 , 2 ]) ≈  ss (- 1 )
378377@test  tf (L[2 , 1 ]) ≈  tf (Ps)
379378
380- matrices, _ =  linearize (sys_outer, [:inner_plant_input ], [:inner_plant_output ])
379+ matrices, _ =  linearize (sys_outer, [sys_outer . inner . plant_input ], [sys_outer . inner . plant_output ])
381380G =  CS. ss (matrices... ) |>  sminreal
382381@test  tf (G) ≈  tf (CS. feedback (Ps, Cs))
0 commit comments