I have two equations that are difficult to solve, so I am using fsolve to get the sol. But while running the program I encountered the error .Please help me or tell other way to solve these equations.

5 views (last 30 days)
first equ;
F1- (0.41*f1^2 + f1(1-f1))/(0.41*f1^2 + 2*f1(1-f1) +0.04*(1-f1)^2)=0
second equ;
0.589/(0.589 - 31.71/(104-51*F1)) - ((2826*4.479*E-7)*(176*62500*f1^2 + 2*62500*429.27*f1 - 2*62500*429.27*f1^2 + 2500*429.27 + 2500*429.27*f1^2 - 2*2500*429.27*f1))/(429.27*(1-f1) + 62500*f1) -1
;
program;;;;
function fcns = eqs(z)
F1 = z(1);
f1 =z(2);
fcns(1) = F1- (0.41*f1^2 + f1(1-f1))/(0.41*f1^2 + 2*f1(1-f1) +0.04*(1-f1)^2);
fcns(2) = 0.589/(0.589 - 31.71/(104-51*F1)) - ((2826*4.479*E-7)*(176*62500*f1^2 + 2*62500*429.27*f1 - 2*62500*429.27*f1^2 + 2500*429.27 + 2500*429.27*f1^2 - 2*2500*429.27*f1))/(429.27*(1-f1) + 62500*f1) -1 ;
end
guess =[0.28 0.0244 ];
result = fsolve(@eqns,guess)
  1 Comment
Dhanvir Singh
Dhanvir Singh on 6 Apr 2019
Edited: madhan ravi on 6 Apr 2019
error;;
fsol
Array indices must be positive integers or logical values.
Error in eqs (line 4)
fcns(1) = F1- (0.41*f1^2 + f1(1-f1))/(0.41*f1^2 + 2*f1(1-f1) +0.04*(1-f1)^2);
Error in fsolve (line 242)
fuser = feval(funfcn{3},x,varargin{:});
Error in fsol (line 2)
result = fsolve(@eqs,guess)
Caused by:
Failure in initial objective function evaluation.
FSOLVE cannot continue.

Sign in to comment.

Accepted Answer

madhan ravi
madhan ravi on 6 Apr 2019
Edited: madhan ravi on 6 Apr 2019
guess = [0.28 0.0244];
result = fsolve(@eqs,guess)
function fcns = eqs(z)
F1 = z(1);
f1 = z(2);
fcns(1) = F1- (0.41*f1^2 + f1*(1-f1))/(0.41*f1^2 + 2*f1*(1-f1) +0.04*(1-f1)^2);
fcns(2) = 0.589/(0.589 - 31.71/(104-51*F1)) - ((2826*4.479*1E-7)*(176*62500*f1^2 + 2*62500*429.27*f1 - 2*62500*429.27*f1^2 + 2500*429.27 + 2500*429.27*f1^2 - 2*2500*429.27*f1))/(429.27*(1-f1) + 62500*f1) -1 ;
end

More Answers (1)

Alex Sha
Alex Sha on 11 Dec 2019
there are two solutions:
1:
F1: 0.458069398988435
f1: -1.13829069933547
2:
F1: 0.280093672719386
f1: 0.0244403974479464
  3 Comments
Alex Sha
Alex Sha on 11 Dec 2019
Take verification for those four solutions:
1: (1.25920378390736 1070015.92979626)
fev1=0.0239758458919823
fev2=-3.10862446895044E-15
2: (-0.0204942588521928 -68536267.4425476)
fev1=-19.8097575455904
fev2=3.5527136788005E-15
3: (0.0244403974458328 0.280093672733541)
fev1=-2.77555756156289E-16
fev2=-8.88178419700125E-16
4: (-1.13829070004027 0.458069399149128)
fev1=-1.11022302462516E-16
fev2=3.5527136788005E-15
the accuracy of the first two seems too lower
Walter Roberson
Walter Roberson on 11 Dec 2019
f1 is the four roots of
z^4 - (6077732260096151484325981836*z^3)/48676678745197603497996139375 - (2441998460292700770357164693701*z^2)/1703683756081916122429864878125 + (9739486432015774348021785204*z)/1703683756081916122429864878125 + 1223147048303704354962394632/1703683756081916122429864878125
F1 is related as
(340407827229812874745643267503*f1.^2)/2191837914062353460625 - (20253838448*f1.^3)/19 + (39001068488315423891730831977796*f1)/25571442330727457040625 - 955175915804501125862716674706/25571442330727457040625

Sign in to comment.

Categories

Find more on Mathematics in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!