×
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

Control ANSYS with MATLAB

Control ANSYS with MATLAB

Control ANSYS with MATLAB

(OP)
MATLAB 7.0 contains a C language compiler, but there is an additional fee to obtain a FORTRAN compiler.  From the documentation notes for both software packages, Compaq Visual Fortran 6.6 is the only one that matches.  However, is there still a way to externally control ANSYS by writing the APDL code within a C language program?

RE: Control ANSYS with MATLAB

hi ,
I do wnat to know how to control ansys with matlab. I want to cann matlab from ansys letus say iteravative manner. if u know, please do know me. thanks in advance

nagesh

RE: Control ANSYS with MATLAB

(OP)
Well, I can't say that I know for sure but I'll tell you what I have learned to date.  Ansys (I have Ansys version 8.1) gives one the capability to control it using an external user-written fortran program.  If you take a look at the UPF's in the Ansys Inc\v81\custom\user directory you will see an Ansys.f file.  This file executes the ansys main program call.  It also contains an example of how to call ansys from external fortran .  I kinda suspect that you can interface with ansys by way of a C-language program because the ansys.f file contains a function call (#include impcom.inc) to a file written in C.  If you take a look at the Ansys Inc\v81\custom\include directory I think you will find a number of C-language files; some of which I think can be modified by the user.

Just for clarification, when you say "...control Matlab from Ansys" do you mean that you want to write an APDL program that controls Matlab??  If so, I am not sure if you can do this.  Please provide a little more clarification in your next response.

However, what I do think you can do, and maybe this is what you are saying, is to write an external fortran or C program that first calls Ansys to execute a job.  After completing the job, that fortran/C program then calls Matlab and delivers Ansys output data into Matlab to be used in further calculation.  As I am still grappling with the Fortran-to-Ansys problem, I cannot be of great help yet on this part.  However, Matlab allows one to control it with external fortran or C-code using the Mex-function capability.  Look up "Mex-Function" in the Matlab online help.  Unless you have seen it before, it may possibly take you a while to understand, but C/fortran-to-Matlab is completely possible.  

Also, if you are thinking of trying to program for C or Fortran-to-Ansys you will need to look at the M-lab & Ansys documentation to see what compilers are compatible.  I read in another thread that obtaining the exact compiler is a MUST.  Although I have not proved this statement for myself I have chosen to take it as gospel and spend some money instead of wasting time trying to figure out if this is true.  Hope this helps.

Tecknique

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