Ansys analysis hangs when run from Matlab

9 ビュー (過去 30 日間)
CF
CF 2012 年 5 月 24 日
編集済み: A Macedo 2017 年 9 月 28 日
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? 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

採用された回答

CF
CF 2012 年 5 月 30 日
Problem exists with version 2009b - not with 2011.

その他の回答 (2 件)

CF
CF 2012 年 5 月 25 日
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
  1 件のコメント
CF
CF 2012 年 5 月 28 日
Seems like my solution was only addressing a symptom of another problem. On the second iteration of my optimisation, Ansys hangs like before.
C

サインインしてコメントする。


A Macedo
A Macedo 2017 年 9 月 28 日
編集済み: A Macedo 2017 年 9 月 28 日
Hello. I didn't understand...did you solve the problem with your interface Matlab-Ansys?
I am having the same problem with only one iteration. My Matlab version is R2015b. I call ANSYS (17.2 student) with DOS command and I am sure everything is correct. When it reaches the point of SOLVE (Static Analysis) in the macro, it hangs. If I comment the SOLVE it runs perfectly. It also doesn't have any problem when executing it manually.
I experimented with another macro, which is simpler, and it was OK. So I suppose it has to do with the complexity of the modelling or the meshing (I had MPC elements, I took them off, thinking that would be the problem...but it isn't).
Thank you,
AMacedo

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by