*--------------------------------------------------------------* * Univariate Polynomial - Test Problem 2 * *--------------------------------------------------------------* File res / results / ; Put res ; Sets i /1*50/; Parameters a(i) /1 -500.0 2 2.5 3 1.666666666 4 1.25 5 1.0 6 0.8333333 7 0.714285714 8 0.625 9 0.555555555 10 1.0 11 -43.6363636 12 0.41666666 13 0.384615384 14 0.357142857 15 0.3333333 16 0.3125 17 0.294117647 18 0.277777777 19 0.263157894 20 0.25 21 0.238095238 22 0.227272727 23 0.217391304 24 0.208333333 25 0.2 26 0.192307692 27 0.185185185 28 0.178571428 29 0.344827586 30 0.6666666 31 -15.48387097 32 0.15625 33 0.1515151 34 0.14705882 35 0.14285712 36 0.138888888 37 0.135135135 38 0.131578947 39 0.128205128 40 0.125 41 0.121951219 42 0.119047619 43 0.116279069 44 0.113636363 45 0.1111111 46 0.108695652 47 0.106382978 48 0.208333333 49 0.408163265 50 0.8/; Variables x f; x.lo = 1; x.up = 2; Equations Obj objective function; Obj .. f =e= sum(i, a(i)*power(x, ord(i))); Model problem /Obj/; x.l = 1.0911; solve problem using nlp minimizing f; PUT "Min f",f.l:16:10//; PUT "x ",x.l:16:10//;