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.

2 visualizaciones (últimos 30 días)
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 comentario
Dhanvir Singh
Dhanvir Singh el 6 de Abr. de 2019
Editada: madhan ravi el 6 de Abr. de 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.

Iniciar sesión para comentar.

Respuesta aceptada

madhan ravi
madhan ravi el 6 de Abr. de 2019
Editada: madhan ravi el 6 de Abr. de 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
  2 comentarios
Dhanvir Singh
Dhanvir Singh el 7 de Abr. de 2019
Thank you sir!!
I have another inquiry .
Whatever guess I put ,it always return a same answer, i.e the exact answer then what's the use of guess.

Iniciar sesión para comentar.

Más respuestas (1)

Alex Sha
Alex Sha el 11 de Dic. de 2019
there are two solutions:
1:
F1: 0.458069398988435
f1: -1.13829069933547
2:
F1: 0.280093672719386
f1: 0.0244403974479464
  3 comentarios
Alex Sha
Alex Sha el 11 de Dic. de 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 el 11 de Dic. de 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

Iniciar sesión para comentar.

Categorías

Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by