[已解决] 1stopt计算非线性方程组的问题

[复制链接]
littleboat007 发表于 2022-11-18 15:36:29
以下是1stopt的代码,计算之后结果是:
Title "compute" = title compute
parameters B1,B2 ,B3 ,B4, B5 ,B6, B7 ,B8, C3, C4 ,h Function R1 = NAN
R2 = NAN
R3 = NAN
R4 = NAN
R5 = NAN
R6 = NAN
R7 = NAN
R8 = NAN
R9 = NAN
R10 = NAN
R11 = NAN
该如何解决?

计算代码:
Title "compute";
Constant
km=33.55,kb= 2,Ef= 8.3,If=7.95,C1=0,C2=0,m=0.5971,b=0.6058;

Parameters
B1,B2 ,B3 ,B4, B5 ,B6, B7 ,B8, C3, C4 ,h


Function
R1=-2*B4*Ef*If*m^2;

R2= -2*Ef*If*m^3*(B2 - B3);

R3= B1*cos(100*m)*cosh(100*m) + B2*cosh(100*m)*sin(100*m) + B3*cos(100*m)*sinh(100*m) + B4*sin(100*m)*sinh(100*m)-1;

R4= B5*cos(100*m)*cosh(100*m) + B6*cosh(100*m)*sin(100*m) + B7*cos(100*m)*sinh(100*m) + B8*sin(100*m)*sinh(100*m)-1;

R5= m*(2*B1*((cos(100*m)*sinh(100*m))/2 - (cosh(100*m)*sin(100*m))/2) + B2*(B3*(cos(100*m)*cosh(100*m) - sin(100*m)*sinh(100*m)) + 2*B4*((cos(100*m)*sinh(100*m))/2 + (cosh(100*m)*sin(100*m))/2) + cos(100*m)*cosh(100*m) + sin(100*m)*sinh(100*m))) - m*(B6*(cos(100*m)*cosh(100*m) + sin(100*m)*sinh(100*m)) + B7*(cos(100*m)*cosh(100*m) - sin(100*m)*sinh(100*m)) + 2*B5*((cos(100*m)*sinh(100*m))/2 - (cosh(100*m)*sin(100*m))/2) + 2*B8*((cos(100*m)*sinh(100*m))/2 + (cosh(100*m)*sin(100*m))/2));

R6= 2*Ef*If*m^2*(B8*cos(100*m)*cosh(100*m) + B6*cos(100*m)*sinh(100*m) - B7*cosh(100*m)*sin(100*m) - B5*sin(100*m)*sinh(100*m)) - 2*Ef*If*m^2*(B4*cos(100*m)*cosh(100*m) + B2*cos(100*m)*sinh(100*m) - B3*cosh(100*m)*sin(100*m) - B1*sin(100*m)*sinh(100*m));

R7= B5*cos((100+h)*m)*cosh((100+h)*m) + B6*cosh((100+h)*m)*sin((100+h)*m) + B7*cos((100+h)*m)*sinh((100+h)*m) + B8*sin((100+h)*m)*sinh((100+h)*m)-0.1;

R8= C1*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b)) + C3*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b)) + C2*(cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C4*(cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b))-0.1;

R9= m*(B6*(cos((100+h)*m)*cosh((100+h)*m) + sin((100+h)*m)*sinh((100+h)*m)) + B7*(cos((100+h)*m)*cosh((100+h)*m) - sin((100+h)*m)*sinh((100+h)*m)) + 2*B5*((cos((100+h)*m)*sinh((100+h)*m))/2 - (cosh((100+h)*m)*sin((100+h)*m))/2) + 2*B8*((cos((100+h)*m)*sinh((100+h)*m))/2 + (cosh((100+h)*m)*sin((100+h)*m))/2)) - b*(C2*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b) + cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C1*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b) - cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b)) - C3*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b) + cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b)) + C4*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b) - cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)));

R10= 2*Ef*If*b^2*(C2*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b)) - C4*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b)) - C1*(cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C3*(cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b))) - 2*Ef*If*m^2*(B8*cos((100+h)*m)*cosh((100+h)*m) + B6*cos((100+h)*m)*sinh((100+h)*m) - B7*cosh((100+h)*m)*sin((100+h)*m) - B5*sin((100+h)*m)*sinh((100+h)*m));

