Skip to content

Commit cd18b83

Browse files
authored
Merge pull request #225 from JuliaControl/bench_cont_2
bench: minor modification
2 parents 11ea3df + e77e930 commit cd18b83

File tree

5 files changed

+145
-64
lines changed

5 files changed

+145
-64
lines changed

benchmark/0_bench_setup.jl

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,28 @@ end
1515
linmodel = setop!(LinModel(sys, Ts, i_d=[3]), uop=[10, 50], yop=[50, 30], dop=[5])
1616
nonlinmodel = NonLinModel(f_lin!, h_lin!, Ts, 2, 4, 2, 1, p=linmodel, solver=nothing)
1717
nonlinmodel = setop!(nonlinmodel, uop=[10, 50], yop=[50, 30], dop=[5])
18-
u, d, y = [10, 50], [5], [50, 30]
18+
u, d, y = [10, 50], [5], [50, 30]
19+
20+
G = [ tf(1.90, [18, 1]) tf(1.90, [18, 1]);
21+
tf(-0.74,[8, 1]) tf(0.74, [8, 1]) ]
22+
uop, yop, dop = [20, 20], [50, 30], [20]
23+
CSTR_model = setop!(LinModel(G, 2.0); uop, yop)
24+
CSTR_model_d = setop!(LinModel([G G[1:2, 2]], 2.0; i_d=[3]); uop, yop, dop)
25+
26+
function f!(ẋ, x, u, _ , p)
27+
g, L, K, m = p
28+
θ, ω = x[1], x[2]
29+
τ = u[1]
30+
ẋ[1] = ω
31+
ẋ[2] = -g/L*sin(θ) - K/m*ω + τ/m/L^2
32+
end
33+
h!(y, x, _ , _ ) = (y[1] = 180/π*x[1])
34+
p = [9.8, 0.4, 1.2, 0.3]
35+
nu = 1; nx = 2; ny = 1; Ts = 0.1
36+
pendulum_model = NonLinModel(f!, h!, Ts, nu, nx, ny; p)
37+
pendulum_p = p
38+
39+
h2!(y, x, _ , _ ) = (y[1] = 180/π*x[1]; y[2]=x[2])
40+
nu, nx, ny = 1, 2, 2
41+
pendulum_model2 = NonLinModel(f!, h2!, Ts, nu, nx, ny; p)
42+
pendulum_p2 = p

benchmark/1_bench_sim_model.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
## ----------------- Unit tests ----------------------------------------------------------
2-
const UNIT_MODEL = SUITE["unit tests"]["SimModel"]
1+
## ----------------------------------------------------------------------------------------
2+
## ----------------- UNIT TESTS ----------------------------------------------------------
3+
## ----------------------------------------------------------------------------------------
4+
const UNIT_MODEL = SUITE["UNIT TESTS"]["SimModel"]
35

46
UNIT_MODEL["LinModel"]["updatestate!"] =
57
@benchmarkable(
@@ -22,6 +24,8 @@ UNIT_MODEL["NonLinModel"]["linearize!"] =
2224
linearize!($linmodel, $nonlinmodel);
2325
)
2426

25-
## ----------------- Case studies ---------------------------------------------------------
26-
const CASE_MODEL = SUITE["case studies"]["SimModel"]
27+
## ----------------------------------------------------------------------------------------
28+
## ----------------- CASE STUDIES ---------------------------------------------------------
29+
## ----------------------------------------------------------------------------------------
30+
const CASE_MODEL = SUITE["CASE STUDIES"]["SimModel"]
2731
# TODO: Add case study benchmarks for SimModel

benchmark/2_bench_state_estim.jl

Lines changed: 84 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
## ----------------- Unit tests -----------------------------------------------------------
2-
const UNIT_ESTIM = SUITE["unit tests"]["StateEstimator"]
1+
## ----------------------------------------------------------------------------------------
2+
## ----------------- UNIT TESTS -----------------------------------------------------------
3+
## ----------------------------------------------------------------------------------------
4+
const UNIT_ESTIM = SUITE["UNIT TESTS"]["StateEstimator"]
35

46
skf = SteadyKalmanFilter(linmodel)
57
UNIT_ESTIM["SteadyKalmanFilter"]["preparestate!"] =
@@ -193,18 +195,17 @@ UNIT_ESTIM["MovingHorizonEstimator"]["updatestate!"]["NonLinModel"]["Prediction
193195
samples=samples, evals=evals, seconds=seconds,
194196
)
195197

