* 1.731 optimality.gms * GAMS solution for Kuhn-Tucker example * suppress unnecessary printout *$offlisting $offsymxref $offsymlist option limrow=0 limcol=0 ; variables x1 x1 x2 x2 y objective ; * initialize to insure that GAMS starts with a feasible solution x1.l = 0.; x2.l = 1.5 ; equations constraint1 'constraint1' constraint2 'constraint2' objective 'objective function' ; * use 'power' function for squares since x1 can be negative constraint1.. x2 =g= 1+power(x1,2) ; constraint2.. x2 =l= 2 ; objective.. y =e= power(x1,2) + power(x2,2) ; model optimality /all/ ; solve optimality using nlp minimizing y ;