Search code examples
modelicadymolaopenmodelica

Global measure to test when steady state of system is reached


As I stared at the little blue lines inching to the right on my screen I got to thinking that it would be nice to have a feature in Dymola/OpenModelica (if it doesn't exist already).

The feature I'm thinking of would monitor the behavior of the system and either report back when steady state is achieved or can terminate the simulation when steady state is achieved. I imagine this could be tied to monitor the derivatives of all the state variables and when they all equal zero (within some user defined tolerance). Clearly this could be done by the user for simple models but for complex this would need to be an automated feature that occurs "behind the scenes".

I can think of a couple use cases:

  1. When you want to generate a steady state solution to for restarting another simulation this would avoid needing to simulate for very long times and assuming that you simulated long enough.
  2. If there was a function/variable, etc. like time that is built into the solution then the model perhaps reference that variable to add delay for switching on/off behaviors such as controller logic that you don't want to turn on until a steady state condition is reached.

It seems that this would be a fairly simple feature to add but potentially quite useful.

Does a feature like this exist or can you think of good reasons why it doesn't/shouldn't?


Solution

  • As far as I know we don't have this feature in OpenModelica yet, but sounds rather easy to implement. I opened a ticket about it and we'll see when we have time to implement it: https://trac.openmodelica.org/OpenModelica/ticket/4301