matlab解多元非线性方程 lg(x1*x2/x4)=5.317-9393/1600lg(x1*x3/(1-x4))=5.9-16580/1600(0.002-x1)/(0.0989-x2)=48/x4*12(0.002-x1)/(0.0048-x3)=48/(1-x4)/14如何求解x1,x2,x3,x4

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/25 14:54:31
matlab解多元非线性方程 lg(x1*x2/x4)=5.317-9393/1600lg(x1*x3/(1-x4))=5.9-16580/1600(0.002-x1)/(0.0989-x2)=48/x4*12(0.002-x1)/(0.0048-x3)=48/(1-x4)/14如何求解x1,x2,x3,x4
xSN@:?[pePHqEjHό߭wβWs^8hۻ[;Η‹NzKL4/^̷s^k/̈Td8Tbre$KLC%fLhVbey01H FlCgAF DlUIf1@`rCY\C kRBMCL'V y ʳ}d7ɩ;X:^ŋ|wPJ/uKP@s{u$#o,

matlab解多元非线性方程 lg(x1*x2/x4)=5.317-9393/1600lg(x1*x3/(1-x4))=5.9-16580/1600(0.002-x1)/(0.0989-x2)=48/x4*12(0.002-x1)/(0.0048-x3)=48/(1-x4)/14如何求解x1,x2,x3,x4
matlab解多元非线性方程
lg(x1*x2/x4)=5.317-9393/1600
lg(x1*x3/(1-x4))=5.9-16580/1600
(0.002-x1)/(0.0989-x2)=48/x4*12
(0.002-x1)/(0.0048-x3)=48/(1-x4)/14
如何求解x1,x2,x3,x4

matlab解多元非线性方程 lg(x1*x2/x4)=5.317-9393/1600lg(x1*x3/(1-x4))=5.9-16580/1600(0.002-x1)/(0.0989-x2)=48/x4*12(0.002-x1)/(0.0048-x3)=48/(1-x4)/14如何求解x1,x2,x3,x4
分析
这是一个约束优化问题,可用fmincon求解.

参考代码
f = @(x)exp(8.864-267.893/abs(x(1)))+exp(11.271-1227.294/x(2))+exp(13.223-12277.294/x(3))+exp(11.925-3632.467/x(4));s = 10000;x = fmincon(@(x)-f(x),ones(1,4)*s/4,[],[],ones(1,4),s,zeros(1,4),ones(1,4)*inf,[]);x = num2str(x)f = f(x)

得到的最优解为:
x =
-3.3140659e-018 3088.6297 1.1046886e-018 6911.3703
f =
1.4204e+005

说明
1、最优解的x1、x3在浮点数误差意义上为0;
2、由于x1的结果是很小的负值,导致目标函数的y1为无穷大,所以该项的x1应加绝对值符号(x1-x4都应该是正数吧?不然任取哪一个为一个很小的正数,都会导致目标函数为无穷大).