Embedded code generation using the OSQP solver
read more
Citations
OSQP: An Operator Splitting Solver for Quadratic Programs
OSQP: an operator splitting solver for quadratic programs
Recent Advances in Quadratic Programming Algorithms for Nonlinear Model Predictive Control
OpEn: Code Generation for Embedded Nonconvex Optimization
Infeasibility Detection in the Alternating Direction Method of Multipliers for Convex Optimization
References
Regression Shrinkage and Selection via the Lasso
Convex Optimization
Distributed Optimization and Statistical Learning Via the Alternating Direction Method of Multipliers
Model predictive control: theory and practice—a survey
Enhancing Sparsity by Reweighted ℓ 1 Minimization
Related Papers (5)
Frequently Asked Questions (17)
Q2. What is the common assumption for updating vectors of a parametric QP?
A common assumption is the k-factor risk model [38], where the return covariance matrix is the sum of a diagonal matrix and a matrix of rank k, i.e.,Σ = D + FFT ,where F ∈ Rn×k and D ∈ Rn×n is diagonal with nonnegative diagonal elements.
Q3. What is the LDLT factorization of the linear system?
In particular, as long as P + σI is positive definite, the LDLT factoriza-tion of the matrix in Algorithm 1 will return a factor D with nonzero diagonal elements, and exceptions caused by division by zero cannot occur when solving the linear system.
Q4. What is the main disadvantage of the generated solver?
The generated solver is fast and reliable, but its main disadvantage is that the code size grows rapidly with the problem dimensions.
Q5. What is the coefficient matrix in the algorithm?
The coefficient matrix is quasi-definite, i.e., it can be written as a 2-by-2 block-symmetric matrix where the (1, 1)- block is positive definite, and the (2, 2)-block is negative definite.
Q6. What is the main limitation of parametric solvers?
A known limitation of these methods is that they cannot use the warm starting technique, which is one of the dominant acceleration factors in applications such as MPC [19].
Q7. What is the algorithm used in OSQP?
The algorithm used in OSQP [23] is based on the alternating direction method of multipliers (ADMM) [24] and is described in Algorithm 1.
Q8. What is the main disadvantage of the aforementioned solvers?
All of the aforementioned solvers are based on primal-dual interior point methods that are tailored for their specific problem classes.
Q9. What is the keyword argument for the solver?
Using the keyword argument project_type the user can define the build environment, e.g., Makefiles or several supported IDEs such as Eclipse, Apple Xcode or Microsoft Visual Studio.
Q10. How many iterations does the solver run?
Checking the terminationcriteria in each iteration is computationally expensive since it involves several matrix-vector multiplications, and may slow down the code execution considerably.
Q11. What is the criterion for a termination of the matrix?
A reasonable termination criterion is that the norms of the residuals rkprim and r k dual are smaller than some tolerance levels εprim > 0 and εdual > 0, respectively.
Q12. How many nonzero elements in x should be used to solve the problem?
In order to find a sparse solution with a given degree of sparsity, i.e., not more than k nonzero elements in x, the above problem should be solved for varying weighting parameter γ.
Q13. What is the syntax for generating the code for a given parametric program?
A simple Python script for generating the code for a given parametric QP.backward and forward solves are performed during code execution.
Q14. What is the important class of parametric programs?
This important class of parametric programs arises, for instance, in linear MPC [32], linear regression with (weighted) `1 regularization [33], [34] and portfolio optimization [1].
Q15. How many iterations does the solver run without checking the termination criteria?
If the user instead sets early_terminate to 0, then the algorithm will run for the maximum number of iterations without checking the termination criteria.
Q16. How can the authors exploit the fact that enters only in the linear part of the cost?
As in Section V-A, the authors can exploit the fact that γ enters only in the linear part of the cost function by caching the matrix factorization and warm starting the solver.
Q17. What is the main disadvantage of FiOrdOs?
FiOrdOs implements an adaptive rule for the stepsize selection, but it requires a new matrix factorization each time the stepsize is updated.