如何使用MATLAB找到非线性代数方程的解?

时间:2016-12-31 07:48:11

标签: matlab equation nonlinear-optimization

我有10个非线性方程,

L1 + 1.3*3*(P1^0.3) + 2*P1 = 12
L2 + 1.2*5*(P2^0.2) + 3*P2 = 20
L3 + 1.15*6*(P3^0.15) + 5*P3 = 28
L4 - L1*0.9*0.4*(X1^-0.1) = 0
L4 - L2*0.8*0.5*(X2^-0.2) = 0
L4 - L3*0.7*0.6*(X3^-0.3) = 0
P1 - 0.4*(X1^0.9) = 0
P2 - 0.5*(X2^0.8) = 0
P3 - 0.6*(X3^0.7) = 0
X1 + X2 + X3 = 10

我对解决方案没有任何初步猜测,但是,所有变量基本上都是非负的,即

  

L1大于0,L2大于0,L3大于0,L4大于0,P1大于0,P2大于0,P3大于0,X1大于0,X2大于0,X3大于0

我试图通过执行以下命令来解决这些方程式,

clear 
clc

syms L1 L2 L3 L4 P1 P2 P3 X1 X2 X3

sol=solve([ L1 + 1.3*3*(P1^0.3) + 2*P1 == 12, L2 + 1.2*5*(P2^0.2) + 3*P2 == 20, L3 + 1.15*6*(P3^0.15) + 5*P3 == 28, ...
L4 - L1*0.9*0.4*(X1^-0.1) == 0, L4 - L2*0.8*0.5*(X2^-0.2) == 0, L4 - L3*0.7*0.6*(X3^-0.3) == 0, ...
P1 - 0.4*(X1^0.9) == 0, P2 - 0.5*(X2^0.8) == 0, P3 - 0.6*(X3^0.7) ==0, X1+X2 +X3 == 10, ...
L1>0, L2>0, L3>0, L4>0, P1>0, P2>0, P3>0, X1>0, X2>0, X3>0], [L1, L2, L3, L4, P1, P2, P3, X1, X2, X3]);

但它显示错误为

Warning: 32 equations in 11 variables. 
> In C:\Program Files\MATLAB\R2013a\toolbox\symbolic\symbolic\symengine.p>symengine at 56
  In mupadengine.mupadengine>mupadengine.evalin at 97
  In mupadengine.mupadengine>mupadengine.feval at 150
  In solve at 170 
Warning: Explicit solution could not be found. 
> In solve at 179 
>> 

如何解决这些非线性方程?

  

更新:DIFF实际上是一个数字的差异,比方说   10,20或30.我从这里删除了DIFF。

1 个答案:

答案 0 :(得分:0)

你有10个方程式,但你有10个变量。

你可以手工帮助。 减少线性方程:

P1 = 0.4(x^(0.9))
P2 = 0.5(x^(0.8))
P3 = 0.6(x^(0.7))

L4 = 0.36L1*X1^(-0.1) = 0.4L2*X2^(-0.2) = 0.42L3*X3^(-0.3)

然后我们得到4个变量的4个方程式:

L1 + 3.9*((0.4^(0.3))*X1^(0.27)) + 0.8*X1^(0.9) - 12 = 0
0.9*(X1^(-0.1))*(X2^(0.2))*L1 + 6*((0.5^0.2)*(x2^(0.16))) + 1.5*X2^(0.8) - 20 = 0
(6/7)*(X1^(-0.1))*(X3^(0.3))*L1 + 6.9*((0.6^0.15)*(X3^(0.105))) + 3*(x3^0.7) - 28 = 0
x1 + X2 + X3 = 10

并尝试解决

sol=solve([X1+X2+X3 == 10,L1 + 3.9*((0.4^(0.3))*X1^(0.27)) + 0.8*X1^(0.9) - 12 == 0, 0.9*(X1^(-0.1))*(X2^(0.2))*L1 + 6*((0.5^0.2)*(X2^(0.16))) + 1.5*X2^(0.8) - 20 == 0,(6/7)*(X1^(-0.1))*(X3^(0.3))*L1 + 6.9*((0.6^0.15)*(X3^(0.105))) + 3*(X3^0.7) - 28 == 0, X1 > 0, X2 > 0, X3 > 0, L1 > 0]);

我试着解决它,但我失去记忆。 它想要更聪明的方法。