# Decent QP solver?

**URL:** <https://discourse.julialang.org/t/decent-qp-solver/89939>\
**Category:** Modelling & Simulations\
**Created:** [November 8, 2022, 4:08pm UTC](https://discourse.julialang.org/t/decent-qp-solver/89939 "2022-11-08T16:08:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [November 8, 2022, 4:08pm UTC](https://discourse.julialang.org/t/decent-qp-solver/89939/1 "2022-11-08T16:08:03Z")

</div>

I’m looking for a QP solver to do a “quick-and-dirty” Optimal Control/MPC implementation for a linear-quadratic system.

Does GalacticOptim or Optim support a pure QP solver? A year ago, someone suggested COSMO.jl.

Any views on a suitable choice? [I don’t need to use JuMP, as it is relatively straightforward to formulate the QP matrices.]

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [November 8, 2022, 4:19pm UTC](https://discourse.julialang.org/t/decent-qp-solver/89939/2 "2022-11-08T16:19:38Z")

</div>

I use OSQP.jl for these cases. It has some nice properties for MPC in particular, such as code generation, possibly division-free operation, warm starting etc.

You can call it through MathOptInterface which is used by both JuMP and optionally by Optimization.jl

> **[OSQP solver documentation](https://osqp.org/docs/examples/mpc.html)**
>
> The OSQP (Operator Splitting Quadratic
> Program) solver is a numerical optimization package for solving convex
> quadratic programs.

---

<div class="post-metadata">

**Author:** ![cvanaret](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cvanaret/32/11594_2.png) [@cvanaret](https://discourse.julialang.org/u/cvanaret)\
**Post date:** [November 12, 2022, 5:17pm UTC](https://discourse.julialang.org/t/decent-qp-solver/89939/3 "2022-11-12T17:17:54Z")

</div>

If your QP is convex, [HiGHS](https://github.com/jump-dev/HiGHS.jl) should be competitive. If not, I know BQPD supports negative curvature, but I don’t think there’s a Julia binding.

---

<div class="post-metadata">

**Author:** ![nrontsis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nrontsis/32/38535_2.png) [@nrontsis](https://discourse.julialang.org/u/nrontsis)\
**Post date:** [December 11, 2022, 7:58pm UTC](https://discourse.julialang.org/t/decent-qp-solver/89939/4 "2022-12-11T19:58:44Z")

</div>

I would also suggest the recent [Clarabel.jl](https://github.com/oxfordcontrol/Clarabel.jl), which is performing very well for several MPC problems I have tried. It’s for convex problems only, like OSQP, HiGHs and COSMO.jl

Unfortunately, I had seen quite a few times HiGHS failing in QP problems of mine - I should try to report them to their developers as minimal examples when I find time.

Also, it’s worth nothing that BQPD is not free. In the commercial route there is also Gurobi and CPLEX. CPLEX in particular can also solve non-convex QPs to either global or local optimality.

[A more complete list can be found here](https://www.numerical.rl.ac.uk/people/nimg/qp/qp.html)
