×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Non linear solver

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

RE: Non linear solver

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources