-
-
June 26, 2018 at 1:57 pm
aleksandar.milakovic
SubscriberHello,
I have problems outputting the results from ANSYS 18.2 when run from MATLAB R2018a in batch mode on a 64-bit Windows 7 machine. I am using the following procedure:
I have created an APDL file for ANSYS called geom_sol_out.txt which contains geometry commands, boundary conditions, loads, solve commands and output command to write results into a text file. I run it from MATLAB by running batch file run_ansys.bat which contains:
set ANS_CONSEC=YES
set ANSYS_LOCK=OFF
"C:Program FilesANSYS Incv182ansysbinwinx64ANSYS182" -b -i ansysinputreader.txt -o out.dat
with ansysinputreader.txt containing /INPUT,'geom_sol_out','txt','H:test',, 0
This works nicely until the SOLVE command in geom_sol_out.txt is reached. After the solution is done, ANSYS simply ignores all the commands following the SOLVE command, so I cannot output the nodal results. I am using /OUTPUT command to output the results into text file. (note: /OUTPUT command works fine for e.g. nodal coordinates when it is called before the SOLVE command, but not when it it is called afterwards)
Can anyone help me with this?
Thank you in advance.
-
June 28, 2018 at 6:13 am
Bhargava Sista
Ansys EmployeeThis may sound trivial but are you issuing /POST1 or /POST26 after the SOLVE command to enter the post-processing module? Perhaps it may help if you can share the .out file for any warnings or errors.
-
June 28, 2018 at 10:21 am
aleksandar.milakovic
SubscriberHello,
Thank you for your comment. In the meantime, I managed to solve my problem. The issue was in the lack of memory and that is the reason why the file stopped execution at some point. It was solved by adding SET KMP_STACKSIZE=2048k to the batch file.
-
September 12, 2018 at 9:27 pm
Alkalla
SubscriberHello Aleksandar,
Â
I have the same problem, the file in working fine with the interactive mode, but when using the batch mode it stops before /post1 command.
Would you please let me know how you use the command you mentioned above (SET KMP_STACKSIZE=2048k).
Â
Many thanks
-
September 13, 2018 at 4:01 pm
aleksandar.milakovic
SubscriberHello,
First I create a batch file run_ansys.bat containing: (make sure to change the path calling ANSYS applicable to your system. Also, you might need more than 2048k)
SET ANS_CONSEC=YES
SET ANSYS_LOCK=OFF
SET KMP_STACKSIZE=2048k
"C:Program FilesANSYS Incv181ansysbinwinx64ANSYS181" -b -i ansysinputreader.txt -o out.dat
The ansysinputreader.txt contains the following:
/INPUT,'A_02','txt','C:UsersA.-S. MilakovicDropboxWorkTUHHMoritzpaper_1T_joint_Astress_grad_calcs',, 0
which is simply a path to an APDL file containing geometry, mesh, loads, and solve commands for ANSYS including the /OUTPUT command which outputs the desired results from ANSYS into a .txt file in the current directory. Here is an example of an /OUTPUT command in ANSYS APDL which outputs nodal stresses into stress_nodes.txt:
/POST1
/OUTPUT,stress_nodes,txtÂ
PRNSOL,S,PRIN
/OUTPUTÂ
Finally, I simply call !run_ansys.bat from MATLAB and get the desired output files which I can then read back into MATLAB and analyse.Â
Hope this helps.
Cheers,
Aleksandar
-
October 3, 2018 at 7:04 pm
Meru
SubscriberHi, I have started a project that require similar things ( like running Ansys in Batch mode from matlab) I do not know how to write an APDL file and How to write a batch file that can open Ansys . Can you please guide me in a proper direction of source that I can refer and learn how to do it. It would be really helpfull. Thank you. Â
-
October 3, 2018 at 7:20 pm
peteroznewman
SubscriberHi Meru,
Maybe you can do everything in ANSYS without matlab. What are you doing in matlab that you can't do in ANSYS?
Or, if you don't know ANSYS well enough to answer that question, perhaps you could tell us what you are trying to do.
Regards,
Peter
Â
-
November 7, 2019 at 6:31 pm
kintoresenpai
SubscriberYou are a genius! Thank you so much
-
October 18, 2020 at 2:02 am
alverlandoricardo
SubscriberI was having the same problem. I uninstalled and installed several versions of matlab/ansys, however, it only worked when I changed the command in matlab:n !C: \ Program Files \ ANSYS Inc \ v192\ ansys \ bin \ winx64 \ ANSYS192 -b -i FEAin.txt -o FEAout.dat nby:nsystem ('SET KMP_STACKSIZE = 10240k & C: \ Program Files \ ANSYS Inc \ v192 \ ansys \ bin \ winx64 \ ANSYS192 -b -i FEAin.txt -o FEAout.dat') nThanks for the help, you saved my research!!!n
-
- The topic ‘Cannot output results from ANSYS 18.2 when run from MATLAB in batch mode’ is closed to new replies.
- The legend values are not changing.
- LPBF Simulation of dissimilar materials in ANSYS mechanical (Thermal Transient)
- APDL, memory, solid
- Convergence error in modal analysis
- How to model a bimodular material in Mechanical
- Meaning of the error
- Simulate a fan on the end of shaft
- Real Life Example of a non-symmetric eigenvalue problem
- Nonlinear load cases combinations
- How can the results of Pressures and Motions for all elements be obtained?
-
3862
-
1414
-
1220
-
1118
-
1015
© 2025 Copyright ANSYS, Inc. All rights reserved.