Non linear solver
Non linear solver
(OP)
In a time integration cycle I need to solve a non linear algebraic equation.
I know that fsolve can easily do it but I have two problems with it.
1) At each time step fsolve displays (and consequently prints on the output file):
Optimization terminated: first-order optimality is less than options.TolFun.
Since my program runs in background all the displayed infos are printed on an output file (say a.out). Call on a file and print on it is a very time consuming operation and I definately cannot afford it since I have to perform a few million loops.
So, I'd like to know if there is any way to prevent fsolve from printing the line mentioned above.
2) Since the function contains parameters that chage at every loop, I need to write the function itself in an m-file that fsolve calls everytime it is needed. This operation is time consuming and for the reasons mentioned above I'd like to avoid it.
Any suggestion on how to skip tis passage?
Thanks in advance
I know that fsolve can easily do it but I have two problems with it.
1) At each time step fsolve displays (and consequently prints on the output file):
Optimization terminated: first-order optimality is less than options.TolFun.
Since my program runs in background all the displayed infos are printed on an output file (say a.out). Call on a file and print on it is a very time consuming operation and I definately cannot afford it since I have to perform a few million loops.
So, I'd like to know if there is any way to prevent fsolve from printing the line mentioned above.
2) Since the function contains parameters that chage at every loop, I need to write the function itself in an m-file that fsolve calls everytime it is needed. This operation is time consuming and for the reasons mentioned above I'd like to avoid it.
Any suggestion on how to skip tis passage?
Thanks in advance





RE: Non linear solver
I read through this and think that the output:
"Optimization terminated: first-order optimality is less than options.TolFun."
Is how matlab tells the user that the fsolve function has completed its solution.
You can read more here , but I think that if you use the optimset command and set display to off or final that you might remove the extraneous statement, which is causing your problem.
Hope this helps.
BsK