R11= 2*Ef*If*m^3*(C2*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b) - cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b)) - C1*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b) + cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C3*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b) - cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C4*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b) + cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b))) - 2*Ef*If*m^3*(B6*(cos((100+h)*m)*cosh((100+h)*m) - sin((100+h)*m)*sinh((100+h)*m)) - B7*(cos((100+h)*m)*cosh((100+h)*m) + sin((100+h)*m)*sinh((100+h)*m)) - 2*B5*((cos((100+h)*m)*sinh((100+h)*m))/2 + (cosh((100+h)*m)*sin((100+h)*m))/2) + 2*B8*((cos((100+h)*m)*sinh((100+h)*m))/2 - (cosh((100+h)*m)*sin((100+h)*m))/2));


最佳答案


shihe 发表于 2022-11-19 11:22:37
又看了下,楼主下面四个公式中:
  1. B1*cos(100*m)*cosh(100*m) + B2*cosh(100*m)*sin(100*m) + B3*cos(100*m)*sinh(100*m) + B4*sin(100*m)*sinh(100*m)+1;
  2. B5*cos(100*m)*cosh(100*m) + B6*cosh(100*m)*sin(100*m) + B7*cos(100*m)*sinh(100*m) + B8*sin(100*m)*sinh(100*m)-1;
  3. m*(2*B1*((cos(100*m)*sinh(100*m))/2 - (cosh(100*m)*sin(100*m))/2) + B2*(B3*(cos(100*m)*cosh(100*m) - sin(100*m)*sinh(100*m)) + 2*B4*((cos(100*m)*sinh(100*m))/2 + (cosh(100*m)*sin(100*m))/2) + cos(100*m)*cosh(100*m) + sin(100*m)*sinh(100*m))) - m*(B6*(cos(100*m)*cosh(100*m) + sin(100*m)*sinh(100*m)) + B7*(cos(100*m)*cosh(100*m) - sin(100*m)*sinh(100*m)) + 2*B5*((cos(100*m)*sinh(100*m))/2 - (cosh(100*m)*sin(100*m))/2) + 2*B8*((cos(100*m)*sinh(100*m))/2 + (cosh(100*m)*sin(100*m))/2));
  4. 2*Ef*If*m^2*(B8*cos(100*m)*cosh(100*m) + B6*cos(100*m)*sinh(100*m) - B7*cosh(100*m)*sin(100*m) - B5*sin(100*m)*sinh(100*m)) - 2*Ef*If*m^2*(B4*cos(100*m)*cosh(100*m) + B2*cos(100*m)*sinh(100*m) - B3*cosh(100*m)*sin(100*m) - B1*sin(100*m)*sinh(100*m));
复制代码


