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 (최근 30일)
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
Dhanvir Singh
Dhanvir Singh 2019년 4월 6일
편집: madhan ravi 2019년 4월 6일
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.

댓글을 달려면 로그인하십시오.

채택된 답변

madhan ravi
madhan ravi 2019년 4월 6일
편집: madhan ravi 2019년 4월 6일
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
Dhanvir Singh
Dhanvir Singh 2019년 4월 7일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Alex Sha
Alex Sha 2019년 12월 11일
there are two solutions:
1:
F1: 0.458069398988435
f1: -1.13829069933547
2:
F1: 0.280093672719386
f1: 0.0244403974479464
  댓글 수: 3
Alex Sha
Alex Sha 2019년 12월 11일
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 2019년 12월 11일
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

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by