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);