Assume that you are using quadprog
command in MATLAB/Octave and you want to minimize this objective function:
$$\Phi_{min} = \frac{1}{2}X^TQX + c^TX$$
With subject to:
$$X_{min} \leq X \leq X_{max}$$
But I have the constraint
$$Y_{min} \leq AX \leq Y_{max},$$
where $A$ is a matrix. How can I solve that?
Best Answer
You can rephrase $$y_{\min} \leq Ax \leq y_{\max},$$ as $$\begin{pmatrix}A \\ -A\end{pmatrix}x \leq \begin{pmatrix}y_{\max} \\ -y_{\min}\end{pmatrix},$$ which is in the format of what quadprog accepts.