Skip to content

Commit b1e5e68

Browse files
committed
bench: UnoSolver on MHE with inverted pendulum
Using the `funnelsqp` preset. It is very efficient compared to `Ipopt` (about 6 times faster)
1 parent e5ec04f commit b1e5e68

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

‎benchmark/2_bench_state_estim.jl‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,25 @@ mhe_pendulum_madnlp_predh = MovingHorizonEstimator(
368368
mhe_pendulum_madnlp_pred = setconstraint!(mhe_pendulum_madnlp_predh; v̂min, v̂max)
369369
JuMP.unset_time_limit_sec(mhe_pendulum_madnlp_predh.optim)
370370

371+
optim = JuMP.Model(()->UnoSolver.Optimizer(preset="funnelsqp"), add_bridges=false)
372+
direct = true
373+
hessian = true
374+
mhe_pendulum_uno_currh = MovingHorizonEstimator(
375+
model; He, σQ, σR, nint_u, σQint_u, optim, direct, hessian
376+
)
377+
mhe_pendulum_uno_currh = setconstraint!(mhe_pendulum_uno_currh; v̂min, v̂max)
378+
JuMP.unset_time_limit_sec(mhe_pendulum_uno_currh.optim)
379+
380+
optim = JuMP.Model(()->UnoSolver.Optimizer(preset="funnelsqp"), add_bridges=false)
381+
direct = true
382+
hessian = true
383+
transcription = MultipleShooting()
384+
mhe_pendulum_uno_currhms = MovingHorizonEstimator(
385+
model; He, σQ, σR, nint_u, σQint_u, optim, direct, hessian, transcription
386+
)
387+
mhe_pendulum_uno_currhms = setconstraint!(mhe_pendulum_uno_currhms; v̂min, v̂max)
388+
JuMP.unset_time_limit_sec(mhe_pendulum_uno_currhms.optim)
389+
371390
samples, evals, seconds = 25, 1, 15*60
372391
# CASE_ESTIM["Pendulum"]["MovingHorizonEstimator"]["Ipopt"]["Current form"] =
373392
# @benchmarkable(
@@ -409,3 +428,13 @@ CASE_ESTIM["Pendulum"]["MovingHorizonEstimator"]["MadNLP"]["Prediction form (Hes
409428
sim!($mhe_pendulum_madnlp_predh, $N, $u; plant=$plant, x_0=$x_0, x̂_0=$x̂_0, progress=false),
410429
samples=samples, evals=evals, seconds=seconds, setup=GC.gc()
411430
)
431+
CASE_ESTIM["Pendulum"]["MovingHorizonEstimator"]["Uno"]["Current form (Hessian)"] =
432+
@benchmarkable(
433+
sim!($mhe_pendulum_uno_currh, $N, $u; plant=$plant, x_0=$x_0, x̂_0=$x̂_0, progress=false),
434+
samples=samples, evals=evals, seconds=seconds, setup=GC.gc()
435+
)
436+
CASE_ESTIM["Pendulum"]["MovingHorizonEstimator"]["Uno"]["Current form (Hessian, MultipleShooting)"] =
437+
@benchmarkable(
438+
sim!($mhe_pendulum_uno_currhms, $N, $u; plant=$plant, x_0=$x_0, x̂_0=$x̂_0, progress=false),
439+
samples=samples, evals=evals, seconds=seconds, setup=GC.gc()
440+
)

0 commit comments

Comments
 (0)