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.

Can I change system's initial state via scripting?

0 votes
I have problems finding the steady-state of a converter using the steady-state analysis tool. In time domain my system reaches steady-state. Is it possible to save the state of a system using scripting and then re-run the time-domain analysis with that state? I do not see anything in SolverOpts variable.

Are there any good tips on how to setup the steady-state tool? I tried various combinations of start-time, init cycles but to no avail.
asked Apr 24, 2020 by owiecc (14 points)
Hello, I'll look into answers for your questions, but in the meantime, are you able to post a model that has the issue? Is your system periodic?
Thank you Kris. Yes, the system is periodic. There is a simple PI controller. If I run the time domain simulation I can reach the steady state fairly quick. I tried adding similar number of init cycles into the steady-state analysis tool in order to be as close to the steady-state as possible but it does not help.

1 Answer

0 votes
Thank you for posting your model. With a DAB topology, I suppose the system itself is periodic, but I would actually expect the variable phase shift nature of the control scheme to prevent the Steady-State Analysis from providing a proper solution. I think that would be true even if you ran a transient simulation to steady-state conditions, then saved the system state, and then used that saved system state to run a future Steady-State Analysis. If, however, you don't actually need to use the Steady-State Analysis tool, but just want to start a transient simulation from a script where the initial state variables are assigned their steady state values, you can certainly do this from the Simulation > Simulation Parameters menu, in the Initialization tab of that window (it looks like you already were exploring this option as there is a previously saved state). You just need to select the "Stored system state" as the system state that the solver initializes from, which was not the case in your model. I hope this helps!

answered May 2, 2020 by Kris Eberle (1,575 points)
I have two questions to your answer:

1. Within certain phase shifts limits the control should be fairly linear. Steady-state tool calculates the Jacobian to find the steady-state. If I provide enough init cycles to be close to the solution why would the tool fail? Are there specific conditions that prevent it from finding the solution? Is there a way to see the Jacobian matrix?

2. I know about the possibility to store the state and then restarting the analysis. However, is there a way to do it using built-in scripting or RPC call? If yes. then I can create my own "steady-state analysis". I just need to do some test with multiple operating points and the ability to store the state in a script would be super helpful.

I've had another look at this model and my previous answer is misleading as your phase-shifted modulation does not inherently cause a problem with the Steady-State Analysis.

To answer your first question- the analysis can fail because the sensitivities of the system may be such that for a small deviation from the true steady-state solution the algorithm may totally overshoot.

The request in your second question above is not supported unfortunately.

With regards to the issue you are seeing, please see the paragraph in our Online Help/User Manual "Analysis Tools > Steady-State Analysis > Limitations > State variable windup". In essence, if you limit the integrator in the Controller subsystem to the interval [0 1], the analysis quickly converges to a solution that appears reasonable.