title: Optimisation Multiple Constraints - Using CVXOPT
body: <p>I am trying to solve a linear algebra problem: an optimisation problem and I am using CVXOPT. I've split the problem into 3 components</p>
  <p>In its simplest form, The general formulation for CVXOPT is</p>
  <p>Minimize 1/2xTPx+qTx</p>
  <p>subject to Gx≤h</p>
  <p>and Ax=b.</p>
  <p><strong>1st problem component</strong>
  First of all I have to minimize, subject to constraint a very simple problem defined as following</p>
  <p>P=</p>
  <pre><code>|   S   |
  </code></pre>
  <p>q=</p>
  <pre><code>|   0   |
  </code></pre>
  <p>A=</p>
  <pre><code>|   1   |
  </code></pre>
  <p>b=</p>
  <pre><code>|   1   |
  </code></pre>
  <p>G=</p>
  <pre><code>|   r   |
  |   -I  |
  </code></pre>
  <p>h=</p>
  <pre><code>|   rmin    0   |
  </code></pre>
  <p>I have coded this and it is working perfectly</p>
  <p><strong>2nd problem component</strong>
  The second problem I have is to transform a non convex problem into convex and linear so that the turnover generated by the optimisation problem it is constrained to a max value. In this case I have modelled and coded the problem as following and again all works fine</p>
  <p>P=</p>
  <pre><code>  | S   0   0   |
    | 0   0   0   |
    | 0   0   0   |
    | 0   0   0   |
  </code></pre>
  <p>q=</p>
  <pre><code>|   -x1 0   0   |
  </code></pre>
  <p>A=</p>
  <pre><code>|   1   0   0   |
  |   I   I   -I  |
  </code></pre>
  <p>b=</p>
  <pre><code>|   1   x0  0   |
  </code></pre>
  <p>G=</p>
  <pre><code>|   0   1   1   |
  |   -I  0   0   |
  |   0   -I  0   |
  |   0   0   -I  |
  </code></pre>
  <p>h=</p>
  <pre><code>|   T   0   0   |
  </code></pre>
  <p><strong>3rd problem component</strong>
  The third problem which I am struggling with (to solve) is to combine the two above. What I have done, which is obviously not correct as it turns to be a singular matrix is doing the following</p>
  <p>P=</p>
  <pre><code>|   S   0   0   |
  |   0   0   0   |
  |   0   0   0   |
  |   0   0   0   |
  </code></pre>
  <p>q=</p>
  <pre><code>|   -x1 0   0   |
  </code></pre>
  <p>A=</p>
  <pre><code>|   1   0   0   |
  |   I   I   -I  |
  </code></pre>
  <p>b=</p>
  <pre><code>|   1   x0  0   |
  </code></pre>
  <p>G=</p>
  <pre><code>|   0   1   1       |
  |   -I  0   0       |
  |   0   -I  0       |
  |   0   0   -I      |
  |   0   0   rmin    |
  |   0   0   -I      |
  </code></pre>
  <p>h=</p>
  <pre><code>|   T   0   0   rmin    0   |
  </code></pre>
  <p>As I think The problem of the singularity comes from G, can anyone help me formulating the third problem in a correct way?</p>
  <p>Thanks</p>