Search code examples
modelicadymolaopenmodelica

Modelica: identify instability / cyclic pattern and issue warning


I am trying to create a generalized warning block to identify equipment cycling. The purpose is that user can drag and drop this Modelica block and connect it to a sensor or equipment and the block will look for a cyclic pattern and issue a warning in the simulation log.

I have created a block that issues a warning everytime the variable crosses the range using Modelica.Utilities.Streams.print and zero crossing logic (to limit the warning once per limit cross and avoid repetition of the wrning till the time variable stays out of the given range).

To identify a cyclic pattern, I was thinking of der(u) with a counter to calculate number of maxima and minima in the given period. Is there a better way of doing it?


Solution

  • Another option where to sample the signal, but this may be a problem when -- in a stability analysis -- you may not know what a critical frequency and thus a critical sampling frequency is.

    I think there is unfortunately no best case to do it. There was a discussion going on this issue in the Modelica Association some time ago. So, for continuous signals determining the zero crossings of the derivative of the signal is a good way to go.