Skip to content

Commit e44297f

Browse files
committed
bench: CSTR study with some plant-model mismatch
1 parent 5055741 commit e44297f

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

benchmark/3_bench_predictive_control.jl

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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]) ]
8585
uop, yop = [20, 20], [50, 30]
8686
model = 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
8789
function 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

136138
samples, evals = 500, 1
137139
CASE_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
)
141143
CASE_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
)
145147
CASE_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
)
149151
CASE_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
)
153155
CASE_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

210212
samples, evals = 500, 1
211213
CASE_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
)
215217
CASE_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
)
219221
CASE_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
)
223225
CASE_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
)
227229
CASE_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

Comments
 (0)