Examples

Here we show through two examples how to generate code using QPgen. We also present some performance results.

Model predictive control

Model predictive control of the pitch angle in an aircraft.

Problem size:

  • 60 decision variables

  • 40 equality constraints

  • 80 constraints (40 soft and 40 hard)

Performance:

  • Evaluated by following reference in outputs (see simulation)

  • Execution times compared to commercial solver MOSEK:

avg. exec-time max. exec-time
QPgen 0.098 ms 0.26 ms
MOSEK 4.64 ms 8.13 ms


  • About 30 times faster than MOSEK

Sequential sparse lasso

Random lasso problems.

Problem size:

  • 10000 decision variables

  • More than 200 000 non-zero elements in data matrix

Performance:

  • Evaluated by solving 50 instances with different linear cost

  • Execution times compared to commercial solver MOSEK:

avg. exec-time max. exec-time
QPgen 16.1 ms 24.1 ms
MOSEK 824.3 s 894.5 s


  • More than 30 000 times faster than MOSEK (note ms vs s in table)



(All preformance results are obained on a single core 2.9 GHz Linux Laptop with 8 Gb RAM.)