qpdata.inc : QP data

File : qpdata.inc  used by :  vi_equil.gms [html]   vi_mcp.gms [html]

$ontext
Data for QP with unique solution
The problem is set up so:
 - g_1 is binding and g_2 is not
 - x_2.up and x_3.lo are are binding
 - x_1 and x_4 are basic/superbasic at solution
$offtext

set j / j1 * j4 /;
set i / i1 * i2 /;
alias(j,jj);

parameters
  c(j) /
    j1  4
    j2  -9
    j3  6
    j4  2
  /
  b(i) /
    i1    1
    i2    1
  /;
table Q(j,jj)
    j1  j2  j3  j4
j1   4  -2  -1  -1
j2  -2   4  -2  -1
j3  -1  -2   4  -2
j4  -1  -1  -2   4
;
table A(i,j)
    j1  j2  j3  j4
i1   1           1
i2       1   1   1
;
positive variable x(j);
free variable z;
equation g(i), o;

g(i) .. sum {j, A(i,j)*x(j)} =G= b(i);
o    .. 0.5 * sum {j, x(j)*sum{jj, Q(j,jj)*x(jj)}} + sum{j, c(j)*x(j)} =E= z;

x.up(j) = 20;
x.up('j2') = 2;
model mqp / g, o /;

* solve mqp using nlp min z;