Please take a minute to review and accept our Terms of Use.
Welcome to the PLECS User Forum, where you can ask questions and receive answers from other members of the community.

Many technical questions regarding PLECS are answered on the Technical Solutions page of our website. Tutorial videos, specific application examples, and pre-recorded webinars are available on our YouTube page. Please follow us on LinkedIn for the latest Plexim news.

Coupling Plecs Simulation to a Python script | Pausing/Resuming Simulation?

0 votes
I have a Python-FEM Simulation that i want to couple with a Plecs Simulation over xml-rpc.
It should go like FEM->Plecs(1 time step)->FEM->Plecs(1 time step)

Is there any way to pause the Plecs Simulation at a given time, compute my FEM Simulation, update Variables for plecs and then continue the Plecs-Sim and so on?

server.plecs.simulate("model", opts) seems to start a new Simulation (Coils unmagnetized etc.) every time, even when setting Start- and StopTime correctly.

System States would do the trick, but can they be stored, loaded and erased via xml-rpc?
asked Apr 28, 2020 by Hannes (29 points)
edited Apr 30, 2020 by Hannes

1 Answer

+1 vote
Best answer
The XML-RPC interface currently does not support saving or loading the system state at the end resp. beginning of a simulation. Besides, it would be rather inefficient to let PLECS recompile and initialize the simulation model in every single simulation step.

To run PLECS and your FEM simulator side-by-side you can use the DLL block. You need to create a DLL that reads signal inputs from PLECS, sends them to your simulator, reads back the results and writes them to the output of the DLL block.
answered May 12, 2020 by Wolfgang Hammer (397 points)
selected May 12, 2020 by Hannes