How to find solution of non-linear algebraic equations using MATLAB?

81 views Asked by At

I have 10 non-linear equation,

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

I do not have any initial guesses for the solutions, however, all variables are essentially non-negative i.e.,

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

I am trying to solve these equations by executing following command,

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]);

But it shows error as

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 
>> 

How to solve these nonlinear equations?

UPDATE: DIFF was actually the difference that would be a number, say 10, 20 or 30. I have removed DIFF from here.

1

There are 1 answers

2
Petr Pecha On

You have 10 equations, but you have 10 variables.

You can help by hand. Reduce linear equation:

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

and

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

then we get 4 equations on 4 variables:

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

and try to solve

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]);

I try to solve it, but I out of memory. It want to smarter method.