每个公式中的每一项都含有“cosh(100*m)”或“sinh(100*m)”,而这两项的的具体值为:4.27261261852282E25,因此直接计算几乎都是病态方程了,修正下,等式两边同除以“cosh(100*m)”或“sinh(100*m)”,就可以正常求解了
  1. Title "compute";
  2. Constant km=33.55,kb= 2,Ef= 8.3,If=7.95,C1=0,C2=0,m=0.5971,b=0.6058;
  3. Parameters B1,B2 ,B3 ,B4, B5 ,B6, B7 ,B8, C3, C4 ,h;
  4. Function
  5. -2*B4*Ef*If*m^2;
  6. -2*Ef*If*m^3*(B2 - B3);
  7. (B1*cos(100*m)*cosh(100*m) + B2*cosh(100*m)*sin(100*m) + B3*cos(100*m)*sinh(100*m) + B4*sin(100*m)*sinh(100*m)+1)/sinh(100*m);
  8. (B5*cos(100*m)*cosh(100*m) + B6*cosh(100*m)*sin(100*m) + B7*cos(100*m)*sinh(100*m) + B8*sin(100*m)*sinh(100*m)-1)/sinh(100*m);
  9. (m*(2*B1*((cos(100*m)*sinh(100*m))/2 - (cosh(100*m)*sin(100*m))/2) + B2*(B3*(cos(100*m)*cosh(100*m) - sin(100*m)*sinh(100*m)) + 2*B4*((cos(100*m)*sinh(100*m))/2 + (cosh(100*m)*sin(100*m))/2) + cos(100*m)*cosh(100*m) + sin(100*m)*sinh(100*m))) - m*(B6*(cos(100*m)*cosh(100*m) + sin(100*m)*sinh(100*m)) + B7*(cos(100*m)*cosh(100*m) - sin(100*m)*sinh(100*m)) + 2*B5*((cos(100*m)*sinh(100*m))/2 - (cosh(100*m)*sin(100*m))/2) + 2*B8*((cos(100*m)*sinh(100*m))/2 + (cosh(100*m)*sin(100*m))/2)))/sinh(100*m);
  10. (2*Ef*If*m^2*(B8*cos(100*m)*cosh(100*m) + B6*cos(100*m)*sinh(100*m) - B7*cosh(100*m)*sin(100*m) - B5*sin(100*m)*sinh(100*m)) - 2*Ef*If*m^2*(B4*cos(100*m)*cosh(100*m) + B2*cos(100*m)*sinh(100*m) - B3*cosh(100*m)*sin(100*m) - B1*sin(100*m)*sinh(100*m)))/sinh(100*m);
  11. B5*cos((100+h)*m)*cosh((100+h)*m) + B6*cosh((100+h)*m)*sin((100+h)*m) + B7*cos((100+h)*m)*sinh((100+h)*m) + B8*sin((100+h)*m)*sinh((100+h)*m)-0.1;
  12. C1*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b)) + C3*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b)) + C2*(cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C4*(cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b))-0.1;
  13. m*(B6*(cos((100+h)*m)*cosh((100+h)*m) + sin((100+h)*m)*sinh((100+h)*m)) + B7*(cos((100+h)*m)*cosh((100+h)*m) - sin((100+h)*m)*sinh((100+h)*m)) + 2*B5*((cos((100+h)*m)*sinh((100+h)*m))/2 - (cosh((100+h)*m)*sin((100+h)*m))/2) + 2*B8*((cos((100+h)*m)*sinh((100+h)*m))/2 + (cosh((100+h)*m)*sin((100+h)*m))/2)) - b*(C2*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b) + cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C1*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b) - cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b)) - C3*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b) + cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b)) + C4*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b) - cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)));
  14. 2*Ef*If*b^2*(C2*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b)) - C4*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b)) - C1*(cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C3*(cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b))) - 2*Ef*If*m^2*(B8*cos((100+h)*m)*cosh((100+h)*m) + B6*cos((100+h)*m)*sinh((100+h)*m) - B7*cosh((100+h)*m)*sin((100+h)*m) - B5*sin((100+h)*m)*sinh((100+h)*m));
  15. 2*Ef*If*m^3*(C2*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b) - cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b)) - C1*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b) + cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C3*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b) - cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C4*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b) + cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b))) - 2*Ef*If*m^3*(B6*(cos((100+h)*m)*cosh((100+h)*m) - sin((100+h)*m)*sinh((100+h)*m)) - B7*(cos((100+h)*m)*cosh((100+h)*m) + sin((100+h)*m)*sinh((100+h)*m)) - 2*B5*((cos((100+h)*m)*sinh((100+h)*m))/2 + (cosh((100+h)*m)*sin((100+h)*m))/2) + 2*B8*((cos((100+h)*m)*sinh((100+h)*m))/2 - (cosh((100+h)*m)*sin((100+h)*m))/2));
复制代码


结果:
  1. Objective Function (Min.): 1.50136555987161E-10
  2. b1: -2.04209242317924E-5
  3. b2: 2.60288632820075E-5
  4. b3: 2.60211233126103E-5
  5. b4: 1.97891331435315E-11
  6. b5: -3.23326571654913
  7. b6: -3.23370939151454
  8. b7: 3.23326330040786
  9. b8: 3.23373526208103
  10. c3: -3.2065663721455
  11. c4: -3.59813498828131
  12. h: -93.6141537791478
复制代码


4 条回复


