The Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Matlab/Ansys Optimization with fmincon (Input variables not changing)
Replies: 5   Last Post: Apr 7, 2011 4:36 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Pris Orig

Posts: 8
Registered: 3/27/11
Re: Matlab/Ansys Optimization with fmincon (Input variables not changing)
Posted: Apr 1, 2011 7:20 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Brian G" wrote in message <gnijga$2l1$1@fred.mathworks.com>...
> I am currently working on getting matlab to run an ansys model, retrieve principal stresses, and feedback into a matlab optimizer, specifically fmincon. My issue is not one of communication of variables (everything seems to be passing well between the 2 programs), however, fmincon evaluates the objective function with the same design variables for every iteration. In other words, it takes my initial guess and uses it for every iteration as if it is not changing the input variables based upon the feedback it is receiving. I have the same problem regardless of the initial guess I make. If I make a guess outside of the upper and lower bounds I have set, fmincon will use the closest feasible points within the bounds. I have no constraints other than bounds on the design variables. My objective function calls an ansysfemcall function I wrote which appends the design variables into a
> text file, calls ansys in batch mode to run the input file, ansys completes the analysis and writes the max stresses to more text files, then matlab reads the associated stress from the output files. In essence, you put the design variables in and get stresses out. The objective function takes the max stress and returns it to the optimizer.
>
> I was having success when performing the optimization with only 1 variable using fminbnd. This has helped me narrow down the problem to matlab. I have also tried modifying fminimax and the same phenomenon occurs. When I bumped up the model complexity to more than one variable, I am forced to select a more appropriate optimizer. I have had success with fmincon in the past and am rather stumped as to why this is occurring. Any help would be appreciated. Thanks!


Hi Brian,I hope you had success with your problem.

I am curious about how to write the objective function as an input file which uses my ansys mesh and ansys global stiffness(or flexibility) matrix . I want the flexibility matrix to be in terms of the material properties so that in the objective function I can can ask for the material properties to be changed to minimize my objective function.

Basically, folks, if anyone know of a good workflow where in I can create my own objective function as an input file using mesh and flexibility matrix from Ansys, please let me know. I am a student so detail is of great importance in explaining things to me.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.