这类非线性优化问题还是1stOpt最方便:
1stOpt代码:
Parameter x(1:2)=[0,],X3=[188.16,196.8],x(4:5)=[0,],
x6=[0,188.16],x7=[0,],x8=[100.352,],x9=[0,];
ConstStr y = -3106.545+17.063*X1+352.300*X7-26.058*X8-74.626*X9;
MaxFunction y;
X2=27.060-0.258*X1+0.748*X7+1.394*X8;
Ln(X3)=0.551+0.742*Ln(X1)+0.328*Ln(X7)-0.096*Ln(max(0.001,y));
X4=22.031-0.048*X1+0.233*X7+0.094*X8;
Ln(X5)=-1.278+0.526*Ln(X1)+0.252*Ln(max(0.001,y));
X6=-16.678+0.282*X1+0.525*X8-0.131*X9;
X1+X2+X3+X4+X5+X6+X7+X8+X9=1254.4;
结果(爬山法或差分):
目标函数值(最大): 76033.5982217391
x1: 217.577885334593
x2: 276.514863997696
x3: 188.16
x4: 72.6352291917202
x5: 80.273169022847
x6: 97.3637636643695
x7: 221.523088788747
x8: 100.352000000027
x9: 2.31789500280682E-13
约束函数
1: x2-(27.060-0.258*x1+0.748*x7+1.394*x8) = 0
2: ln(x3)-(0.551+0.742*ln(x1)+0.328*ln(x7)-0.096*ln(max(0.001,(-3106.545+17.063*x1+352.300*x7-26.058*x8
-74.626*x9)))) = 0
3: x4-(22.031-0.048*x1+0.233*x7+0.094*x8) = 0
4: ln(x5)-(-1.278+0.526*ln(x1)+0.252*ln(max(0.001,(-3106.545+17.063*x1+352.300*x7-26.058*x8-74.626*x9)))) =
0
5: x6-(-16.678+0.282*x1+0.525*x8-0.131*x9) = 0
6: x1+x2+x3+x4+x5+x6+x7+x8+x9-(1254.4) = 0 |