필터 지우기
필터 지우기

Solving a nonlinear equation using fsolve. cant reach at perfect result. output showing some error written below.

조회 수: 1 (최근 30일)
Where M*_N = m - (a*sigma)
Equation solved. fsolve completed because the vector of function values is near zero as measured by the value of the
function tolerance, and the problem appears regular as measured by the gradient.
used code :
Result must be around 22-25. but itc coming .0029.
Is there anything wrong i am doing?
  댓글 수: 1
Star Strider
Star Strider 2022년 1월 23일
Since fsolve is a root-finding algorithm, plot the function to see if there are any zero-crossings. Since fsolve can find complex as well as real roots, it might be worth giving it complex initial parameter estimates to see what it finds.

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

채택된 답변

Matt J
Matt J 2022년 1월 23일
편집: Matt J 2022년 1월 23일
Result must be around 22-25. but itc coming .0029.
As the plot shows, your function has no roots in the range 22-25
p = 1;
pfun=@(sigma) arrayfun( @(z)fun(z,p) , sigma);
fplot(pfun,[0,25])
xlabel sigma; ylabel fun
function sigmares = fun(sigma,p)
m = 939;
ms = 550;
b = -7.25*10^(-3);
gs = 8.238;
p0 = .15*(197.3)^3;
k = (1.5*p*p0*pi^2)^(1/3);
gss = (1 + (b*sigma/2))*gs;
m1 = (m-(gss*sigma));
F = ((1+(b*sigma))*gs*m1*(1/(2*ms^2*pi^3))*log((sqrt(k^2 + m1^2)+ k))) - sigma;
sigmares = F ;
end
  댓글 수: 6

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

추가 답변 (0개)

카테고리

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