求助,我们想利用LINGO求解一个复杂非线性方程组,lingo的解是错的,想问问有什么解决方案。程序见下 150
sets:function/1..23/:f,x;endsetsdata:v=36;g=9.8;G1=9800;G2=98;G3=980;G4=11760;G5=1512...
sets:
function/1..23/:f,x;
endsets
data:
v=36;
g=9.8;
G1=9800;
G2=98;
G3=980;
G4=11760;
G5=1512.63;
F2=78.85325;
F3=710.0392;
w=68.6;
l=22.05;
H=18;
pi=3.14;
enddata
max=@sum(function(i):@abs(f(i)));
f(1)=1.25*(2-x(20))*(v^2)-x(13)*@cos(x(1));
f(2)=(1025*pi*x(20)*g)-(x(13)*@sin(x(1))+G1);
f(3)=x(20)+@sin(x(8))+@sin(x(9))+@sin(x(10))+@sin(x(11))+@sin(x(12))+x(21)-H;
@for(function(i)|i#le#4:f(3*i+1)=x(i+12)*@sin(x(i)-x(i+7))-(G2-F2)*@cos(x(i+7))/2);
@for(function(i)|i#le#4:f(3*i+2)=(G2+x(i+13)*@sin(x(i+1)))-(F2+x(i+12)*@sin(x(i))));
@for(function(i)|i#le#4:f(3*i+3)=x(i+12)*@cos(x(i))-x(i+13)*@cos(x(i+1)));
f(16)=(G3-F3)*@cos(x(12))/2-x(17)*@sin(x(5)-x(12));
f(17)=(F3+x(17)*@sin(x(5)))-(G3+G4+x(18)*@sin(x(6)));
f(18)=x(17)*@cos(x(5))-x(18)*@cos(x(6));
f(19)=x(18)*@sin(x(6))-(G5+x(19)*@sin(x(7)));
f(20)=x(18)*@cos(x(6))-x(19)*@cos(x(7));
f(21)=l-x(19)*@cos(x(7))*@sinh(x(22)*w/(x(19)*@cos(x(7))))/w;
f(22)=@tan(x(7))-@sinh(x(23)*w/(x(19)*@cos(x(7))));
f(23)=x(19)*@cos(x(7))*@cosh((x(22)+x(23))*w/x(19)*@cos(x(7)))/w-x(19)*@cos(x(7))*@cosh(x(23)*w/x(19)*@cos(x(7)))/w-x(21);
@for(function(i)|i#le#12:x(i)<pi/2);
@for(function(i):f(i)=0);
写错了,目标函数是min,但是算出来依然不正确 展开
function/1..23/:f,x;
endsets
data:
v=36;
g=9.8;
G1=9800;
G2=98;
G3=980;
G4=11760;
G5=1512.63;
F2=78.85325;
F3=710.0392;
w=68.6;
l=22.05;
H=18;
pi=3.14;
enddata
max=@sum(function(i):@abs(f(i)));
f(1)=1.25*(2-x(20))*(v^2)-x(13)*@cos(x(1));
f(2)=(1025*pi*x(20)*g)-(x(13)*@sin(x(1))+G1);
f(3)=x(20)+@sin(x(8))+@sin(x(9))+@sin(x(10))+@sin(x(11))+@sin(x(12))+x(21)-H;
@for(function(i)|i#le#4:f(3*i+1)=x(i+12)*@sin(x(i)-x(i+7))-(G2-F2)*@cos(x(i+7))/2);
@for(function(i)|i#le#4:f(3*i+2)=(G2+x(i+13)*@sin(x(i+1)))-(F2+x(i+12)*@sin(x(i))));
@for(function(i)|i#le#4:f(3*i+3)=x(i+12)*@cos(x(i))-x(i+13)*@cos(x(i+1)));
f(16)=(G3-F3)*@cos(x(12))/2-x(17)*@sin(x(5)-x(12));
f(17)=(F3+x(17)*@sin(x(5)))-(G3+G4+x(18)*@sin(x(6)));
f(18)=x(17)*@cos(x(5))-x(18)*@cos(x(6));
f(19)=x(18)*@sin(x(6))-(G5+x(19)*@sin(x(7)));
f(20)=x(18)*@cos(x(6))-x(19)*@cos(x(7));
f(21)=l-x(19)*@cos(x(7))*@sinh(x(22)*w/(x(19)*@cos(x(7))))/w;
f(22)=@tan(x(7))-@sinh(x(23)*w/(x(19)*@cos(x(7))));
f(23)=x(19)*@cos(x(7))*@cosh((x(22)+x(23))*w/x(19)*@cos(x(7)))/w-x(19)*@cos(x(7))*@cosh(x(23)*w/x(19)*@cos(x(7)))/w-x(21);
@for(function(i)|i#le#12:x(i)<pi/2);
@for(function(i):f(i)=0);
写错了,目标函数是min,但是算出来依然不正确 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询