Fsolver is not finding solution

2 views (last 30 days)
alberto peralta
alberto peralta on 10 Apr 2015
Answered: Torsten on 10 Apr 2015
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);

Answers (1)

Torsten
Torsten on 10 Apr 2015
Plot your function and you will see that it has no zero.
Best wishes
Torsten.

Categories

Find more on Systems of Nonlinear Equations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!