×
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

Calling ANSYS from MATLAB

Calling ANSYS from MATLAB

Calling ANSYS from MATLAB

(OP)
Hi everyone!

I have two batch files written in ANSYS APDL which I want to call from MATLAB. There is a small twist to it which is I would like to run them in parallel and not sequentially.

I am running both programs in a UNIX machine. ANSYS is a commercial FE code which I use for structural analysis.

So up to now I sorted out the following:

1. In the UNIX command prompt I can write something like

ansys100 <./Msc/Scripts/COMBI_SURF/MAIN.txt >./Msc/WD/OUT1.out -p aunivres -j Prop1 -s read -b list & ansys100 <./Msc/Scripts/COMBI/MAIN.txt >./Msc/WD/OUT2.out -p aunivres -j Prop2 -s read -b list &

which will run the two batch files (almost) in parallel. Note that this are two commands to launch ANSYS in batch mode separated by a '&'.

2. In MATLAB I can use the commands 'unix' or 'system' in order to write the former command to the command prompt. MATLAB would wait for the ANSYS analysis to finish before proceeding with the rest of the matlabe code if it was only one command. In this case there is a certain delay and the first command will finish first thus "saying" MATLAB that the analysis in ANSYS is over when in fact it is not true.

I think that the best solution for this problem would be to find a way to tell MATLAB to wait for a certain file (an output file from ANSYS) to exsit in a given directory before continuing reading from the MATLAB file. In this case, MATLAB would wait for the output from the second batch analysis before proceeding and my problems would be over.

Has anyone ever came across this problem and if so could you please help me with some tips? Do you have any other way of doing this?

Thanks a lot in advance.



DTU
Denmark

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