View Full Version : Ansys analysis hangs when run from Matlab
I am performing a material optimisation using the lsqnonlin function in Matlab. As part of this procedure, a call to Ansys is made and a finite element analysis is run:
dos('ansys140 -b -i FE_Analysis.inp -o output.txt');
When the above line is executed, Ansys hangs and a window pops up saying the program is not responding.
If I run this same Ansys input file (FE_Analysis.inp) outside of Matlab, it runs to completion without any problems. Also, when I fire up Matlab and execute the same analysis from the Matlab command line, there are no problems. If I try and run it from the Matlab command line after it fails when running through the optimisation script, it doesn't run.
Anyone have any idea what might be the issue? I don't think it is a memory issue. There are no messages other than "Program is not responding". I'm running it on a Windows 7 64 bit machine with 24 GB of RAM.
Thanks in advance for any input.
Cormac
IceBreaker
2012-05-24, 23:13
I do not know the answer to your interesting question. It would be great if you post the solution once you've found one.
I have basically stopped using Matlab (I use Python instead), but if I remember right there is another Matlab function that you can use to execute a system command. Perhaps that function is called "system('ansys...')" or something similar...
Also, what material model are you trying to calibrate?
The MCalibration (http://polymerfem.com/content.php?9-MCalibration)software can calibrate all ANSYS material models, and supports 4-5 different optimization algorithms.
-Jorgen
I've tried "system" and "!" and the response is the same. I might end up checking out python but I have my framework all set up in Matlab and am reluctant to spend time at the moment setting up another one. I used this procedure before running optimisations with Abaqus and never had a problem.
I'm optimising Ogden material parameters plus stress field parameters to fit a simulation to in vivo skin deformation data. I'll have a look at MCalibration but I suspect I need to use a full FE package.
C
IceBreaker
2012-05-25, 10:27
I'd give guys at Red Cedar Tech (makers of HEEDS MDO) a call. I know HEEDS can drive ABAQUS and perform material calibration. I am not sure about ANSYS. Ask for a trial license and see if it does the job for you.
Right. I think I found a solution but it seems fairly random and doesn't explain why it is happening.
In my script, I plotted two figures at the start to visually compare the model and experimental results. When I comment out the code to plot the figures, the ansys analysis runs without any problems.
C
IceBreaker
2012-05-25, 14:25
I believe I will need to do this at some stage too. Is there any guidance you could provide? Could you upload a simplified INP/script or a document that shows how to do it or something of that nature? I use ABAQUS.
Seems like my solution was only addressing a symptom of another problem. On the second iteration of my optimisation, Ansys hangs like before.
If I use fminsearchbnd there are no problems.
C
Cormac: You may want to try the MCalibration software - I can give you a free trial license.
MCalibration is very cool :cool: and can calibrate any ANSYS material model.
-Jorgen
Problem is a Matlab 2009b issue. With Matlab 2011 there are no problems.
Thanks Jorgen. I may have a look into MCalibration software in the future.
C
IceBreaker
2012-05-30, 19:31
Were you able to find out what exactly the problem was?
Were you able to find out what exactly the problem was?
Nope. One of those problems that thankfully disappears with an update.
IceBreaker
2012-05-31, 12:52
Strange! Well, whatever gets the boat to float! :)
By the way, if its not a bother, I was hoping you could provide some instructions dealing with material calibration using MATLAB. Is there a webpage that may have helped? A book? Or do you have a document that you might be willing to upload? I may have to perform material calibration myself. It would be of immense value to me.
Thanks.
Strange! Well, whatever gets the boat to float! :)
By the way, if its not a bother, I was hoping you could provide some instructions dealing with material calibration using MATLAB. Is there a webpage that may have helped? A book? Or do you have a document that you might be willing to upload? I may have to perform material calibration myself. It would be of immense value to me.
Thanks.
Attached are two files, which provide a very rough skeleton of the optimisation approach I took. Some further details of the bigger picture are here:
http://www.springerlink.com/content/x8p3777155625818/?MUD=MP
Hope that is of some help.
C
IceBreaker
2012-05-31, 14:52
Sure, this will get me started. Thanks!
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.