Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Non linear solver

Status
Not open for further replies.

Marco83

Mechanical
Joined
Jun 21, 2006
Messages
8
Location
US
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
 
Marco83,
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top