qp_ex1
- qp_ex1()
qp_ex1()- Example of quadratic program (QP) optimization.Example of solving the following QP problem, first using
mp.opt_modelandmp.opt_model.solve(), then directly usingqps_master().(51)\[\min_{\x} \frac{1}{2} \trans{\x} \Hh \x\]subject to
(52)\[\l \le \AA \x \le \u\](53)\[\param{\x}_\mathrm{min} \le \x \le \param{\x}_\mathrm{max}\]where
(54)\[\begin{split}\Hh = \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}\](55)\[\begin{split}\l = \left[\begin{array}{c} 4 \\ -\infty \end{array}\right], \AA = \left[\begin{array}{cccc} 6 & 1 & 5 & -4 \\ 4 & 9 & 0 & 0 \end{array}\right], \u = \left[\begin{array}{c} 4 \\ 2 \end{array}\right]\end{split}\](56)\[\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}\]