shihe 发表于 2022-11-19 10:44:28
改成如下:
  1. Title "compute";
  2. Constant
  3. km=33.55,kb= 2,Ef= 8.3,If=7.95,C1=0,C2=0,m=0.5971,b=0.6058;
  4. Parameters B1,B2 ,B3 ,B4, B5 ,B6, B7 ,B8, C3, C4 ,h;
  5. Function
  6. -2*B4*Ef*If*m^2;
  7. -2*Ef*If*m^3*(B2 - B3);
  8. B1*cos(100*m)*cosh(100*m) + B2*cosh(100*m)*sin(100*m) + B3*cos(100*m)*sinh(100*m) + B4*sin(100*m)*sinh(100*m)-1;
  9. B5*cos(100*m)*cosh(100*m) + B6*cosh(100*m)*sin(100*m) + B7*cos(100*m)*sinh(100*m) + B8*sin(100*m)*sinh(100*m)-1;
  10. m*(2*B1*((cos(100*m)*sinh(100*m))/2 - (cosh(100*m)*sin(100*m))/2) + B2*(B3*(cos(100*m)*cosh(100*m) - sin(100*m)*sinh(100*m)) + 2*B4*((cos(100*m)*sinh(100*m))/2 + (cosh(100*m)*sin(100*m))/2) + cos(100*m)*cosh(100*m) + sin(100*m)*sinh(100*m))) - m*(B6*(cos(100*m)*cosh(100*m) + sin(100*m)*sinh(100*m)) + B7*(cos(100*m)*cosh(100*m) - sin(100*m)*sinh(100*m)) + 2*B5*((cos(100*m)*sinh(100*m))/2 - (cosh(100*m)*sin(100*m))/2) + 2*B8*((cos(100*m)*sinh(100*m))/2 + (cosh(100*m)*sin(100*m))/2));
  11. 2*Ef*If*m^2*(B8*cos(100*m)*cosh(100*m) + B6*cos(100*m)*sinh(100*m) - B7*cosh(100*m)*sin(100*m) - B5*sin(100*m)*sinh(100*m)) - 2*Ef*If*m^2*(B4*cos(100*m)*cosh(100*m) + B2*cos(100*m)*sinh(100*m) - B3*cosh(100*m)*sin(100*m) - B1*sin(100*m)*sinh(100*m));
  12. B5*cos((100+h)*m)*cosh((100+h)*m) + B6*cosh((100+h)*m)*sin((100+h)*m) + B7*cos((100+h)*m)*sinh((100+h)*m) + B8*sin((100+h)*m)*sinh((100+h)*m)-0.1;
  13. C1*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b)) + C3*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b)) + C2*(cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C4*(cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b))-0.1;
  14. m*(B6*(cos((100+h)*m)*cosh((100+h)*m) + sin((100+h)*m)*sinh((100+h)*m)) + B7*(cos((100+h)*m)*cosh((100+h)*m) - sin((100+h)*m)*sinh((100+h)*m)) + 2*B5*((cos((100+h)*m)*sinh((100+h)*m))/2 - (cosh((100+h)*m)*sin((100+h)*m))/2) + 2*B8*((cos((100+h)*m)*sinh((100+h)*m))/2 + (cosh((100+h)*m)*sin((100+h)*m))/2)) - b*(C2*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b) + cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C1*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b) - cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b)) - C3*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b) + cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b)) + C4*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b) - cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)));
  15. 2*Ef*If*b^2*(C2*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b)) - C4*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b)) - C1*(cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C3*(cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b))) - 2*Ef*If*m^2*(B8*cos((100+h)*m)*cosh((100+h)*m) + B6*cos((100+h)*m)*sinh((100+h)*m) - B7*cosh((100+h)*m)*sin((100+h)*m) - B5*sin((100+h)*m)*sinh((100+h)*m));
  16. 2*Ef*If*m^3*(C2*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b) - cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b)) - C1*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b) + cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C3*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b) - cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C4*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b) + cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b))) - 2*Ef*If*m^3*(B6*(cos((100+h)*m)*cosh((100+h)*m) - sin((100+h)*m)*sinh((100+h)*m)) - B7*(cos((100+h)*m)*cosh((100+h)*m) + sin((100+h)*m)*sinh((100+h)*m)) - 2*B5*((cos((100+h)*m)*sinh((100+h)*m))/2 + (cosh((100+h)*m)*sin((100+h)*m))/2) + 2*B8*((cos((100+h)*m)*sinh((100+h)*m))/2 - (cosh((100+h)*m)*sin((100+h)*m))/2));
复制代码

应该无解吧:
  1. Objective Function (Min.): 2.02
  2. b1: 0
  3. b2: 0
  4. b3: 0
  5. b4: 0
  6. b5: 0
  7. b6: 0
  8. b7: 0
  9. b8: 0
  10. c3: 0
  11. c4: 0
  12. h: 0
复制代码

目标函数趋近于0才表示有解

shihe 发表于 2022-11-19 10:50:57
本帖最后由 shihe 于 2022-11-19 10:54 编辑

