Free (standard conforming) library to model mechanical (1D/3D), electrical (analog, digital, machines), magnetic, thermal, fluid, control systems and hierarchical state machines. Also numerical functions and functions for strings, files and streams are included.
initial equation
if initType == Init.SteadyState then
der(x) = 0;
elseif initType == Init.InitialState then
x = x_start;
elseif initType == Init.InitialOutput then
y = y_start;
end if;
Variables in clocked partitions cannot be used in initial equation or initial algorithm sections.
I know that the specification is considered more or less flawed when it comes to achieving the goal of being able to "sample any continuous-time model",
The goal is that every continuous-time Modelica model can be utilized in a sampled data control system. This is achieved by solving the continuous-time equations with a defined integration method between clock ticks. With this feature, it is for example possible to invert the nonlinear dynamic model of a plant, see Thümmel et al. (2005), and use it in a feedforward path of an advanced control system that is associated with a clock.
but while waiting for the specification to achieve this goal, the ClockedWithDiscretizedContinuousController should use a control block without initial equations.
The
ClockedWithDiscretizedContinuousController
contains a clocked instance ofModelica.Blocks.Continuous.PI
: https://github.com/modelica/ModelicaStandardLibrary/blob/35ad28dd83fa36b5393fad54fa38c08e94ba6bb6/Modelica/Clocked/Examples/SimpleControlledDrive/ClockedWithDiscretizedContinuousController.mo#L30However, this block contains an initial equation:
This means that the clocked variable
y
violates one of the two very basic rules about synchronous variable initialization in https://specification.modelica.org/master/synchronous-language-elements.html#initialization-of-clocked-partitions:I know that the specification is considered more or less flawed when it comes to achieving the goal of being able to "sample any continuous-time model",
but while waiting for the specification to achieve this goal, the
ClockedWithDiscretizedContinuousController
should use a control block without initial equations.