AnsysEM scripting under Linux with already opened Electronics Desktop

Hello,

I'm trying to build a co-simulation with some control in Simulink and an electric engine in AnsysEM. This means I do some calculations in Simulink and get some parameters like e.g. currents for my electrical simulations. I then update my Ansys model, do an electromagnetic calculation and get some quantities like e.g. torque which I return to Simulink.

I have build up a model using 2019R2 under windows. There I opened the Ansys Electronical Desktop one time and started a simulation with the help of a VBS-Script. The VBS-Script didn't open a new window and load the model but was able to directly modify the opened model and submit a calculation. I executed the script with the command system('test.vbs') from Matlab/Simulink.

I'm now trying to move this procedure to a machine running Linux (CentOS 7). I'm now trying to port my scripts to Python which works fine except for one thing: I'm not able to modify an opened Ansys Electronical Desktop instance but have to start a new instance and load the model each time I want to do a simulation in AnsysEM. Since the simulation only takes about 10 seconds the startup and loading of the model makes the whole procedure much longer (about 40 seconds).

I only found a procedure on the forum to run a script without graphical output (https://forum.ansys.com/discussion/10365/how-to-run-python-script-from-command-line). This cuts down the time a little bit but there is still much overhead for loading the model every time. I'm executing the script as below:

/opt/AnsysEM/AnsysEM20.2/Linux64/ansysedt -features=beta -ng -runscriptandexit test.py

A direct execution of the script with python like python3 test.py is not possible, I guess because it is IronPython which is a little bit different than normal Python.

So my question (at last): Is there a possibility to run a Python script from command line under Linux without opening a new instance of Ansys Electronical Desktop but attach to an existing instance? Or is there an even better approach to do a co-simulation between Simulink and AnsysEM?

Thanks in advance!

Sign In or Register to comment.