搜索内容 搜索用户

# [已解决] 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
 又看了下，楼主下面四个公式中： 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; 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; 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)); 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)”，就可以正常求解了 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 -2*B4*Ef*If*m^2; -2*Ef*If*m^3*(B2 - B3); (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); (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); (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); (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); 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; 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; 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))); 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)); 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));复制代码 结果： Objective Function (Min.): 1.50136555987161E-10 b1: -2.04209242317924E-5 b2: 2.60288632820075E-5 b3: 2.60211233126103E-5 b4: 1.97891331435315E-11 b5: -3.23326571654913 b6: -3.23370939151454 b7: 3.23326330040786 b8: 3.23373526208103 c3: -3.2065663721455 c4: -3.59813498828131 h: -93.6141537791478复制代码

4 条回复

## 倒序浏览

shihe 发表于 2022-11-19 10:44:28
 改成如下： 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 -2*B4*Ef*If*m^2; -2*Ef*If*m^3*(B2 - B3); 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; 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; 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)); 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)); 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; 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; 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))); 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)); 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)); 复制代码 应该无解吧： Objective Function (Min.): 2.02 b1: 0 b2: 0 b3: 0 b4: 0 b5: 0 b6: 0 b7: 0 b8: 0 c3: 0 c4: 0 h: 0复制代码 目标函数趋近于0才表示有解

shihe 发表于 2022-11-19 10:50:57
 本帖最后由 shihe 于 2022-11-19 10:54 编辑 感觉下面两个式子有问题： 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; 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
 又看了下，楼主下面四个公式中： 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; 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; 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)); 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)”，就可以正常求解了 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 -2*B4*Ef*If*m^2; -2*Ef*If*m^3*(B2 - B3); (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); (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); (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); (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); 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; 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; 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))); 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)); 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));复制代码 结果： Objective Function (Min.): 1.50136555987161E-10 b1: -2.04209242317924E-5 b2: 2.60288632820075E-5 b3: 2.60211233126103E-5 b4: 1.97891331435315E-11 b5: -3.23326571654913 b6: -3.23370939151454 b7: 3.23326330040786 b8: 3.23373526208103 c3: -3.2065663721455 c4: -3.59813498828131 h: -93.6141537791478复制代码

littleboat007 发表于 2022-11-19 14:26:08
 shihe 发表于 2022-11-19 11:22 又看了下，楼主下面四个公式中： 感谢大佬给的建议，我在尝试修改一下方程吧，这个计算出来的记过还是有点不太复合实际。h应该是正的，应该是方程的问题
 您需要登录后才可以回帖 登录 | 注册 本版积分规则 回帖后跳转到最后一页