196-
## ----------------- Case studies ---------------------------------------------------
197-
const CASE_ESTIM = SUITE["case studies"]["StateEstimator"]
198+
## ----------------------------------------------------------------------------------------
199+
## ----------------- CASE STUDIES ---------------------------------------------------------
200+
## ----------------------------------------------------------------------------------------
201+
const CASE_ESTIM = SUITE["CASE STUDIES"]["StateEstimator"]
198202

199203
## ----------------- Case study: CSTR -----------------------------------------------------
200-
G = [ tf(1.90, [18, 1]) tf(1.90, [18, 1]);
201-
tf(-0.74,[8, 1]) tf(0.74, [8, 1]) ]
202-
uop, yop = [20, 20], [50, 30]
203-
model = setop!(LinModel(G, 2.0); uop, yop)
204-
plant = setop!(LinModel(G, 2.0); uop, yop)
204+
model = CSTR_model
205+
plant = deepcopy(model)
205206
plant.A[diagind(plant.A)] .-= 0.1 # plant-model mismatch
206207
function test_mhe(mhe, plant)
207-
plant.x0 .= 0; y = plant()
208+
plant.x0 .= 0.1; y = plant()
208209
initstate!(mhe, plant.uop, y)
209210
N = 75; u = [20, 20]; ul = 0
210211
U, Y, Ŷ = zeros(2, N), zeros(2, N), zeros(2, N)
@@ -220,45 +221,46 @@ function test_mhe(mhe, plant)
220221
end
221222
return U, Y, Ŷ
222223
end
223-
He = 10; nint_u = [1, 1]; σQint_u = [1, 2]
224+
He = 4; nint_u = [1, 1]; σQint_u = [1, 2]
225+
v̂min, v̂max = [-1, -0.5], [+1, +0.5]
224226

225227
optim = JuMP.Model(OSQP.Optimizer, add_bridges=false)
226228
direct = true
227229
mhe_cstr_osqp_curr = MovingHorizonEstimator(model; He, nint_u, σQint_u, optim, direct)
228-
mhe_cstr_osqp_curr = setconstraint!(mhe_cstr_osqp_curr, v̂min=[-1, -0.5], v̂max=[+1, +0.5])
230+
mhe_cstr_osqp_curr = setconstraint!(mhe_cstr_osqp_curr; v̂min, v̂max)
229231
JuMP.unset_time_limit_sec(mhe_cstr_osqp_curr.optim)
230232

231233
optim = JuMP.Model(OSQP.Optimizer, add_bridges=false)
232234
direct = false
233235
mhe_cstr_osqp_pred = MovingHorizonEstimator(model; He, nint_u, σQint_u, optim, direct)
234-
mhe_cstr_osqp_pred = setconstraint!(mhe_cstr_osqp_pred, v̂min=[-1, -0.5], v̂max=[+1, +0.5])
236+
mhe_cstr_osqp_pred = setconstraint!(mhe_cstr_osqp_pred; v̂min, v̂max)
235237
JuMP.unset_time_limit_sec(mhe_cstr_osqp_pred.optim)
236238

237239
optim = JuMP.Model(DAQP.Optimizer, add_bridges=false)
238240
direct = true
239241
mhe_cstr_daqp_curr = MovingHorizonEstimator(model; He, nint_u, σQint_u, optim, direct)
240-
mhe_cstr_daqp_curr = setconstraint!(mhe_cstr_daqp_curr, v̂min=[-1, -0.5], v̂max=[+1, +0.5])
242+
mhe_cstr_daqp_curr = setconstraint!(mhe_cstr_daqp_curr; v̂min, v̂max)
241243
JuMP.set_attribute(mhe_cstr_daqp_curr.optim, "eps_prox", 1e-6) # needed to support hessians H≥0
242244

243245
optim = JuMP.Model(DAQP.Optimizer, add_bridges=false)
244246
direct = false
245247
mhe_cstr_daqp_pred = MovingHorizonEstimator(model; He, nint_u, σQint_u, optim, direct)
246-
mhe_cstr_daqp_pred = setconstraint!(mhe_cstr_daqp_pred, v̂min=[-1, -0.5], v̂max=[+1, +0.5])
248+
mhe_cstr_daqp_pred = setconstraint!(mhe_cstr_daqp_pred; v̂min, v̂max)
247249
JuMP.set_attribute(mhe_cstr_daqp_pred.optim, "eps_prox", 1e-6) # needed to support hessians H≥0
248250

