i need to solve 7 nonlinear equations with 7 unknows

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

Bindhu - what is your question? Is there an error with the above or is something else wrong? Please clarify.
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.

Sign in to comment.

Answers (1)

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

HOW CAN I GET THESE ANSWERS
CAN YOU PLEASE EXPLAIN
Hi, Bindhu, I used one package other than Matlab, much easy, with global solutions, the code looks like below:
LoopConstant G=[600:100:1200];
Constant Tg1 = 300, Tg2 = 301.5, Ta = 305.8, Tl = 302, Tf = 302, Tb = 302, Th = 300;
Function
0.0425*g + 1.41*10^(-8)*x2^(4) + 1.34*x2 - 9.12*10^(-9)*x1^(4) + 341 - 2402.77*x1 + 2400*tg1;
0.0204*g - (3.48*10^(-8) + 4.35*10^(-10)*1)*x2^(4) + 1.41*10^(-8)*x1^(4) + 8.01*10^(-11)* x4^(4) + 2.43*10^(-8)*x3^(4) + 4.35*10^(-10)*1*x5^(4) + 0.55*x3 + 1.34*x1 - 2401.87*x2 + 2400*tg2;
0.124*g - 4.88*10^(-8)*x3^(4) + 2.44*10^(-8)*1*x2^(4) + 2.44*10^(-8)*1*x5^(4)- 50.938*x3 + 11.502*x6 + 1.836* x2 + 37.60*ta;
0.011*g - 8.70*10^(-8)*x5^(4) + 4.35*10^(-10)*x3^(4)+ 4.35*10^(-10)*x2^(4) + 0.83*x6 + 0.112*x3 + 0.112*x2 - (1.055 + (112.7/1))*x5 + (112.7/1)*tf;
2.17*10^(-3)*g - 1.6*10^(-10)*x4^(4) + 8.01*10^(-11)*x7^(4) + 8.01*10^(-11)*x2^(4) - 69.07*x4 + 3.77*10^(-4)*x7 + 0.02*x3 + 0.02*x2 + 69*tl;
-52.068*x6 + 0.412*x3 + 0.368*x4+ 0.368*x5 + 0.46*x2 + 50.78*tb;
3.77*10^(-4)*x4 + 8.01*10^(-11)*x4^(4) + 0.092*x5 - 1254.1*x7 - 8.01*10^(-11)*x7^(4) + 1254*th;
where can i run these codes for getting the answers can you please explain
which is the pack for running these codes
why in these codes small g is used instead of G.Actually different Values for G are needed from 600 to 1200
Hi, it is a package called "1stOpt", in this package, it is not case-sensitive, so "g" and "G" mean same one
is it possible to do in matlab.any modification to be done in the above code to run in matlab
i want to run the code in matlab i presented almost my project in matlab
should be difficult since the algorithms used in Matlab, for example fsolve, is local optimization algorithm, not global optimization algorithms, so the results from Matlab heavily depends on the guess of initial start values, although there is GA toolbox with the global optimization ability, but actually, the effect of GA is far to say good.
sir the answer are not correct here while variying the values of G from 600 to 1200 there is no variations in the answers.
Which version of 1stOpt you used? The latest version is 8.0

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Asked:

on 7 Apr 2020

Commented:

on 8 Apr 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!