From: Edoardo Melloni on
Hi all! I have a problem on the fsolve comand, I have 7 unknowns in 7 equations and when i launch my function with the fsolve it appears that error:

"Solver stopped prematurely.

fsolve stopped because it exceeded the function evaluation limit,
options.MaxFunEvals = 700 (the default value)."

Then, I wanted him to disply iterations and I wrote

sol=fsolve('sistema',u,optimset('Display','iter'))

And I had the confirm that after 704 iter, it stops...

How can i change that default value???

Thank you all for the assistance and sorry if my english might be wrong...
From: Edoardo Melloni on
Ok, I found the solution to my problem...

I had just to write

sol=fsolve('sistema',u,optimset('MaxFunEvals',X,'MaxIter',X));

Where X is a number!


The problem now is that afet 2KK iterations, Matlab doesn't find any solution... Maybe I have to correct some of my equations...
From: Steven Lord on

"Edoardo Melloni" <edoardo.melloni(a)hotmail.it> wrote in message
news:hvai6j$b1g$1(a)fred.mathworks.com...
> Ok, I found the solution to my problem...
>
> I had just to write
>
> sol=fsolve('sistema',u,optimset('MaxFunEvals',X,'MaxIter',X));
>
> Where X is a number!
>
>
> The problem now is that afet 2KK iterations, Matlab doesn't find any
> solution... Maybe I have to correct some of my equations...

I would also try the following:

* double-check the equations, to make sure they actually _have_ a solution.
* double-check the function value displayed when you set the Display option
to 'iter' using OPTIMSET -- if it looks like it's getting "close" to 0 (for
your definition of "close") then:
* check to see if the tolerances are set too tightly. You can adjust them
using OPTIMSET; look at the DOC reference page for FSOLVE to determine which
tolerance options (whose names will start with Tol) it accepts.
* check if I could provide the Jacobian for the system as a second output
from the sistema function as described on the DOC page for FSOLVE.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com