qp_ex1

qp_ex1()

qp_ex1() - Example of quadratic program (QP) optimization.

Example of solving the following QP problem, first using opt_model and opt_model.solve(), then directly using qps_master().

(18)\[\min_{\x} \frac{1}{2} \trans{\x} \param{\rmat{Q}} \x\]

subject to

(19)\[\param{\rvec{l}} \le \param{\rmat{A}} \x \le \param{\rvec{u}}\]
(20)\[\param{\x}_\mathrm{min} \le \x \le \param{\x}_\mathrm{max}\]

where

(21)\[\begin{split}\param{\rmat{Q}} = \left[\begin{array}{cccc} 8 & 1 & -3 & -4 \\ 1 & 4 & -2 & -1 \\ -3 & -2 & 5 & 4 \\ -4 & -1 & 4 & 12 \end{array}\right]\end{split}\]
(22)\[\begin{split}\param{\rvec{l}} = \left[\begin{array}{c} 4 \\ -\infty \end{array}\right], \param{\rmat{A}} = \left[\begin{array}{cccc} 6 & 1 & 5 & -4 \\ 4 & 9 & 0 & 0 \end{array}\right], \param{\rvec{u}} = \left[\begin{array}{c} 4 \\ 2 \end{array}\right]\end{split}\]
(23)\[\begin{split}\param{\x}_\mathrm{min} = \left[\begin{array}{c} 0 \\ 0 \\ -\infty \\ -\infty \end{array}\right], \param{\x}_\mathrm{max} = \left[\begin{array}{c} \infty \\ \infty \\ 0 \\ 2 \end{array}\right]\end{split}\]