Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

making an automated optimization environment 1

Status
Not open for further replies.

alleak

Mechanical
Sep 27, 2005
34
0
0
IR
Hi;
I am working on optimizaton of composite pressure vessels and currently on the stacking sequence optimization.I have two design variables(fiber angle & layer thickness)and I want to optimize the weight.I prefer to use genetic algorithm for optimization and ansys for simulation.I am seeking a procedure to use genetic algrithm with ansys and make a loop beetween these two to obtain the optimum variables.any suggestion would be appreciated.
 
Replies continue below

Recommended for you

You need to be able to run ansys from the command line, and then you need an outer loop that can build populations of models, run ansys, and then pull the results out of the ansys file so as to measure fitness.

I am doing a similar thing, and am using Scilab for the GA side. The reason for that is that I already have the GA coded up for another project, so the really tricky bit has been done.

Another option (for me) would be to use qbasic. Basically whatever you choose has to be very good at writing and reading ascii files, the actual computational efficiency is not very important, although breeding generations can take quite a while in an interpreted language.

I have also written a GA algorithm in Excel VBA, but I don't fancy writing the external interface (Hmm, actually that is not a terrible idea).

You also need to think about genes. Thus far I haven't, each gene has controlled just one variable. This may not be optimal. Also you might want to include dominance and recessiveness. I have in one implementation, didn't bother in the other.

Basically, so long as you always keep the best performer from each generation into the next generation then the thing will probably work, even if you make mistakes elsewhere.









Cheers

Greg Locock

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Hi Greg Locock ;
Thanks.I would like to know more details on this subject.do you run the external loop from ansys command and how do you get and enterpret the new generation for ansys.have you ever done this with ansys & matlab.


Cheers



 
No, I haven't done this with ansys, I am about to do it with another FEA program. You need to call ansys from the outer loop, not the other way round.

You have to build a fitness function, in my case an equation that simply links the deflection and the mass of the structure.

Cheers

Greg Locock

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
I still have a keen interest in working in this area and would like to learn more about what others are doing. Are there samples of your work that can be shared? If there are other resources you can point me to would be appreciated.


Cheers
alleak
 
If you google for it you will find lots of articles, and quite a lot of coding examples and tutorials.

I strongly suggest you develop your GA framework before taking the plunge with the FEA side, but, with care, it is not very much code in itself, about 100 lines or less.

Incidentally I checked in Excel and it looks like I can run the whole thing from that, using the VBA command 'Shell' to call the Perl script that runs the FEA.

This is neat, it means I can hold the genetic population on a worksheet, build the input file to another worksheet, write it out, run the FEA, import the results and assign a score. Then work through the entire population like that, and then do the GA bit.



Cheers

Greg Locock

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Status
Not open for further replies.
Back
Top