感觉下面两个式子有问题:
  1. B1*cos(100*m)*cosh(100*m) + B2*cosh(100*m)*sin(100*m) + B3*cos(100*m)*sinh(100*m) + B4*sin(100*m)*sinh(100*m)-1;
  2. B5*cos(100*m)*cosh(100*m) + B6*cosh(100*m)*sin(100*m) + B7*cos(100*m)*sinh(100*m) + B8*sin(100*m)*sinh(100*m)-1;
复制代码

仔细检查下

shihe 发表于 2022-11-19 11:22:37
又看了下,楼主下面四个公式中:
  1. B1*cos(100*m)*cosh(100*m) + B2*cosh(100*m)*sin(100*m) + B3*cos(100*m)*sinh(100*m) + B4*sin(100*m)*sinh(100*m)+1;
  2. B5*cos(100*m)*cosh(100*m) + B6*cosh(100*m)*sin(100*m) + B7*cos(100*m)*sinh(100*m) + B8*sin(100*m)*sinh(100*m)-1;
  3. m*(2*B1*((cos(100*m)*sinh(100*m))/2 - (cosh(100*m)*sin(100*m))/2) + B2*(B3*(cos(100*m)*cosh(100*m) - sin(100*m)*sinh(100*m)) + 2*B4*((cos(100*m)*sinh(100*m))/2 + (cosh(100*m)*sin(100*m))/2) + cos(100*m)*cosh(100*m) + sin(100*m)*sinh(100*m))) - m*(B6*(cos(100*m)*cosh(100*m) + sin(100*m)*sinh(100*m)) + B7*(cos(100*m)*cosh(100*m) - sin(100*m)*sinh(100*m)) + 2*B5*((cos(100*m)*sinh(100*m))/2 - (cosh(100*m)*sin(100*m))/2) + 2*B8*((cos(100*m)*sinh(100*m))/2 + (cosh(100*m)*sin(100*m))/2));
  4. 2*Ef*If*m^2*(B8*cos(100*m)*cosh(100*m) + B6*cos(100*m)*sinh(100*m) - B7*cosh(100*m)*sin(100*m) - B5*sin(100*m)*sinh(100*m)) - 2*Ef*If*m^2*(B4*cos(100*m)*cosh(100*m) + B2*cos(100*m)*sinh(100*m) - B3*cosh(100*m)*sin(100*m) - B1*sin(100*m)*sinh(100*m));
复制代码


