• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

interfacciare ansys con matlab

  • Thread starter Thread starter Dmaz
  • Start date Start date

Dmaz

Guest
Hello everyone,
for an optimization problem I should interface matlab with ansys12.
I'll explain.
in matlab I generate the parameters of impt and generate an apdl file that I have to feed ansys. ansys performs simulation and generates output files that matlab reads and reworks with a genetic algorithm to generate new input parameters. this up to the optimized solution.
My problem is the command to give to matlab to open ansys.
I should give him the following command with the option Home after the route:
dos('c:\ansys inc\v121\ansys\bin\winx64\launcher121.exe')But it always makes me mistake. .
Has anyone ever tried to interface the two programs?
Thank you.
dmaz
 
I would also need to get it started from a batch file of windows..
I tried to use the command:

"c:\ansys inc\v121\ansys\bin\winx64\launcher121.exe" -b -i "c:\users\dmaz85\desktop\matlab2ansys\main.inp" -o "c:\users\dmaz85\desktop\matlab2ansys\output.out"

the problem is that I always get out of shcermata where I have to specify the working directory and jobname without entering ansys and then without reading the input file..
How do I do that?
 
Code:
"c:\ansys inc\v121\ansys\bin\winx64\ansys121.exe" -b -i inputfile.inp -o outputfile.out
You should have called ansys' executable and not the laucher.
search in the guide of ansys mapdl the section "starting batch mode from the windows command line".
 
thank you very much, very useful as always!!
works with the command:

"c:\ansys inc\v121\ansys\bin\winx64\ansys121" -b -dir "c:\matlab3ansys" -i apdl.log -o outpippo.dat
 
to speed up the simulations, I wanted to specify ansys to use 8 processors.
So I added the string -np 8 in the command line.
However, the calculation time remains virtually unchanged compared to classical simulation or 4 processors.
How come? is it because the calculation depends mainly on the ram or did I wrong the command?
 
if your model has "little" knots and elements it does not need to split the calculation on 8 processors, in which the time of partitioning and communication between the various partitions of the mesh would go to cancel, if not to worsen, the performance.
check which type you solutor are using, and especially that it manages to work in ram without writing on hard drive ok?
 
I can't launch ansys script from a batch file (.bat), the command I use is

"c:\program files\ansys inc\v120\ansys\bin\winx64\ansys120.exe" -g -p ane3fl -dir "c:\users\luca\ansys_files\plate" -j "plate_tot" -s read -m 2048 -db 1024 -l en-us -t -d win32

I copied it using tools>display command line from product launcher. here it works, in fact the program opens correctly. now I would like it to automatically start the script plate_tot.ans (use .ans as ansys script extension), i.e. give the equivalent of /input,plate_tot.ans. I tried to put in the tail at the command:

-b -i plate_tot.ans -o plate_tot.txt

but the batch file answers me impossible to find the specified file. the plate_tot.ans and plate_tot.txt files are in the directory specified in the command c:\users\luca\ansys_files\plate
 
ho risolto, bastava semplicemente dare


-b -i c:\users\luca\ansys_files\plate\plate_tot.ans -o c:\users\luca\ansys_files\plate\plate_tot.txt
 
Hello everyone, I would have a problem of this kind that I can't solve in any way.
my matlab program creates a file of materials to give to an ansys simulation that launches through *.bat files.
Starting the program in matlab the file is created correctly, starting ansys manually using the newly generated file works all perfectly, when I try to start the simulation from matlab does not want to know how to start!

the version of ansys is 16.2, that of matlab is r2015b while the text in my .bat file is:"c:\program files\ansys inc\v162\ansys\bin\winx64\ansys162.exe" -b -i simu_sp18.inp -o out.txt"

Obviously the ansys installation folder is correct, the .inp file is what launched manually works.

on the error that blocks the start of ansys I couldn't tell you anything more because even in the log file there is nothing clear. Any suggestions? ?

thanks in advance to all
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top