@@ -46,10 +46,18 @@ nmpc_nonlin_ss = NonLinMPC(
4646 nonlinmodel, transcription= SingleShooting (),
4747 Mwt= [1 , 1 ], Nwt= [0.1 , 0.1 ], Lwt= [0.1 , 0.1 ], Hp= 10
4848)
49+ nmpc_nonlin_ss_hess = NonLinMPC (
50+ nonlinmodel, transcription= SingleShooting (), hessian= true ,
51+ Mwt= [1 , 1 ], Nwt= [0.1 , 0.1 ], Lwt= [0.1 , 0.1 ], Hp= 10
52+ )
4953nmpc_nonlin_ms = NonLinMPC (
5054 nonlinmodel, transcription= MultipleShooting (),
5155 Mwt= [1 , 1 ], Nwt= [0.1 , 0.1 ], Lwt= [0.1 , 0.1 ], Hp= 10
5256)
57+ nmpc_nonlin_ms_hess = NonLinMPC (
58+ nonlinmodel, transcription= MultipleShooting (), hessian= true ,
59+ Mwt= [1 , 1 ], Nwt= [0.1 , 0.1 ], Lwt= [0.1 , 0.1 ], Hp= 10
60+ )
5361nmpc_nonlin_tc = NonLinMPC (
5462 nonlinmodel_c, transcription= TrapezoidalCollocation (),
5563 Mwt= [1 ], Nwt= [0.1 ], Lwt= [0.1 ], Hp= 10
@@ -74,12 +82,24 @@ UNIT_MPC["NonLinMPC"]["moveinput!"]["NonLinModel"]["SingleShooting"] =
7482 setup= preparestate! ($ nmpc_nonlin_ss, $ y, $ d),
7583 samples= samples, evals= evals, seconds= seconds
7684 )
85+ UNIT_MPC[" NonLinMPC" ][" moveinput!" ][" NonLinModel" ][" SingleShootingHessian" ] =
86+ @benchmarkable (
87+ moveinput! ($ nmpc_nonlin_ss, $ y, $ d),
88+ setup= preparestate! ($ nmpc_nonlin_ss_hess, $ y, $ d),
89+ samples= samples, evals= evals, seconds= seconds
90+ )
7791UNIT_MPC[" NonLinMPC" ][" moveinput!" ][" NonLinModel" ][" MultipleShooting" ] =
7892 @benchmarkable (
7993 moveinput! ($ nmpc_nonlin_ms, $ y, $ d),
8094 setup= preparestate! ($ nmpc_nonlin_ms, $ y, $ d),
8195 samples= samples, evals= evals, seconds= seconds
8296 )
97+ UNIT_MPC[" NonLinMPC" ][" moveinput!" ][" NonLinModel" ][" MultipleShootingHessian" ] =
98+ @benchmarkable (
99+ moveinput! ($ nmpc_nonlin_ms, $ y, $ d),
100+ setup= preparestate! ($ nmpc_nonlin_ms_hess, $ y, $ d),
101+ samples= samples, evals= evals, seconds= seconds
102+ )
83103UNIT_MPC[" NonLinMPC" ][" moveinput!" ][" NonLinModel" ][" TrapezoidalCollocation" ] =
84104 @benchmarkable (
85105 moveinput! ($ nmpc_nonlin_tc, $ y_c, $ d_c),
@@ -258,12 +278,24 @@ nmpc_ipopt_ss = NonLinMPC(estim; Hp, Hc, Mwt, Nwt, Cwt, optim, transcription)
258278nmpc_ipopt_ss = setconstraint! (nmpc_ipopt_ss; umin, umax)
259279JuMP. unset_time_limit_sec (nmpc_ipopt_ss. optim)
260280
281+ optim = JuMP. Model (optimizer_with_attributes (Ipopt. Optimizer," sb" => " yes" ), add_bridges= false )
282+ transcription, hessian = SingleShooting (), true
283+ nmpc_ipopt_ss_hess = NonLinMPC (estim; Hp, Hc, Mwt, Nwt, Cwt, optim, transcription, hessian)
284+ nmpc_ipopt_ss_hess = setconstraint! (nmpc_ipopt_ss_hess; umin, umax)
285+ JuMP. unset_time_limit_sec (nmpc_ipopt_ss_hess. optim)
286+
261287optim = JuMP. Model (optimizer_with_attributes (Ipopt. Optimizer," sb" => " yes" ), add_bridges= false )
262288transcription = MultipleShooting ()
263289nmpc_ipopt_ms = NonLinMPC (estim; Hp, Hc, Mwt, Nwt, Cwt, optim, transcription)
264290nmpc_ipopt_ms = setconstraint! (nmpc_ipopt_ms; umin, umax)
265291JuMP. unset_time_limit_sec (nmpc_ipopt_ms. optim)
266292
293+ optim = JuMP. Model (optimizer_with_attributes (Ipopt. Optimizer," sb" => " yes" ), add_bridges= false )
294+ transcription, hessian = MultipleShooting (), true
295+ nmpc_ipopt_ms_hess = NonLinMPC (estim; Hp, Hc, Mwt, Nwt, Cwt, optim, transcription, hessian)
296+ nmpc_ipopt_ms_hess = setconstraint! (nmpc_ipopt_ms_hess; umin, umax)
297+ JuMP. unset_time_limit_sec (nmpc_ipopt_ms_hess. optim)
298+
267299optim = JuMP. Model (optimizer_with_attributes (Ipopt. Optimizer," sb" => " yes" ), add_bridges= false )
268300transcription = MultipleShooting (f_threads= true )
269301nmpc_ipopt_mst = NonLinMPC (estim; Hp, Hc, Mwt, Nwt, Cwt, optim, transcription)
@@ -305,32 +337,42 @@ JuMP.unset_time_limit_sec(nmpc_madnlp_ss.optim)
305337samples, evals, seconds = 100 , 1 , 15 * 60
306338CASE_MPC[" Pendulum" ][" NonLinMPC" ][" Noneconomic" ][" Ipopt" ][" SingleShooting" ] =
307339 @benchmarkable (
308- sim! ($ nmpc_ipopt_ss, $ N, $ ry; plant= $ plant, x_0= $ x_0, x̂_0= $ x̂_0),
340+ sim! ($ nmpc_ipopt_ss, $ N, $ ry; plant= $ plant, x_0= $ x_0, x̂_0= $ x̂_0, progress= false ),
341+ samples= samples, evals= evals, seconds= seconds
342+ )
343+ CASE_MPC[" Pendulum" ][" NonLinMPC" ][" Noneconomic" ][" Ipopt" ][" SingleShooting (Hessian)" ] =
344+ @benchmarkable (
345+ sim! ($ nmpc_ipopt_ss_hess, $ N, $ ry; plant= $ plant, x_0= $ x_0, x̂_0= $ x̂_0, progress= false ),
309346 samples= samples, evals= evals, seconds= seconds
310347 )
311348CASE_MPC[" Pendulum" ][" NonLinMPC" ][" Noneconomic" ][" Ipopt" ][" MultipleShooting" ] =
312349 @benchmarkable (
313- sim! ($ nmpc_ipopt_ms, $ N, $ ry; plant= $ plant, x_0= $ x_0, x̂_0= $ x̂_0),
350+ sim! ($ nmpc_ipopt_ms, $ N, $ ry; plant= $ plant, x_0= $ x_0, x̂_0= $ x̂_0, progress= false ),
351+ samples= samples, evals= evals, seconds= seconds
352+ )
353+ CASE_MPC[" Pendulum" ][" NonLinMPC" ][" Noneconomic" ][" Ipopt" ][" MultipleShooting (Hessian)" ] =
354+ @benchmarkable (
355+ sim! ($ nmpc_ipopt_ms_hess, $ N, $ ry; plant= $ plant, x_0= $ x_0, x̂_0= $ x̂_0, progress= false ),
314356 samples= samples, evals= evals, seconds= seconds
315357 )
316358CASE_MPC[" Pendulum" ][" NonLinMPC" ][" Noneconomic" ][" Ipopt" ][" MultipleShooting (threaded)" ] =
317359 @benchmarkable (
318- sim! ($ nmpc_ipopt_mst, $ N, $ ry; plant= $ plant, x_0= $ x_0, x̂_0= $ x̂_0),
360+ sim! ($ nmpc_ipopt_mst, $ N, $ ry; plant= $ plant, x_0= $ x_0, x̂_0= $ x̂_0, progress = false ),
319361 samples= samples, evals= evals, seconds= seconds
320362 )
321363CASE_MPC[" Pendulum" ][" NonLinMPC" ][" Noneconomic" ][" Ipopt" ][" TrapezoidalCollocation" ] =
322364 @benchmarkable (
323- sim! ($ nmpc_ipopt_tc, $ N, $ ry; plant= $ plant, x_0= $ x_0, x̂_0= $ x̂_0),
365+ sim! ($ nmpc_ipopt_tc, $ N, $ ry; plant= $ plant, x_0= $ x_0, x̂_0= $ x̂_0, progress = false ),
324366 samples= samples, evals= evals, seconds= seconds
325367 )
326368CASE_MPC[" Pendulum" ][" NonLinMPC" ][" Noneconomic" ][" Ipopt" ][" TrapezoidalCollocation (threaded)" ] =
327369 @benchmarkable (
328- sim! ($ nmpc_ipopt_tct, $ N, $ ry; plant= $ plant, x_0= $ x_0, x̂_0= $ x̂_0),
370+ sim! ($ nmpc_ipopt_tct, $ N, $ ry; plant= $ plant, x_0= $ x_0, x̂_0= $ x̂_0, progress = false ),
329371 samples= samples, evals= evals, seconds= seconds
330372 )
331373CASE_MPC[" Pendulum" ][" NonLinMPC" ][" Noneconomic" ][" MadNLP" ][" SingleShooting" ] =
332374 @benchmarkable (
333- sim! ($ nmpc_madnlp_ss, $ N, $ ry; plant= $ plant, x_0= $ x_0, x̂_0= $ x̂_0),
375+ sim! ($ nmpc_madnlp_ss, $ N, $ ry; plant= $ plant, x_0= $ x_0, x̂_0= $ x̂_0, progress = false ),
334376 samples= samples, evals= evals, seconds= seconds
335377 )
336378
@@ -376,22 +418,22 @@ JuMP.unset_time_limit_sec(empc_madnlp_ss.optim)
376418samples, evals, seconds = 100 , 1 , 15 * 60
377419CASE_MPC[" Pendulum" ][" NonLinMPC" ][" Economic" ][" Ipopt" ][" SingleShooting" ] =
378420 @benchmarkable (
379- sim! ($ empc_ipopt_ss, $ N, $ ry; plant= $ plant2, x_0= $ x_0, x̂_0= $ x̂_0),
421+ sim! ($ empc_ipopt_ss, $ N, $ ry; plant= $ plant2, x_0= $ x_0, x̂_0= $ x̂_0, progress = false ),
380422 samples= samples, evals= evals, seconds= seconds
381423 )
382424CASE_MPC[" Pendulum" ][" NonLinMPC" ][" Economic" ][" Ipopt" ][" MultipleShooting" ] =
383425 @benchmarkable (
384- sim! ($ empc_ipopt_ms, $ N, $ ry; plant= $ plant2, x_0= $ x_0, x̂_0= $ x̂_0),
426+ sim! ($ empc_ipopt_ms, $ N, $ ry; plant= $ plant2, x_0= $ x_0, x̂_0= $ x̂_0, progress = false ),
385427 samples= samples, evals= evals, seconds= seconds
386428 )
387429CASE_MPC[" Pendulum" ][" NonLinMPC" ][" Economic" ][" Ipopt" ][" TrapezoidalCollocation" ] =
388430 @benchmarkable (
389- sim! ($ empc_ipopt_tc, $ N, $ ry; plant= $ plant2, x_0= $ x_0, x̂_0= $ x̂_0),
431+ sim! ($ empc_ipopt_tc, $ N, $ ry; plant= $ plant2, x_0= $ x_0, x̂_0= $ x̂_0, progress = false ),
390432 samples= samples, evals= evals, seconds= seconds
391433 )
392434CASE_MPC[" Pendulum" ][" NonLinMPC" ][" Economic" ][" MadNLP" ][" SingleShooting" ] =
393435 @benchmarkable (
394- sim! ($ empc_madnlp_ss, $ N, $ ry; plant= $ plant2, x_0= $ x_0, x̂_0= $ x̂_0),
436+ sim! ($ empc_madnlp_ss, $ N, $ ry; plant= $ plant2, x_0= $ x_0, x̂_0= $ x̂_0, progress = false ),
395437 samples= samples, evals= evals, seconds= seconds
396438 )
397439
@@ -442,17 +484,17 @@ JuMP.unset_time_limit_sec(nmpc2_ipopt_tc.optim)
442484samples, evals, seconds = 100 , 1 , 15 * 60
443485CASE_MPC[" Pendulum" ][" NonLinMPC" ][" Custom constraints" ][" Ipopt" ][" SingleShooting" ] =
444486 @benchmarkable (
445- sim! ($ nmpc2_ipopt_ss, $ N, $ ry; plant= $ plant2, x_0= $ x_0, x̂_0= $ x̂_0),
487+ sim! ($ nmpc2_ipopt_ss, $ N, $ ry; plant= $ plant2, x_0= $ x_0, x̂_0= $ x̂_0, progress = false ),
446488 samples= samples, evals= evals, seconds= seconds
447489 )
448490CASE_MPC[" Pendulum" ][" NonLinMPC" ][" Custom constraints" ][" Ipopt" ][" MultipleShooting" ] =
449491 @benchmarkable (
450- sim! ($ nmpc2_ipopt_ms, $ N, $ ry; plant= $ plant2, x_0= $ x_0, x̂_0= $ x̂_0),
492+ sim! ($ nmpc2_ipopt_ms, $ N, $ ry; plant= $ plant2, x_0= $ x_0, x̂_0= $ x̂_0, progress = false ),
451493 samples= samples, evals= evals, seconds= seconds
452494 )
453495CASE_MPC[" Pendulum" ][" NonLinMPC" ][" Custom constraints" ][" Ipopt" ][" TrapezoidalCollocation" ] =
454496 @benchmarkable (
455- sim! ($ nmpc2_ipopt_tc, $ N, $ ry; plant= $ plant2, x_0= $ x_0, x̂_0= $ x̂_0),
497+ sim! ($ nmpc2_ipopt_tc, $ N, $ ry; plant= $ plant2, x_0= $ x_0, x̂_0= $ x̂_0, progress = false ),
456498 samples= samples, evals= evals, seconds= seconds
457499 )
458500
0 commit comments