249251
optim = JuMP.Model(optimizer_with_attributes(Ipopt.Optimizer,"sb"=>"yes"), add_bridges=false)
250252
direct = true
251253
mhe_cstr_ipopt_curr = MovingHorizonEstimator(model; He, nint_u, σQint_u, optim, direct)
252-
mhe_cstr_ipopt_curr = setconstraint!(mhe_cstr_ipopt_curr, v̂min=[-1, -0.5], v̂max=[+1, +0.5])
254+
mhe_cstr_ipopt_curr = setconstraint!(mhe_cstr_ipopt_curr; v̂min, v̂max)
253255
JuMP.unset_time_limit_sec(mhe_cstr_ipopt_curr.optim)
254256

255257
optim = JuMP.Model(optimizer_with_attributes(Ipopt.Optimizer,"sb"=>"yes"), add_bridges=false)
256258
direct = false
257259
mhe_cstr_ipopt_pred = MovingHorizonEstimator(model; He, nint_u, σQint_u, optim, direct)
258-
mhe_cstr_ipopt_pred = setconstraint!(mhe_cstr_ipopt_pred, v̂min=[-1, -0.5], v̂max=[+1, +0.5])
260+
mhe_cstr_ipopt_pred = setconstraint!(mhe_cstr_ipopt_pred; v̂min, v̂max)
259261
JuMP.unset_time_limit_sec(mhe_cstr_ipopt_pred.optim)
260262

