*--------------------------------------------------------------* * Quadratically Constrained - Test Problem 2 * *--------------------------------------------------------------* File res / results / ; Put res ; Sets i /1*5/; Variables x(i) f; x.lo('1') = 78; x.up('1') = 102; x.lo('2') = 33; x.up('2') = 45; Loop(i $ (ord(i) ge 3), x.lo(i) = 27; x.up(i) = 45); 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= 37.293239*x('1') + 0.8356891*x('1')*x('5') + 5.3578547*x('3')*x('3') - 40792.141; Con1 .. -0.0022053*x('3')*x('5') + 0.0056858*x('2')*x('5') + 0.0006262*x('1')*x('4') - 6.665593 =l= 0; Con2 .. 0.0022053*x('3')*x('5') - 0.0056858*x('2')*x('5') - 0.0006262*x('1')*x('4') - 85.334407 =l= 0; Con3 .. 0.0071317*x('2')*x('5') + 0.0021813*x('3')*x('3') + 0.0029955*x('1')*x('2') - 29.48751 =l= 0; Con4 .. -0.0071317*x('2')*x('5') - 0.0021813*x('3')*x('3') - 0.0029955*x('1')*x('2') + 9.48751 =l= 0; Con5 .. 0.0047026*x('3')*x('5') + 0.0019085*x('3')*x('4') + 0.0012547*x('1')*x('3') - 15.599039 =l= 0; Con6 .. -0.0047026*x('3')*x('5') - 0.0019085*x('3')*x('4') - 0.0012547*x('1')*x('3') + 10.699039 =l= 0; Model problem /Obj, Con1, Con2, Con3, Con4, Con5, Con6/; x.l('1') = 78; x.l('2') = 33; x.l('3') = 29.9953; x.l('4') = 45; x.l('5') = 36.7758; solve problem using nlp minimizing f; PUT "Min f",f.l:16:10//; Loop(i, PUT "x ",x.l(i):16:10//);