*==> colvdual.gms $TITLE Dual Of Colville Problem Number 2 $offsymxref offsymlist offuellist offuelxref $inlinecom /* */ $ontext This NCP is constructed from the following NLP: min -b'x + y'Qy + 2 * sum_j d[j]*y[j]**3 s.t. A'x <= c + 2Qy + 3*diag(d)*diag(y)*y y >= 0 x >= 0 If we formulate the KKT conditions, we get the complementarity problem below. $offtext $include 'colville.dat' set run / run1 * run4 /; parameter xinit(K,run), yinit(M,run), includerun (run) / run1 01 run2 01 run3 01 run4 01 / ; table xinit (K,run) run1 run2 run3 run4 1 2 3 5.17404 4 5 3.0611087 6 11.8395454 7 8 9 .103894 10 ; table yinit (M, run) run1 run2 run3 run4 1 .3 2 .3334676 3 .4 4 .4283101 5 .223964 ; * start point 1 xinit(K,"run1") = 0.0001; xinit("7","run1") = 60; yinit(M,"run1") = 0.0001; * start point 2 xinit(K,"run2") = B(K); yinit(M,"run2") = 0; yinit("5","run2") = 1; positive variables x(K) primal variables y(M) more primal variables u(M) dual variables ; equations delx(K) del_x f + del_x g * u dely(M) del_y f + del_y g * u cs(M) constraint slacks ; delx(K) .. sum(M,A(K,M)*u(M)) - B(K) =G= 0.0; dely(M) .. 2.0*sum(I,Q(M,I)*y(I)) + 6.0*SQR(y(M))*d(M) - 2.0*sum(I,Q(M,I)*u(I)) - 6.0*u(M)*d(M)*y(M) =G= 0.0; cs(M) .. c(M) + 2.0*sum(I,Q(M,I)*y(I)) + 3.0*d(M)*SQR(Y(M)) - sum(K,A(K,M)*x(K)) =G= 0.0; model colvdual / delx.x, dely.y, cs.u /; option limrow = 0; option limcol = 0; option iterlim = 2000; option reslim = 120; loop (run, if (includerun(run), x.l(K) = xinit(K,run); y.l(M) = yinit(M,run); u.l(M) = yinit(M,run); solve colvdual using mcp; ));