TAGGED: electronics, linux, python-scripting
-
-
November 26, 2020 at 11:15 am
albertwieland
SubscriberHello,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 (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: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 -
March 2, 2021 at 5:40 pm
HDLI
Ansys EmployeeWe 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
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.Â

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- simulation completed with execution error on server
- Maxwell, HFSS or Q3D?
- Unable to assign correctly the excitations in a coil
- Intersect errors with model with complex structure
- How to export Ansys Maxwell simulation results for post-processing in matlab or in .csv file
- Process ‘3dtds’ terminated abnormally
- Running ANSYS HFSS on the HPC (it runs on Linux only)
- Error while solving Optimetrics
- Concept of Interpolation Sweep in HFSS
- Error
-
8740
-
4658
-
3151
-
1678
-
1452
© 2023 Copyright ANSYS, Inc. All rights reserved.