Problems using function fsolve

1 view (last 30 days)
Ana Carolina da Silva Pacheco
Answered: Alan Weiss on 19 May 2021
I'm trying to execute a fsolve function. First, I tried without using optimset and it went wrong because of maximum function evaluations and maximum iterations. So I rewrote the code as:
funm = @dissertacao_momento_funcao;
x0m = [1;1];
options = optimset('MaxFunEvals',1e5,'MaxIter',1e5);
xm = fsolve(funm,x0m,options);
But now it's returning the error below:
No solution found.
fsolve stopped because the relative size of the current step is less than the
default value of the step size tolerance squared, but the vector of function values
is not near zero as measured by the default value of the function tolerance.
<stopping criteria details>
I tried to set TolFun and TolX as 1e-15 but it didn't solve the problem. After I did it, it returned the same error and some of the times I ran the code it returned a different error:
No solution found.
fsolve stopped because the problem appears to be locally singular.
<stopping criteria details>
Can anybody help me, please?

Answers (1)

Alan Weiss
Alan Weiss on 19 May 2021
Check the suggestions in fsolve Could Not Solve Equation.
Alan Weiss
MATLAB mathematical toolbox documentation

Community Treasure Hunt

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

Start Hunting!