*--------------------------------------------------------------* * Quadratically Constrained - Test Problem 3 * *--------------------------------------------------------------* File res / results / ; Put res ; Sets i /1*6/; Variables x(i) f; x.lo('1') = 0; x.lo('2') = 0; x.lo('3') = 1; x.lo('4') = 0; x.lo('5') = 1; x.lo('6') = 0; x.up('3') = 5; x.up('4') = 6; x.up('5') = 5; x.up('6') = 10; Equations Obj objective function Con1 constraint function 1 Con2 constraint function 2 Con3 constraint function 3 Con4 constraint function 4 Con5 constraint function 5 Con6 constraint function 6; Obj .. f =e= -25*power(x('1')-2,2) - power(x('2')-2,2) - power(x('3')-1,2) - power(x('4')-4,2) - power(x('5')-1,2) - power(x('6')-4,2); Con1 .. power(x('3')-3,2) + x('4') =g= 4; Con2 .. power(x('5')-3,2) + x('6') =g= 4; Con3 .. x('1') - 3*x('2') =l= 2; Con4 .. -x('1') + x('2') =l= 2; Con5 .. x('1') + x('2') =l= 6; Con6 .. x('1') + x('2') =g= 2; Model problem /Obj, Con1, Con2, Con3, Con4, Con5, Con6/; x.l('1') = 5; x.l('2') = 1; x.l('3') = 5; x.l('4') = 0; x.l('5') = 5; x.l('6') = 10; solve problem using nlp minimizing f; PUT "Min f",f.l:16:10//; Loop(i, PUT "x ",x.l(i):16:10//);