## Model with quadratic Obj and Constraint

Problems with modeling
bmajeed92
User
Posts: 2
Joined: 10 months ago

### Model with quadratic Obj and Constraint

I am trying to run the following model, but I am not successful. Can anyone help with what am I missing in the modeling?

sets
i / 1*50 /
j / 1*50 /
k / 1*19/ ;

Parameter S(i,j);
\$call GDXXRW Sij.xlsx trace=3 par=S rng=Sheet1!a1 rdim=1 cdim=1
\$GDXIN Sij.gdx
\$LOAD S
\$GDXIN

Parameter ds(k)
\$include "C:\Users\Bilal Majeed\Documents\gamsdir\projdir\dsk.txt";

table A(i,k)
\$include "C:\Users\Bilal Majeed\Documents\gamsdir\projdir\Aik.txt";

Parameter At(k,i);
At(k,i)=A(i,k);
scalar p /100/;

variables
dc1(i) ,
dc2(j) ,
alpha ,
z ;

equations
Obj define objective function
Constr1 ;

obj .. z =e= sum((i,j),(power((dc1(i)-dc2(j)),2))*S(i,j))+p*alpha;

Constr1 .. sum((i,k),((At(k,i)*dc1(i))-ds(k))**2) =l= power(alpha,2) ;

model MODEL2 /ALL/ ;
dc1.up(i)=1;
dc1.lo(i)=0;
dc2.up(j)=1;
dc2.lo(j)=0;

Solve MODEL2 using nlp minimizing z ;
-
Best Regards,
Bilal