求助!!1stopt解非线性方程组
第一次用,纯新手。解方程组。编程如下,要解出来X1,X2,X3。运算不了,一直提示常数定义有误。不知道书写还是哪里出错了。急寻帮助。!!谢谢了//Parameters x1,x2,x3;
//Function 0.0167*exp(2*x1)-0.0159*exp(x1)+1.0515*exp(2*x2)-0.1355*exp(x2)+5.7379*exp(2*x3)-0.4025*exp(x3)=0;
0.1723*exp(2*x1)-0.0443*exp(x1)+1.0217*exp(2*x2)-0.1317*exp(x2)+78.124*exp(2*x3)-5.7252*exp(x3)=0;
0.03849*exp(2*x1)-0.0099*exp(x1)+0.8214*exp(2*x2)-0.1058*exp(x2)+4.723*exp(2*x3)-0.3461*exp(x3)=0;
把注释符“//”去掉即可。 dingd 发表于 2013-4-3 09:03 static/image/common/back.gif
把注释符“//”去掉即可。
你好,我用1stopt解方程组,为什么多次解不一样呢,是线性方程,代码如下,请求帮忙看一下吧。谢谢
Title "Type your title here";
Parameters a,b,c,d,e,f ;
//Variable ;
Function 2*10.282*(0.241+10.282*a+1.077*b+0.890*c+15.484*d+119.87*e-f)+2*9.928*(-0.00523+9.928*a+0.765*b+0.923*c+13.995*d+97.93*e-f)+2*8.31*
(-0.297+8.31*a+1.039*b+0.908*c+11.36*d+64.49*e-f)+2*22.764*(-0.420+22.764*a-9.945*b+1.104*c+29.82*d+444.74*e-f)+2*15.434*(-0.292+15.434*a-2.95*b+1.039*c
+20.38*d+207.76*e-f)+2*21.074*(-0.565+21.074*a-8.87*b+1.1*c+27.22*d+370.51*e-f)+2*22.42*(-0.890+22.42*a-11.67*b+1.13*c+28.27*d+399.73*e-f)
+2*6.626*(-1.453+6.626*a+0.924*b+0.983*c+6.95*d+24.153*e-f)+2*6.40*(-3.704+6.40*a+0.802*b+1.136*c+4.41*d+9.71*e-f)
+2*15.31*(0.037+15.31*a-1.942*b+1.007*c+21.13*d+223.19*e-f)+2*22.886*(-0.407+22.887*a-10.007*b+1.1*c+30.02*d+450.62*e-f)
+2*2.61*(-3.6194+2.61*a-12.83*b)=0;
2*1.077*(0.241+10.282*a+1.077*b+0.890*c+15.484*d+119.87*e-f)+2*0.765* (-0.00523+9.928*a+0.765*b+0.923*c+13.995*d+97.93*e-f)
+2*1.039*(-0.297+8.31*a+1.039*b+0.908*c+11.36*d+64.49*e-f)+2*(-9.945)* (-0.420+22.764*a-9.945*b+1.104*c+29.82*d+444.74*e-f)
-2*2.950*(-0.292+15.434*a-2.95*b+1.039*c+20.38*d+207.76*e-f) -2*8.87* (-0.565+21.074*a-8.87*b+1.1*c+27.22*d+370.51*e-f)
-2*11.67*(-0.890+22.42*a-11.67*b+1.13*c+28.27*d+399.73*e-f)+2*0.924* (-1.453+6.626*a+0.924*b+0.983*c+6.95*d+24.153*e-f)
+2*0.802* (-3.704+6.40*a+0.802*b+1.136*c+4.41*d+9.71*e-f)-2*1.942*(0.037+15.31*a-1.942*b+1.007*c+21.13*d+223.19*e-f)
-2*10.007* (-0.407+22.887*a-10.007*b+1.1*c+30.02*d+450.62*e-f) -2*12.83* (-3.6194+2.61*a-12.83*b)=0;
2*0.890* (0.241+10.282*a+1.077*b+0.890*c+15.484*d+119.87*e-f)+2*0.923* (-0.00523+9.928*a+0.765*b+0.923*c+13.995*d+97.93*e-f)
+2*0.908*(-0.297+8.31*a+1.039*b+0.908*c+11.36*d+64.49*e-f)+2*1.104* (-0.420+22.764*a-9.945*b+1.104*c+29.82*d+444.74*e-f)
+2*1.039*(-0.292+15.434*a-2.95*b+1.039*c+20.38*d+207.76*e-f) +2*1.1* (-0.565+21.074*a-8.87*b+1.1*c+27.22*d+370.51*e-f)
+2*1.13*(-0.890+22.42*a-11.67*b+1.13*c+28.27*d+399.73*e-f)+2*0.983* (-1.453+6.626*a+0.924*b+0.983*c+6.95*d+24.153*e-f)
+2*1.136* (-3.704+6.40*a+0.802*b+1.136*c+4.41*d+9.71*e-f)+2*1.007*(0.037+15.31*a-1.942*b+1.007*c+21.13*d+223.19*e-f)
+2*1.1* (-0.407+22.887*a-10.007*b+1.1*c+30.02*d+450.62*e-f) =0;
2*15.484* (0.241+10.282*a+1.077*b+0.890*c+15.484*d+119.87*e-f)+2*13.995* (-0.00523+9.928*a+0.765*b+0.923*c+13.995*d+97.93*e-f)
+2*11.36*(-0.297+8.31*a+1.039*b+0.908*c+11.36*d+64.49*e-f)+2*29.82* (-0.420+22.764*a-9.945*b+1.104*c+29.82*d+444.74*e-f)
+2*20.38*(-0.292+15.434*a-2.95*b+1.039*c+20.38*d+207.76*e-f) +2*27.22* (-0.565+21.074*a-8.87*b+1.1*c+27.22*d+370.51*e-f)
+2*28.27*(-0.890+22.42*a-11.67*b+1.13*c+28.27*d+399.73*e-f)+2*6.95* (-1.453+6.626*a+0.924*b+0.983*c+6.95*d+24.153*e-f)
+2*4.41* (-3.704+6.40*a+0.802*b+1.136*c+4.41*d+9.71*e-f)+2*21.13*(0.037+15.31*a-1.942*b+1.007*c+21.13*d+223.19*e-f)
+2*30.02* (-0.407+22.887*a-10.007*b+1.1*c+30.02*d+450.62*e-f) =0;
2*119.87* (0.241+10.282*a+1.077*b+0.890*c+15.484*d+119.87*e-f)+2*97.93* (-0.00523+9.928*a+0.765*b+0.923*c+13.995*d+97.93*e-f)
+2*64.49*(-0.297+8.31*a+1.039*b+0.908*c+11.36*d+64.49*e-f)+2*444.74* (-0.420+22.764*a-9.945*b+1.104*c+29.82*d+444.74*e-f)
+2*207.76*(-0.292+15.434*a-2.95*b+1.039*c+20.38*d+207.76*e-f) +2*370.51* (-0.565+21.074*a-8.87*b+1.1*c+27.22*d+370.51*e-f)
+2*399.73*(-0.890+22.42*a-11.67*b+1.13*c+28.27*d+399.73*e-f)+2*24.153* (-1.453+6.626*a+0.924*b+0.983*c+6.95*d+24.153*e-f)
+2*9.71* (-3.704+6.40*a+0.802*b+1.136*c+4.41*d+9.71*e-f)+2*223.19*(0.037+15.31*a-1.942*b+1.007*c+21.13*d+223.19*e-f)
+2*450.62* (-0.407+22.887*a-10.007*b+1.1*c+30.02*d+450.62*e-f) =0;
(-2)* (0.241+10.282*a+1.077*b+0.890*c+15.484*d+119.87*e-f)-2* (-0.00523+9.928*a+0.765*b+0.923*c+13.995*d+97.93*e-f)
-2*(-0.297+8.31*a+1.039*b+0.908*c+11.36*d+64.49*e-f)-2*(-0.420+22.764*a-9.945*b+1.104*c+29.82*d+444.74*e-f)
-2* (-0.292+15.434*a-2.95*b+1.039*c+20.38*d+207.76*e-f) -2* (-0.565+21.074*a-8.87*b+1.1*c+27.22*d+370.51*e-f)
-2*(-0.890+22.42*a-11.67*b+1.13*c+28.27*d+399.73*e-f)-2* (-1.453+6.626*a+0.924*b+0.983*c+6.95*d+24.153*e-f)
-2*(-3.704+6.40*a+0.802*b+1.136*c+4.41*d+9.71*e-f)-2*(0.037+15.31*a-1.942*b+1.007*c+21.13*d+223.19*e-f)
-2*(-0.407+22.887*a-10.007*b+1.1*c+30.02*d+450.62*e-f) =0; 完全一样啊:
a: -2.03117249591328
b: -0.682865293573098
c: 25.0152298702476
d: 0.959530964403597
e: -0.00216837258619785
f: 15.5188901981356
页:
[1]