261-
samples, evals = 500, 1
263+
samples, evals = 5000, 1
262264
CASE_ESTIM["CSTR"]["MovingHorizonEstimator"]["OSQP"]["Current form"] =
263265
@benchmarkable(test_mhe($mhe_cstr_osqp_curr, $plant);
264266
samples=samples, evals=evals
@@ -282,4 +284,68 @@ CASE_ESTIM["CSTR"]["MovingHorizonEstimator"]["Ipopt"]["Current form"] =
282284
CASE_ESTIM["CSTR"]["MovingHorizonEstimator"]["Ipopt"]["Prediction form"] =
283285
@benchmarkable(test_mhe($mhe_cstr_ipopt_pred, $plant);
284286
samples=samples, evals=evals
287+
)
288+
289+
## ---------------------- Case study: pendulum -------------------------------------------
290+
model, p = pendulum_model, pendulum_p
291+
plant = deepcopy(model)
292+
plant.p[3] = 1.25*p[3] # plant-model mismatch
293+
σQ = [0.1, 1.0]; σR=[5.0]; nint_u=[1]; σQint_u=[0.1]
294+
He = 3; v̂min, v̂max = [-5.0], [+5.0]
295+
N = 35;
296+
297+
x_0 = [0.1, 0.1]; x̂_0 = [0, 0, 0]; u = [0.5]
298+
299+
optim = JuMP.Model(optimizer_with_attributes(Ipopt.Optimizer,"sb"=>"yes"), add_bridges=false)
300+
direct = true
301+
mhe_pendulum_ipopt_curr = MovingHorizonEstimator(
302+
model; He, σQ, σR, nint_u, σQint_u, optim, direct
303+
)
304+
mhe_pendulum_ipopt_curr = setconstraint!(mhe_pendulum_ipopt_curr; v̂min, v̂max)
305+
JuMP.unset_time_limit_sec(mhe_pendulum_ipopt_curr.optim)
306+
307+
optim = JuMP.Model(optimizer_with_attributes(Ipopt.Optimizer,"sb"=>"yes"), add_bridges=false)
308+
direct = false
309+
mhe_pendulum_ipopt_pred = MovingHorizonEstimator(
310+
model; He, σQ, σR, nint_u, σQint_u, optim, direct
311+
)
312+
mhe_pendulum_ipopt_pred = setconstraint!(mhe_pendulum_ipopt_pred; v̂min, v̂max)
313+
JuMP.unset_time_limit_sec(mhe_pendulum_ipopt_pred.optim)
314+
315+
optim = JuMP.Model(MadNLP.Optimizer, add_bridges=false)
316+
direct = true
317+
mhe_pendulum_madnlp_curr = MovingHorizonEstimator(
318+
model; He, σQ, σR, nint_u, σQint_u, optim, direct
319+
)
320+
mhe_pendulum_madnlp_curr = setconstraint!(mhe_pendulum_madnlp_curr; v̂min, v̂max)
321+
JuMP.unset_time_limit_sec(mhe_pendulum_madnlp_curr.optim)
322+
323+
optim = JuMP.Model(MadNLP.Optimizer, add_bridges=false)
324+
direct = false
325+
mhe_pendulum_madnlp_pred = MovingHorizonEstimator(
326+
model; He, σQ, σR, nint_u, σQint_u, optim, direct
327+
)
328+
mhe_pendulum_madnlp_pred = setconstraint!(mhe_pendulum_madnlp_pred; v̂min, v̂max)
329+
JuMP.unset_time_limit_sec(mhe_pendulum_madnlp_pred.optim)
330+
331+
samples, evals, seconds = 10, 1, 15*60
332+
CASE_ESTIM["Pendulum"]["MovingHorizonEstimator"]["Ipopt"]["Current form"] =
333+
@benchmarkable(
334+
sim!($mhe_pendulum_ipopt_curr, $N, $u; plant=$plant, x_0=$x_0, x̂_0=$x̂_0),
335+
samples=samples, evals=evals, seconds=seconds
336+
)
337+
CASE_ESTIM["Pendulum"]["MovingHorizonEstimator"]["Ipopt"]["Prediction form"] =
338+
@benchmarkable(
339+
sim!($mhe_pendulum_ipopt_pred, $N, $u; plant=$plant, x_0=$x_0, x̂_0=$x̂_0),
340+
samples=samples, evals=evals, seconds=seconds
341+
)
342+
CASE_ESTIM["Pendulum"]["MovingHorizonEstimator"]["MadNLP"]["Current form"] =
343+
@benchmarkable(
344+
sim!($mhe_pendulum_madnlp_curr, $N, $u; plant=$plant, x_0=$x_0, x̂_0=$x̂_0),
345+
samples=samples, evals=evals, seconds=seconds
346+
)
347+
CASE_ESTIM["Pendulum"]["MovingHorizonEstimator"]["MadNLP"]["Prediction form"] =
348+
@benchmarkable(
349+
sim!($mhe_pendulum_madnlp_pred, $N, $u; plant=$plant, x_0=$x_0, x̂_0=$x̂_0),
350+
samples=samples, evals=evals, seconds=seconds
285351
)

benchmark/3_bench_predictive_control.jl

Lines changed: 26 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# ---------------------- Unit tests -------------------------------------------------------
2-
const UNIT_MPC = SUITE["unit tests"]["PredictiveController"]
1+
# -----------------------------------------------------------------------------------------
2+
# ---------------------- UNIT TESTS -------------------------------------------------------
3+
# -----------------------------------------------------------------------------------------
4+
const UNIT_MPC = SUITE["UNIT TESTS"]["PredictiveController"]
35

46
linmpc_ss = LinMPC(
57
linmodel, transcription=SingleShooting(),
@@ -10,7 +12,7 @@ linmpc_ms = LinMPC(
1012
Mwt=[1, 1], Nwt=[0.1, 0.1], Lwt=[0.1, 0.1], Hp=10
1113
)
1214

13-
samples, evals, seconds = 500, 1, 60
15+
samples, evals, seconds = 5000, 1, 60
1416
UNIT_MPC["LinMPC"]["moveinput!"]["SingleShooting"] =
1517
@benchmarkable(
1618
moveinput!($linmpc_ss, $y, $d),
@@ -49,7 +51,7 @@ nmpc_nonlin_ms = NonLinMPC(
4951
Mwt=[1, 1], Nwt=[0.1, 0.1], Lwt=[0.1, 0.1], Hp=10
5052
)
5153

52-
samples, evals, seconds = 500, 1, 60
54+
samples, evals, seconds = 5000, 1, 60
5355
UNIT_MPC["NonLinMPC"]["moveinput!"]["LinModel"]["SingleShooting"] =
5456
@benchmarkable(
5557
moveinput!($nmpc_lin_ss, $y, $d),
@@ -75,16 +77,14 @@ UNIT_MPC["NonLinMPC"]["moveinput!"]["NonLinModel"]["MultipleShooting"] =
7577
samples=samples, evals=evals, seconds=seconds
7678
)
7779

80+
## ----------------------------------------------------------------------------------------
81+
## ---------------------- CASE STUDIES ----------------------------------------------------
82+
## ----------------------------------------------------------------------------------------
83+
const CASE_MPC = SUITE["CASE STUDIES"]["PredictiveController"]
7884

79-
## ---------------------- Case studies ----------------------------------------------------
80-
const CASE_MPC = SUITE["case studies"]["PredictiveController"]
81-
82-
## ----------------- Case study: CSTR without feedforward ------------------------
83-
G = [ tf(1.90, [18, 1]) tf(1.90, [18, 1]);
84-
tf(-0.74,[8, 1]) tf(0.74, [8, 1]) ]
85-
uop, yop = [20, 20], [50, 30]
86-
model = setop!(LinModel(G, 2.0); uop, yop)
87-
plant = setop!(LinModel(G, 2.0); uop, yop)
85+
## ----------------- Case study: CSTR without feedforward ---------------------------------
86+
model = CSTR_model
87+
plant = deepcopy(model)
8888
plant.A[diagind(plant.A)] .-= 0.1 # plant-model mismatch
8989
function test_mpc(mpc, plant)
9090
plant.x0 .= 0; y = plant()
@@ -135,7 +135,7 @@ transcription = MultipleShooting()
135135
mpc_ipopt_ms = setconstraint!(LinMPC(model; optim, transcription), ymin=[45, -Inf])
136136
JuMP.unset_time_limit_sec(mpc_ipopt_ms.optim)
137137

138-
samples, evals = 500, 1
138+
samples, evals = 5000, 1
139139
CASE_MPC["CSTR"]["LinMPC"]["Without feedforward"]["OSQP"]["SingleShooting"] =
140140
@benchmarkable(test_mpc($mpc_osqp_ss, $plant);
141141
samples=samples, evals=evals
@@ -158,8 +158,7 @@ CASE_MPC["CSTR"]["LinMPC"]["Without feedforward"]["Ipopt"]["MultipleShooting"] =
158158
)
159159

160160
## ----------------- Case study: CSTR with feedforward -------------------------
161-
model_d = LinModel([G G[1:2, 2]], 2.0; i_d=[3])
162-
model_d = setop!(model_d; uop, yop, dop=[20])
161+
model_d = CSTR_model_d
163162
function test_mpc_d(mpc_d, plant)
164163
plant.x0 .= 0; y = plant(); d = [20]
165164
initstate!(mpc_d, plant.uop, y, d)
@@ -209,7 +208,7 @@ transcription = MultipleShooting()
209208
mpc_d_ipopt_ms = setconstraint!(LinMPC(model_d; optim, transcription), ymin=[45, -Inf])
210209
JuMP.unset_time_limit_sec(mpc_d_ipopt_ms.optim)
211210

212-
samples, evals = 500, 1
211+
samples, evals = 5000, 1
213212
CASE_MPC["CSTR"]["LinMPC"]["With feedforward"]["OSQP"]["SingleShooting"] =
214213
@benchmarkable(test_mpc_d($mpc_d_osqp_ss, $plant);
215214
samples=samples, evals=evals
@@ -233,21 +232,11 @@ CASE_MPC["CSTR"]["LinMPC"]["With feedforward"]["Ipopt"]["MultipleShooting"] =
233232

234233

235234
# ----------------- Case study: Pendulum noneconomic -----------------------------
236-
function f!(ẋ, x, u, _ , p)
237-
g, L, K, m = p # [m/s²], [m], [kg/s], [kg]
238-
θ, ω = x[1], x[2] # [rad], [rad/s]
239-
τ = u[1] # [Nm]
240-
ẋ[1] = ω
241-
ẋ[2] = -g/L*sin(θ) - K/m*ω + τ/m/L^2
242-
end
243-
h!(y, x, _ , _ ) = (y[1] = 180/π*x[1]) # [°]
244-
p = [9.8, 0.4, 1.2, 0.3]
245-
nu = 1; nx = 2; ny = 1; Ts = 0.1
246-
model = NonLinModel(f!, h!, Ts, nu, nx, ny; p)
235+
model, p = pendulum_model, pendulum_p
247236
σQ = [0.1, 1.0]; σR=[5.0]; nint_u=[1]; σQint_u=[0.1]
248237
estim = UnscentedKalmanFilter(model; σQ, σR, nint_u, σQint_u)
249-
p_plant = copy(p); p_plant[3] = 1.25*p[3]
250-
plant = NonLinModel(f!, h!, Ts, nu, nx, ny; p=p_plant)
238+
plant = deepcopy(model)
239+
plant.p[3] = 1.25*p[3] # plant-model mismatch
251240
N = 35; u = [0.5];
252241

253242
Hp, Hc, Mwt, Nwt, Cwt = 20, 2, [0.5], [2.5], Inf
@@ -285,7 +274,7 @@ JuMP.unset_time_limit_sec(nmpc_madnlp_ss.optim)
285274
# MadNLP_QNopt = MadNLP.QuasiNewtonOptions(; max_history=42)
286275
# JuMP.set_attribute(nmpc_madnlp_ms.optim, "quasi_newton_options", MadNLP_QNopt)
287276

288-
samples, evals, seconds = 50, 1, 15*60
277+
samples, evals, seconds = 100, 1, 15*60
289278
CASE_MPC["Pendulum"]["NonLinMPC"]["Noneconomic"]["Ipopt"]["SingleShooting"] =
290279
@benchmarkable(
291280
sim!($nmpc_ipopt_ss, $N, $ry; plant=$plant, x_0=$x_0, x̂_0=$x̂_0),
@@ -303,10 +292,9 @@ CASE_MPC["Pendulum"]["NonLinMPC"]["Noneconomic"]["MadNLP"]["SingleShooting"] =
303292
)
304293

305294
# ----------------- Case study: Pendulum economic --------------------------------
306-
h2!(y, x, _ , _ ) = (y[1] = 180/π*x[1]; y[2]=x[2])
307-
nu, nx, ny = 1, 2, 2
308-
model2 = NonLinModel(f!, h2!, Ts, nu, nx, ny; p)
309-
plant2 = NonLinModel(f!, h2!, Ts, nu, nx, ny; p=p_plant)
295+
model2, p = pendulum_model2, pendulum_p2
296+
plant2 = deepcopy(model2)
297+
plant2.p[3] = 1.25*p[3] # plant-model mismatch
310298
estim2 = UnscentedKalmanFilter(model2; σQ, σR, nint_u, σQint_u, i_ym=[1])
311299
function JE(UE, ŶE, _ , p)
312300
Ts = p
@@ -336,7 +324,7 @@ JuMP.unset_time_limit_sec(empc_madnlp_ss.optim)
336324

337325
# TODO: test EMPC with MadNLP and MultipleShooting, see comment above.
338326

339-
samples, evals, seconds = 50, 1, 15*60
327+
samples, evals, seconds = 100, 1, 15*60
340328
CASE_MPC["Pendulum"]["NonLinMPC"]["Economic"]["Ipopt"]["SingleShooting"] =
341329
@benchmarkable(
342330
sim!($empc_ipopt_ss, $N, $ry; plant=$plant2, x_0=$x_0, x̂_0=$x̂_0),
@@ -388,7 +376,7 @@ JuMP.unset_time_limit_sec(nmpc2_ipopt_ms.optim)
388376
# TODO: test custom constraints with MadNLP and SingleShooting, see comment above.
389377
# TODO: test custom constraints with MadNLP and MultipleShooting, see comment above.
390378

391-
samples, evals, seconds = 50, 1, 15*60
379+
samples, evals, seconds = 100, 1, 15*60
392380
CASE_MPC["Pendulum"]["NonLinMPC"]["Custom constraints"]["Ipopt"]["SingleShooting"] =
393381
@benchmarkable(
394382
sim!($nmpc2_ipopt_ss, $N, $ry; plant=$plant2, x_0=$x_0, x̂_0=$x̂_0),
@@ -458,7 +446,7 @@ mpc3_ipopt_ms = LinMPC(kf; Hp, Hc, Mwt, Nwt, Cwt, optim, transcription)
458446
mpc3_ipopt_ms = setconstraint!(mpc3_ipopt_ms; umin, umax)
459447
JuMP.unset_time_limit_sec(mpc3_ipopt_ms.optim)
460448

461-
samples, evals = 500, 1
449+
samples, evals = 5000, 1
462450
CASE_MPC["Pendulum"]["LinMPC"]["Successive linearization"]["OSQP"]["SingleShooting"] =
463451
@benchmarkable(
464452
sim2!($mpc3_osqp_ss, $model, $N, $ry, $plant, $x_0, $x̂_0, $y_step),

benchmark/benchmarks.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ using JuMP, OSQP, DAQP, Ipopt, MadNLP
44

55
const SUITE = BenchmarkGroup(["ModelPredictiveControl"])
66

7-
SUITE["unit tests"] = BenchmarkGroup(["allocation-free", "allocations", "single call"])
8-
SUITE["case studies"] = BenchmarkGroup(["performance", "speed" ,"integration"])
9-
7+
SUITE["UNIT TESTS"] = BenchmarkGroup(["allocation-free", "allocations", "single call"])
8+
SUITE["CASE STUDIES"] = BenchmarkGroup(["performance", "speed" ,"integration"])
109

1110
include("0_bench_setup.jl")
1211
include("1_bench_sim_model.jl")

0 commit comments

Comments
 (0)