i need to solve 7 nonlinear equations with 7 unknows
2 views (last 30 days)
Show older comments
G = 600:100:1200;
x0 = [300;300;300;300;300;300;300];
options = optimset('Display','off');
X(i) = NaN(1,length(G));
for i = 600:length(G)
fsol = fsolve(@(x) solutionsproblem(x,G(i)),x0,options);
X(i) = fsol(1);
end
function F = solutionsproblem(x,G)
Tg1 = 300;
Tg2 = 301.5;
Ta = 305.8;
Tl = 302;
Tf = 302;
Tb = 302;
Th = 300;
F(1) = 0.0425*G + 1.41*10^(-8)*x(2)^(4) + 1.34*x(2) - 9.12*10^(-9)*x(1)^(4) + 341 - 2402.77*x(1) + 2400*Tg1;
F(2) = 0.0204*G - (3.48*10^(-8) + 4.35*10^(-10)*1)*x(2)^(4) + 1.41*10^(-8)*x(1)^(4) + 8.01*10^(-11)* x(4)^(4) + 2.43*10^(-8)*x(3)^(4) + 4.35*10^(-10)*1*x(5)^(4) + 0.55*x(3) + 1.34*x(1) - 2401.87*x(2) + 2400*Tg2;
F(3) = 0.124*G - 4.88*10^(-8)*x(3)^(4) + 2.44*10^(-8)*1*x(2)^(4) + 2.44*10^(-8)*1*x(5)^(4)- 50.938*x(3) + 11.502*x(6) + 1.836* x(2) + 37.60*Ta;
F(4) = 0.011*G - 8.70*10^(-8)*x(5)^(4) + 4.35*10^(-10)*x(3)^(4)+ 4.35*10^(-10)*x(2)^(4) + 0.83*x(6) + 0.112*x(3) + 0.112*x(2) - (1.055 + (112.7/1))*x(5) + (112.7/1)*Tf;
F(5) = 2.17*10^(-3)*G - 1.6*10^(-10)*x(4)^(4) + 8.01*10^(-11)*x(7)^(4) + 8.01*10^(-11)*x(2)^(4) - 69.07*x(4) + 3.77*10^(-4)*x(7) + 0.02*x(3) + 0.02*x(2) + 69*Tl;
F(6) = -52.068*x(6) + 0.412*x(3) + 0.368*x(4)+ 0.368*x(5) + 0.46*x(2) + 50.78*Tb;
F(7)= 3.77*10^(-4)*x(4) + 8.01*10^(-11)*x(4)^(4) + 0.092*x(5) - 1254.1*x(7) - 8.01*10^(-11)*x(7)^(4) + 1254*Th;
end
2 Comments
Geoff Hayes
on 7 Apr 2020
Bindhu - what is your question? Is there an error with the above or is something else wrong? Please clarify.
John D'Errico
on 7 Apr 2020
I have a question: is there any meaning in the result if a solution is found? Why do I say that?
I ask my leading question because there won't be any meaning that can be attributed. That because the coefficients in this complex mess of equations are only significant to 3 decimal places. Yet the unknowns are apparently on the order of 300. What is done with them? Those unknowns are raised to powers that are as large as the 4th power.
What is 300^4?
300^4
ans =
8100000000
Yet now combinations of these powers and coefficients that are given only to 3 significant digits will result in something mathematically meaningless, yet a great deal of effort will be made to extract a result, and probably great significance attributed to that result.
A wonderful thing are computers. They allow you to do all sorts of things that will result in virtually random results.
And, yes, these comments are absolutely serious. By trying to solve a problem with numbers as large as you are doing, yet using only 3 significant digits, this will result in computational garbage.
Answers (1)
Alex Sha
on 8 Apr 2020
refer the results below:
Constant G x2 x1 x4 x3 x5 x6 x7
600 301.524350251906 299.992603098721 301.890052790606 305.92202132398 296.246654676285 303.841426255074 299.997914862015
700 301.525505891803 299.994372553396 301.893257963871 306.142245703105 296.255916331741 303.843267152199 299.997915564933
800 301.526662017238 299.99614200865 301.896463123691 306.362423019274 296.26517805246 303.845107681584 299.997916267857
900 301.527818628596 299.997911464483 301.899668270053 306.582553234965 296.274439838541 303.846947842935 299.997916970786
1000 301.528975726264 299.999680920896 301.902873402948 306.802636312723 296.28370169008 303.84878763596 299.99791767372
1100 301.530133310628 300.001450377889 301.906078522364 307.022672215155 296.292963607175 303.850627060367 299.99791837666
1200 301.531291382071 300.003219835462 301.909283628292 307.242660904934 296.302225589924 303.852466115866 299.997919079605
12 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!