How to run a workbench journal file on already existing wbpj via Matlab ?
44 ビュー (過去 30 日間)
古いコメントを表示
Hi.
I have work on optimization work. I am adjusting new input value according to output of before design points.
I have a already existing wbpj and wbjn. Each wbjn file is generated based on the previous, analysis results.
Wbjn files are work fine when i run manually. But i want run with system or dos command in matlab platform.
When i write,
system('C:\"Program Files"\"ANSYS Inc"\v212\Framework\bin\Win64\RunWB2.exe -B')
Opening new window and i can not control.
0 件のコメント
回答 (3 件)
Abhinaya Kennedy
2023 年 10 月 11 日
Hello Tarik,
I understand you want to run the ANSYS Workbench (WB) in batch mode using the system or dos command in MATLAB without opening a new window. You can modify the command to run in the background. Here's an example:
system('start /B "" "C:\Program Files\ANSYS Inc\v212\Framework\bin\Win64\RunWB2.exe" -B')
In this modified command, the "start /B" option is used to run the command in the background without opening a new window. The " " is included as a placeholder for the window title. Make sure to adjust the file path to match the location of the "RunWB2.exe" file on your system.
By using this modified command, you should be able to run ANSYS Workbench in batch mode from MATLAB without opening a new window, allowing you to control the execution programmatically.
Hope this helps!
0 件のコメント
SorMun
2023 年 11 月 16 日
Hi Tarik,
you can install the Matlab aaS toolbox from https://www.mathworks.com/matlabcentral/fileexchange/155122-ansys_aas-1-1-13
after you install the addon, check the the pdf included in the toolbox, for the instructions to start Workbench in server mode, connect it to Matlab and then issue scripting commands from Matlab
Add the following to the standard Workbench command to start it in server mode:
-I -E "with open('<WB_aaS_key>','w') as file:file.write(Server.StartServer('<host_name>',0,<start_port_range>,<end_port_range>))"
WB_aaS_key is just the file name to store connection information to a text file
host_name is the machine name or IP address where Workbench is running . You can use localhost if both of them (Matlab and Workbench) are running on the same.
start_port_range, end_port range define range of ports. Workbench will pick one that is available to listen for Matlab requests
Once you have Workbench started, you can copy the generated WB_aaS_key file to the Matlab machine and execute the following commands to connect. If the WB_aaS key is 'wb_aas_key.txt' this will be the code that you will write to retrieve the contents of the Workbench Schematic
load_ansys_aas
actwbserver('wb_aas_key.txt'')
execwbcommand('systems=GetAllSystems()'))
char(querywbvariable(‘systems’))
Once connected yyou can execute:
execwbcommand - to execute any legal scripting Workbench command
querywbvariable - to retrieve the value of any scripting variable in Worbench
Please let me know if you have additional questions
Sorin
2 件のコメント
noura
2024 年 8 月 13 日
編集済み: noura
2024 年 8 月 13 日
Hi Sormun i hope you in a good health
i'm a beginner in matlab and i tried to apply the steps you said but i'm confused
How can i import the data ( chart between force and deformation ) of ansys workbench in matlab to make optimization using genetic algorithm to mimimize the error between desired force displacement curve and the actual one that i obtained from matlab.?
Thank you
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!