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
46linmpc_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
1416UNIT_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
5355UNIT_MPC[" NonLinMPC" ][" moveinput!" ][" LinModel" ][" SingleShooting" ] =
5456 @benchmarkable (
5557 moveinput! ($ nmpc_lin_ss, $ y, $ d),
@@ -75,9 +77,10 @@ UNIT_MPC["NonLinMPC"]["moveinput!"]["NonLinModel"]["MultipleShooting"] =
7577 samples= samples, evals= evals, seconds= seconds
7678 )
7779
78-
79- # # ---------------------- Case studies ----------------------------------------------------
80- const CASE_MPC = SUITE[" case studies" ][" PredictiveController" ]
80+ # # ----------------------------------------------------------------------------------------
81+ # # ---------------------- CASE STUDIES ----------------------------------------------------
82+ # # ----------------------------------------------------------------------------------------
83+ const CASE_MPC = SUITE[" CASE STUDIES" ][" PredictiveController" ]
8184
8285# # ----------------- Case study: CSTR without feedforward ------------------------
8386G = [ tf (1.90 , [18 , 1 ]) tf (1.90 , [18 , 1 ]);
@@ -135,7 +138,7 @@ transcription = MultipleShooting()
135138mpc_ipopt_ms = setconstraint! (LinMPC (model; optim, transcription), ymin= [45 , - Inf ])
136139JuMP. unset_time_limit_sec (mpc_ipopt_ms. optim)
137140
138- samples, evals = 500 , 1
141+ samples, evals = 5000 , 1
139142CASE_MPC[" CSTR" ][" LinMPC" ][" Without feedforward" ][" OSQP" ][" SingleShooting" ] =
140143 @benchmarkable (test_mpc ($ mpc_osqp_ss, $ plant);
141144 samples= samples, evals= evals
@@ -209,7 +212,7 @@ transcription = MultipleShooting()
209212mpc_d_ipopt_ms = setconstraint! (LinMPC (model_d; optim, transcription), ymin= [45 , - Inf ])
210213JuMP. unset_time_limit_sec (mpc_d_ipopt_ms. optim)
211214
212- samples, evals = 500 , 1
215+ samples, evals = 5000 , 1
213216CASE_MPC[" CSTR" ][" LinMPC" ][" With feedforward" ][" OSQP" ][" SingleShooting" ] =
214217 @benchmarkable (test_mpc_d ($ mpc_d_osqp_ss, $ plant);
215218 samples= samples, evals= evals
@@ -285,7 +288,7 @@ JuMP.unset_time_limit_sec(nmpc_madnlp_ss.optim)
285288# MadNLP_QNopt = MadNLP.QuasiNewtonOptions(; max_history=42)
286289# JuMP.set_attribute(nmpc_madnlp_ms.optim, "quasi_newton_options", MadNLP_QNopt)
287290
288- samples, evals, seconds = 50 , 1 , 15 * 60
291+ samples, evals, seconds = 100 , 1 , 15 * 60
289292CASE_MPC[" Pendulum" ][" NonLinMPC" ][" Noneconomic" ][" Ipopt" ][" SingleShooting" ] =
290293 @benchmarkable (
291294 sim! ($ nmpc_ipopt_ss, $ N, $ ry; plant= $ plant, x_0= $ x_0, x̂_0= $ x̂_0),
@@ -336,7 +339,7 @@ JuMP.unset_time_limit_sec(empc_madnlp_ss.optim)
336339
337340# TODO : test EMPC with MadNLP and MultipleShooting, see comment above.
338341
339- samples, evals, seconds = 50 , 1 , 15 * 60
342+ samples, evals, seconds = 100 , 1 , 15 * 60
340343CASE_MPC[" Pendulum" ][" NonLinMPC" ][" Economic" ][" Ipopt" ][" SingleShooting" ] =
341344 @benchmarkable (
342345 sim! ($ empc_ipopt_ss, $ N, $ ry; plant= $ plant2, x_0= $ x_0, x̂_0= $ x̂_0),
@@ -388,7 +391,7 @@ JuMP.unset_time_limit_sec(nmpc2_ipopt_ms.optim)
388391# TODO : test custom constraints with MadNLP and SingleShooting, see comment above.
389392# TODO : test custom constraints with MadNLP and MultipleShooting, see comment above.
390393
391- samples, evals, seconds = 50 , 1 , 15 * 60
394+ samples, evals, seconds = 100 , 1 , 15 * 60
392395CASE_MPC[" Pendulum" ][" NonLinMPC" ][" Custom constraints" ][" Ipopt" ][" SingleShooting" ] =
393396 @benchmarkable (
394397 sim! ($ nmpc2_ipopt_ss, $ N, $ ry; plant= $ plant2, x_0= $ x_0, x̂_0= $ x̂_0),
@@ -458,7 +461,7 @@ mpc3_ipopt_ms = LinMPC(kf; Hp, Hc, Mwt, Nwt, Cwt, optim, transcription)
458461mpc3_ipopt_ms = setconstraint! (mpc3_ipopt_ms; umin, umax)
459462JuMP. unset_time_limit_sec (mpc3_ipopt_ms. optim)
460463
461- samples, evals = 500 , 1
464+ samples, evals = 5000 , 1
462465CASE_MPC[" Pendulum" ][" LinMPC" ][" Successive linearization" ][" OSQP" ][" SingleShooting" ] =
463466 @benchmarkable (
464467 sim2! ($ mpc3_osqp_ss, $ model, $ N, $ ry, $ plant, $ x_0, $ x̂_0, $ y_step),
0 commit comments