每个公式中的每一项都含有“cosh(100*m)”或“sinh(100*m)”,而这两项的的具体值为:4.27261261852282E25,因此直接计算几乎都是病态方程了,修正下,等式两边同除以“cosh(100*m)”或“sinh(100*m)”,就可以正常求解了
  1. Title "compute";
  2. Constant km=33.55,kb= 2,Ef= 8.3,If=7.95,C1=0,C2=0,m=0.5971,b=0.6058;
  3. Parameters B1,B2 ,B3 ,B4, B5 ,B6, B7 ,B8, C3, C4 ,h;
  4. Function
  5. -2*B4*Ef*If*m^2;
  6. -2*Ef*If*m^3*(B2 - B3);
  7. (B1*cos(100*m)*cosh(100*m) + B2*cosh(100*m)*sin(100*m) + B3*cos(100*m)*sinh(100*m) + B4*sin(100*m)*sinh(100*m)+1)/sinh(100*m);
  8. (B5*cos(100*m)*cosh(100*m) + B6*cosh(100*m)*sin(100*m) + B7*cos(100*m)*sinh(100*m) + B8*sin(100*m)*sinh(100*m)-1)/sinh(100*m);
  9. (m*(2*B1*((cos(100*m)*sinh(100*m))/2 - (cosh(100*m)*sin(100*m))/2) + B2*(B3*(cos(100*m)*cosh(100*m) - sin(100*m)*sinh(100*m)) + 2*B4*((cos(100*m)*sinh(100*m))/2 + (cosh(100*m)*sin(100*m))/2) + cos(100*m)*cosh(100*m) + sin(100*m)*sinh(100*m))) - m*(B6*(cos(100*m)*cosh(100*m) + sin(100*m)*sinh(100*m)) + B7*(cos(100*m)*cosh(100*m) - sin(100*m)*sinh(100*m)) + 2*B5*((cos(100*m)*sinh(100*m))/2 - (cosh(100*m)*sin(100*m))/2) + 2*B8*((cos(100*m)*sinh(100*m))/2 + (cosh(100*m)*sin(100*m))/2)))/sinh(100*m);
  10. (2*Ef*If*m^2*(B8*cos(100*m)*cosh(100*m) + B6*cos(100*m)*sinh(100*m) - B7*cosh(100*m)*sin(100*m) - B5*sin(100*m)*sinh(100*m)) - 2*Ef*If*m^2*(B4*cos(100*m)*cosh(100*m) + B2*cos(100*m)*sinh(100*m) - B3*cosh(100*m)*sin(100*m) - B1*sin(100*m)*sinh(100*m)))/sinh(100*m);
  11. B5*cos((100+h)*m)*cosh((100+h)*m) + B6*cosh((100+h)*m)*sin((100+h)*m) + B7*cos((100+h)*m)*sinh((100+h)*m) + B8*sin((100+h)*m)*sinh((100+h)*m)-0.1;
  12. C1*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b)) + C3*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b)) + C2*(cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C4*(cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b))-0.1;
  13. m*(B6*(cos((100+h)*m)*cosh((100+h)*m) + sin((100+h)*m)*sinh((100+h)*m)) + B7*(cos((100+h)*m)*cosh((100+h)*m) - sin((100+h)*m)*sinh((100+h)*m)) + 2*B5*((cos((100+h)*m)*sinh((100+h)*m))/2 - (cosh((100+h)*m)*sin((100+h)*m))/2) + 2*B8*((cos((100+h)*m)*sinh((100+h)*m))/2 + (cosh((100+h)*m)*sin((100+h)*m))/2)) - b*(C2*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b) + cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C1*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b) - cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b)) - C3*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b) + cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b)) + C4*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b) - cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)));
  14. 2*Ef*If*b^2*(C2*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b)) - C4*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b)) - C1*(cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C3*(cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b))) - 2*Ef*If*m^2*(B8*cos((100+h)*m)*cosh((100+h)*m) + B6*cos((100+h)*m)*sinh((100+h)*m) - B7*cosh((100+h)*m)*sin((100+h)*m) - B5*sin((100+h)*m)*sinh((100+h)*m));
  15. 2*Ef*If*m^3*(C2*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b) - cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b)) - C1*(cos((100+h)*b)*cosh((100+h)*b) + cos((100+h)*b)*sinh((100+h)*b) + cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C3*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b) - cosh((100+h)*b)*sin((100+h)*b) + sin((100+h)*b)*sinh((100+h)*b)) + C4*(cos((100+h)*b)*cosh((100+h)*b) - cos((100+h)*b)*sinh((100+h)*b) + cosh((100+h)*b)*sin((100+h)*b) - sin((100+h)*b)*sinh((100+h)*b))) - 2*Ef*If*m^3*(B6*(cos((100+h)*m)*cosh((100+h)*m) - sin((100+h)*m)*sinh((100+h)*m)) - B7*(cos((100+h)*m)*cosh((100+h)*m) + sin((100+h)*m)*sinh((100+h)*m)) - 2*B5*((cos((100+h)*m)*sinh((100+h)*m))/2 + (cosh((100+h)*m)*sin((100+h)*m))/2) + 2*B8*((cos((100+h)*m)*sinh((100+h)*m))/2 - (cosh((100+h)*m)*sin((100+h)*m))/2));
复制代码


结果:
  1. Objective Function (Min.): 1.50136555987161E-10
  2. b1: -2.04209242317924E-5
  3. b2: 2.60288632820075E-5
  4. b3: 2.60211233126103E-5
  5. b4: 1.97891331435315E-11
  6. b5: -3.23326571654913
  7. b6: -3.23370939151454
  8. b7: 3.23326330040786
  9. b8: 3.23373526208103
  10. c3: -3.2065663721455
  11. c4: -3.59813498828131
  12. h: -93.6141537791478
复制代码


回复此楼

littleboat007 发表于 2022-11-19 14:26:08
shihe 发表于 2022-11-19 11:22
又看了下,楼主下面四个公式中:

感谢大佬给的建议,我在尝试修改一下方程吧,这个计算出来的记过还是有点不太复合实际。h应该是正的,应该是方程的问题
您需要登录后才可以回帖 登录 | 注册

本版积分规则

相关帖子
相关文章
热门教程
站长推荐
快速回复 返回顶部 返回列表