diff --git a/benchmark/2_bench_state_estim.jl b/benchmark/2_bench_state_estim.jl index 325e5ac3c..25fee68d2 100644 --- a/benchmark/2_bench_state_estim.jl +++ b/benchmark/2_bench_state_estim.jl @@ -272,18 +272,6 @@ mhe_cstr_daqp_pred = MovingHorizonEstimator(model; He, nint_u, σQint_u, optim, mhe_cstr_daqp_pred = setconstraint!(mhe_cstr_daqp_pred; v̂min, v̂max) JuMP.set_attribute(mhe_cstr_daqp_pred.optim, "eps_prox", 1e-6) # needed to support hessians H≥0 -optim = JuMP.Model(optimizer_with_attributes(Ipopt.Optimizer,"sb"=>"yes"), add_bridges=false) -direct = true -mhe_cstr_ipopt_curr = MovingHorizonEstimator(model; He, nint_u, σQint_u, optim, direct) -mhe_cstr_ipopt_curr = setconstraint!(mhe_cstr_ipopt_curr; v̂min, v̂max) -JuMP.unset_time_limit_sec(mhe_cstr_ipopt_curr.optim) - -optim = JuMP.Model(optimizer_with_attributes(Ipopt.Optimizer,"sb"=>"yes"), add_bridges=false) -direct = false -mhe_cstr_ipopt_pred = MovingHorizonEstimator(model; He, nint_u, σQint_u, optim, direct) -mhe_cstr_ipopt_pred = setconstraint!(mhe_cstr_ipopt_pred; v̂min, v̂max) -JuMP.unset_time_limit_sec(mhe_cstr_ipopt_pred.optim) - samples, evals = 10000, 1 CASE_ESTIM["CSTR"]["MovingHorizonEstimator"]["OSQP"]["Current form"] = @benchmarkable(test_mhe($mhe_cstr_osqp_curr, $plant); @@ -301,14 +289,6 @@ CASE_ESTIM["CSTR"]["MovingHorizonEstimator"]["DAQP"]["Prediction form"] = @benchmarkable(test_mhe($mhe_cstr_daqp_pred, $plant); samples=samples, evals=evals ) -CASE_ESTIM["CSTR"]["MovingHorizonEstimator"]["Ipopt"]["Current form"] = - @benchmarkable(test_mhe($mhe_cstr_ipopt_curr, $plant); - samples=samples, evals=evals - ) -CASE_ESTIM["CSTR"]["MovingHorizonEstimator"]["Ipopt"]["Prediction form"] = - @benchmarkable(test_mhe($mhe_cstr_ipopt_pred, $plant); - samples=samples, evals=evals - ) ## ---------------------- Case study: pendulum ------------------------------------------- model, p = pendulum_model, pendulum_p diff --git a/benchmark/3_bench_predictive_control.jl b/benchmark/3_bench_predictive_control.jl index cee43de7d..ed4658bef 100644 --- a/benchmark/3_bench_predictive_control.jl +++ b/benchmark/3_bench_predictive_control.jl @@ -202,16 +202,6 @@ mpc_daqp_ss = setconstraint!(LinMPC(model; optim, transcription), ymin=[45, -Inf # mpc_daqp_ms = setconstraint!(LinMPC(model; optim, transcription), ymin=[45, -Inf]) # JuMP.set_attribute(mpc_daqp_ms.optim, "eps_prox", 1e-6) -optim = JuMP.Model(optimizer_with_attributes(Ipopt.Optimizer,"sb"=>"yes"), add_bridges=false) -transcription = SingleShooting() -mpc_ipopt_ss = setconstraint!(LinMPC(model; optim, transcription), ymin=[45, -Inf]) -JuMP.unset_time_limit_sec(mpc_ipopt_ss.optim) - -optim = JuMP.Model(optimizer_with_attributes(Ipopt.Optimizer,"sb"=>"yes"), add_bridges=false) -transcription = MultipleShooting() -mpc_ipopt_ms = setconstraint!(LinMPC(model; optim, transcription), ymin=[45, -Inf]) -JuMP.unset_time_limit_sec(mpc_ipopt_ms.optim) - samples, evals = 10000, 1 CASE_MPC["CSTR"]["LinMPC"]["Without feedforward"]["OSQP"]["SingleShooting"] = @benchmarkable(test_mpc($mpc_osqp_ss, $plant); @@ -225,14 +215,6 @@ CASE_MPC["CSTR"]["LinMPC"]["Without feedforward"]["DAQP"]["SingleShooting"] = @benchmarkable(test_mpc($mpc_daqp_ss, $plant); samples=samples, evals=evals ) -CASE_MPC["CSTR"]["LinMPC"]["Without feedforward"]["Ipopt"]["SingleShooting"] = - @benchmarkable(test_mpc($mpc_ipopt_ss, $plant); - samples=samples, evals=evals -) -CASE_MPC["CSTR"]["LinMPC"]["Without feedforward"]["Ipopt"]["MultipleShooting"] = - @benchmarkable(test_mpc($mpc_ipopt_ms, $plant); - samples=samples, evals=evals - ) ## ----------------- Case study: CSTR with feedforward ------------------------- model_d = CSTR_model_d @@ -271,16 +253,6 @@ mpc_d_daqp_ss = setconstraint!(LinMPC(model_d; optim, transcription), ymin=[45, # Skip DAQP with MultipleShooting, it is not designed for sparse Hessians. Kind of works # with "eps_prox" configured to 1e-6, but not worth it. -optim = JuMP.Model(optimizer_with_attributes(Ipopt.Optimizer,"sb"=>"yes"), add_bridges=false) -transcription = SingleShooting() -mpc_d_ipopt_ss = setconstraint!(LinMPC(model_d; optim, transcription), ymin=[45, -Inf]) -JuMP.unset_time_limit_sec(mpc_d_ipopt_ss.optim) - -optim = JuMP.Model(optimizer_with_attributes(Ipopt.Optimizer,"sb"=>"yes"), add_bridges=false) -transcription = MultipleShooting() -mpc_d_ipopt_ms = setconstraint!(LinMPC(model_d; optim, transcription), ymin=[45, -Inf]) -JuMP.unset_time_limit_sec(mpc_d_ipopt_ms.optim) - samples, evals = 10000, 1 CASE_MPC["CSTR"]["LinMPC"]["With feedforward"]["OSQP"]["SingleShooting"] = @benchmarkable(test_mpc_d($mpc_d_osqp_ss, $plant); @@ -294,14 +266,6 @@ CASE_MPC["CSTR"]["LinMPC"]["With feedforward"]["DAQP"]["SingleShooting"] = @benchmarkable(test_mpc_d($mpc_d_daqp_ss, $plant); samples=samples, evals=evals ) -CASE_MPC["CSTR"]["LinMPC"]["With feedforward"]["Ipopt"]["SingleShooting"] = - @benchmarkable(test_mpc_d($mpc_d_ipopt_ss, $plant); - samples=samples, evals=evals - ) -CASE_MPC["CSTR"]["LinMPC"]["With feedforward"]["Ipopt"]["MultipleShooting"] = - @benchmarkable(test_mpc_d($mpc_d_ipopt_ms, $plant); - samples=samples, evals=evals - ) # ----------------- Case study: Pendulum noneconomic ----------------------------- model, p = pendulum_model, pendulum_p @@ -727,18 +691,6 @@ mpc3_daqp_ss = setconstraint!(mpc3_daqp_ss; umin, umax) # skip DAQP with MultipleShooting, it is not designed for sparse Hessians # did not found any settings that works well here (always reach the iteration limit). -optim = JuMP.Model(optimizer_with_attributes(Ipopt.Optimizer,"sb"=>"yes"), add_bridges=false) -transcription = SingleShooting() -mpc3_ipopt_ss = LinMPC(kf; Hp, Hc, Mwt, Nwt, Cwt, optim, transcription) -mpc3_ipopt_ss = setconstraint!(mpc3_ipopt_ss; umin, umax) -JuMP.unset_time_limit_sec(mpc3_ipopt_ss.optim) - -optim = JuMP.Model(optimizer_with_attributes(Ipopt.Optimizer,"sb"=>"yes"), add_bridges=false) -transcription = MultipleShooting() -mpc3_ipopt_ms = LinMPC(kf; Hp, Hc, Mwt, Nwt, Cwt, optim, transcription) -mpc3_ipopt_ms = setconstraint!(mpc3_ipopt_ms; umin, umax) -JuMP.unset_time_limit_sec(mpc3_ipopt_ms.optim) - samples, evals = 10000, 1 CASE_MPC["Pendulum"]["LinMPC"]["Successive linearization"]["OSQP"]["SingleShooting"] = @benchmarkable( @@ -755,13 +707,3 @@ CASE_MPC["Pendulum"]["LinMPC"]["Successive linearization"]["DAQP"]["SingleShooti sim2!($mpc3_daqp_ss, $model, $N, $ry, $plant, $x_0, $x̂_0, $y_step), samples=samples, evals=evals ) -CASE_MPC["Pendulum"]["LinMPC"]["Successive linearization"]["Ipopt"]["SingleShooting"] = - @benchmarkable( - sim2!($mpc3_ipopt_ss, $model, $N, $ry, $plant, $x_0, $x̂_0, $y_step), - samples=samples, evals=evals - ) -CASE_MPC["Pendulum"]["LinMPC"]["Successive linearization"]["Ipopt"]["MultipleShooting"] = - @benchmarkable( - sim2!($mpc3_ipopt_ms, $model, $N, $ ry, $plant, $x_0, $x̂_0, $y_step), - samples=samples, evals=evals - )