×
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

Interfacing ANSYS with MATLAB
2

Interfacing ANSYS with MATLAB

Interfacing ANSYS with MATLAB

(OP)
Hello,

I previously, interfaced ANSYS and MATLAB. I used finite element code in MATLAB for a certain design. After optimizing the design in MATLAB, I saved the results (thickness of each element) in a .dat file, and using APDL, I read that file and constructed the same design on ANSYS to verify the results I got in MATLAB.

What I am trying to do now is to directly use ANSYS for finite element. This would give me better results.

So, I have to write an advanced interface code, where MATLAB orders ANSYS to start, reads the results ANSYS got, and start optimizing.

so the structure should look something like this:

MATLAB gives ANSYS design data (example: thickness of each element)

ANSYS does the fEA for the specified data, and saves output.

MATLAB reads the output file and optimizes the design accordingly.

Same cycle keeps repeating until the design is optimized.

This would give me more accurate results, and eliminate the additional step of verifying my design.

If it is too difficult to explain here, maybe you could point me to some online refereces, or books I can buy that tackle this issue.

Thank you for your help.

RE: Interfacing ANSYS with MATLAB

I think this could be done in one of three ways - you need a script that controls the running of both programs, plus data transfer between them. So either you write a script in Matlab, in Ansys or in a standalone DOS script. I would be tempted to use Matlab probably as it has the most advanced programming language and is already running some of your programs. So I would suggest you do something like this: write a matlab m file that, for a given input set, runs ansys. Check out section 3.4.1 in the Operations Guide of Ansys for how to run ansys jobs in batch mode. You will need of course to write an APDL input file for ansys to run, and use matlab to edit the parameters in the file (I am not sure exactly how to do this in Matlab, but am very sure that it is possible). In your input file (for ansys) you should include any post processing that you require, and acquire specific results using *get or *vget. You can then write vectors to a text file using *vwrite. You can also write parameters using PARASAV. These can all be written to the same file, or to separate ones - try playing around with it to see what format they appear in. Now, you can read the text file from your matlab m file and transfer the parameters to Matlab.

Hope this helps,
Will

RE: Interfacing ANSYS with MATLAB

Dear Brango,

If you had success in writting the mentioned advanced interface code than kindly share it.

Thanks in advance.

  

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