Electronics

Electronics

Topics relate to HFSS, Maxwell, SIwave, Icepak, Electronics Enterprise and more

AnsysEM scripting under Linux with already opened Electronics Desktop

    • albertwieland
      Subscriber
      Hello,nI'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.nI 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.nI'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).nI only found a procedure on the forum to run a script without graphical output (/forum/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:n/opt/AnsysEM/AnsysEM20.2/Linux64/ansysedt -features=beta -ng -runscriptandexit test.pynA 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.nSo 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?nThanks in advance!n
    • HDLI
      Ansys Employee
      We could click Run script button (Automation in toolbar) to run another Python script in the opening AEDT. For the co-simulation between Simulink and Maxwell, we can find the detailed information in the Setting Up an External Circuit Using Simulink of the Manual.n
Viewing 1 reply thread
  • The topic ‘AnsysEM scripting under Linux with already opened Electronics Desktop’ is closed to new replies.