@@ -84,6 +84,8 @@ G = [ tf(1.90, [18, 1]) tf(1.90, [18, 1]);
8484 tf (- 0.74 ,[8 , 1 ]) tf (0.74 , [8 , 1 ]) ]
8585uop, yop = [20 , 20 ], [50 , 30 ]
8686model = setop! (LinModel (G, 2.0 ); uop, yop)
87+ plant = setop! (LinModel (G, 2.0 ); uop, yop)
88+ plant. A[diagind (plant. A)] .- = 0.1 # plant-model mismatch
8789function test_mpc (mpc, plant)
8890 plant. x0 .= 0 ; y = plant ()
8991 initstate! (mpc, plant. uop, y)
@@ -135,23 +137,23 @@ JuMP.unset_time_limit_sec(mpc_ipopt_ms.optim)
135137
136138samples, evals = 500 , 1
137139CASE_MPC[" CSTR" ][" LinMPC" ][" Without feedforward" ][" OSQP" ][" SingleShooting" ] =
138- @benchmarkable (test_mpc ($ mpc_osqp_ss, $ model );
140+ @benchmarkable (test_mpc ($ mpc_osqp_ss, $ plant );
139141 samples= samples, evals= evals
140142 )
141143CASE_MPC[" CSTR" ][" LinMPC" ][" Without feedforward" ][" OSQP" ][" MultipleShooting" ] =
142- @benchmarkable (test_mpc ($ mpc_osqp_ms, $ model );
144+ @benchmarkable (test_mpc ($ mpc_osqp_ms, $ plant );
143145 samples= samples, evals= evals
144146 )
145147CASE_MPC[" CSTR" ][" LinMPC" ][" Without feedforward" ][" DAQP" ][" SingleShooting" ] =
146- @benchmarkable (test_mpc ($ mpc_daqp_ss, $ model );
148+ @benchmarkable (test_mpc ($ mpc_daqp_ss, $ plant );
147149 samples= samples, evals= evals
148150 )
149151CASE_MPC[" CSTR" ][" LinMPC" ][" Without feedforward" ][" Ipopt" ][" SingleShooting" ] =
150- @benchmarkable (test_mpc ($ mpc_ipopt_ss, $ model );
152+ @benchmarkable (test_mpc ($ mpc_ipopt_ss, $ plant );
151153 samples= samples, evals= evals
152154)
153155CASE_MPC[" CSTR" ][" LinMPC" ][" Without feedforward" ][" Ipopt" ][" MultipleShooting" ] =
154- @benchmarkable (test_mpc ($ mpc_ipopt_ms, $ model );
156+ @benchmarkable (test_mpc ($ mpc_ipopt_ms, $ plant );
155157 samples= samples, evals= evals
156158 )
157159
@@ -209,23 +211,23 @@ JuMP.unset_time_limit_sec(mpc_d_ipopt_ms.optim)
209211
210212samples, evals = 500 , 1
211213CASE_MPC[" CSTR" ][" LinMPC" ][" With feedforward" ][" OSQP" ][" SingleShooting" ] =
212- @benchmarkable (test_mpc_d ($ mpc_d_osqp_ss, $ model );
214+ @benchmarkable (test_mpc_d ($ mpc_d_osqp_ss, $ plant );
213215 samples= samples, evals= evals
214216 )
215217CASE_MPC[" CSTR" ][" LinMPC" ][" With feedforward" ][" OSQP" ][" MultipleShooting" ] =
216- @benchmarkable (test_mpc_d ($ mpc_d_osqp_ms, $ model );
218+ @benchmarkable (test_mpc_d ($ mpc_d_osqp_ms, $ plant );
217219 samples= samples, evals= evals
218220 )
219221CASE_MPC[" CSTR" ][" LinMPC" ][" With feedforward" ][" DAQP" ][" SingleShooting" ] =
220- @benchmarkable (test_mpc_d ($ mpc_d_daqp_ss, $ model );
222+ @benchmarkable (test_mpc_d ($ mpc_d_daqp_ss, $ plant );
221223 samples= samples, evals= evals
222224 )
223225CASE_MPC[" CSTR" ][" LinMPC" ][" With feedforward" ][" Ipopt" ][" SingleShooting" ] =
224- @benchmarkable (test_mpc_d ($ mpc_d_ipopt_ss, $ model );
226+ @benchmarkable (test_mpc_d ($ mpc_d_ipopt_ss, $ plant );
225227 samples= samples, evals= evals
226228 )
227229CASE_MPC[" CSTR" ][" LinMPC" ][" With feedforward" ][" Ipopt" ][" MultipleShooting" ] =
228- @benchmarkable (test_mpc_d ($ mpc_d_ipopt_ms, $ model );
230+ @benchmarkable (test_mpc_d ($ mpc_d_ipopt_ms, $ plant );
229231 samples= samples, evals= evals
230232 )
231233
0 commit comments