Fsolver is not finding solution

조회 수: 2 (최근 30일)
alberto peralta
alberto peralta 2015년 4월 10일
답변: Torsten 2015년 4월 10일
I am trying to test out fsolve for the first time by solving this equation for which I already know it should output around .045 (from a different solver). But I keep getting
''fsolve stopped because the problem appears regular as measured by the gradient, but the vector of function values is not near zero as measured by the default value of the function tolerance.''
Any input?
Code:
lambda=1;
alpha=40;
p=.1;
F = @(V) 1-V-lambda-lambda*p*(exp(1)^(alpha*V)-1)+lambda*(exp(1)^(alpha*V)*sqrt(1+lambda*alpha*p*exp(1)^(alpha*V))/(sqrt(2*alpha*pi)));
InitialGuess = .04;
Options = optimset('Display','iter');
XY = fsolve(F, InitialGuess, Options);

답변 (1개)

Torsten
Torsten 2015년 4월 10일
Plot your function and you will see that it has no zero.
Best wishes
Torsten.

카테고리

Help CenterFile Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by