From 1e8050dc11008572200f7fa60f077c944318ec58 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christoff=20B=C3=BCrger?=
-A Clock type is a base data type (introduced in Modelica 3.3, additionally to Real, Integer, Boolean, String) that defines when a particular partition consisting of a set of equations is active. Starting with Modelica Language Version 3.3, every variable and every equation is either continuous-time or is associated exactly to one clock. This feature is visualized in the figure below where c(ti) is a clock that is active at particular time instants ti and r(ti) is a variable that is associated to this clock. A clocked variable has only a value when the corresponding clock is active: +The Clock type is a base data type introduced in Modelica 3.3 (additionally to Real, Boolean…) +which can be understood as a specialized Boolean type: +Clock variables are either true (also called \"active\") or false (\"inactive\"). +It is specialized in the sense that each Clock variable generates a partition +consisting of a set of equations which gets activated when the clock is active. +In fact, every variable and every equation of a Modelica model (starting with Modelica Language Version 3.3) +is assigned to a partition: +
++This feature is visualized in the figure below where c(ti) is a clock that is active +at particular time instants ti and r(ti) is a variable that is associated to this clock. +Notice that a clocked variable has only a value when the corresponding clock is active:
+The Clock type introduced above is a base type of the Modelica language +and it is mostly intended for textual model description. +The Clocked library encapsulates this base type and allows for +graphical modeling thanks to the clock blocks and connectors it provides. +
Similarly to RealInput, RealOutput etc., clock input and output connectors, called ClockInput and ClockOutput, are defined in sublibrary ClockSignal.Interfaces -in order to propagate clocks via connections. A clock signal can be generated with -one of the blocks of sublibrary +in order to propagate clocks via connections. +
++A clock signal can be generated with one of the blocks of sublibrary ClockSignals.Clocks:
@@ -34,6 +58,7 @@ The output signals of the blocks in the above figure are clock signals, by default visualized with dotted grey lines. +With the blocks of sublibrary ClockSignals.Sampler @@ -49,44 +74,65 @@ is generated:
-As usual in synchronous languages, a clock is represented by a true value -when the clock is active. The relationship between such derived +The relationship between such derived clocks is exact, so it is guaranteed that at every 3rd tick of clock \"periodicRealClock.y\", the clock \"subSample.y\" is active.
++A clocked partition is a set of equations that depend +on each other and where the boundary variables are marked +with sample and hold operators (boundary with other clocked partitions +or with the global continuous-time partition). + +A sub-clock partition is a part of clock partition that use a specific derived clock, +separated from other sub-clock partions by operators like subSample and superSample. +All equations within a sub-clock partition are active at the same time. +
++There are two types of sub-clock partitions: +
++Notice that it is an error if a partition doesn't fall into one of these two categories, e.g., if operators +previous and der are both used in the same partition. +This means it is not allowed to mix continuous time and discrete-time operators in a clocked partition +(unlike in the global continuous time partition). +
++Also notice that in a clocked discrete-time partition all event-generating mechanisms +do no longer apply. Especially neither relations, nor one of the built-in event +triggering operators will trigger an event. +
+ +If a clock is associated to a clocked continuous-time partition, then an integrator has to be defined that is used to integrate the partition from the previous -to the current clock tick. This is performed by setting parameter useSolver -= true and defining the integration method as String with -parameter solver. Both parameters are in tab Advanced -of one of the clock signal generating blocks. +to the current clock tick. +This is performed by setting, for the corresponding clock signal generating block, +parameter useSolver = true +and defining the integration method as String with parameter solver. +Both parameters are to be found in tab Advanced +of clock signal generating blocks. The possible integration methods are tool dependent. It is expected that at least the solvers \"External\" (= use the integrator selected in the simulation environment) and \"ExplicitEuler\" (= explicit Euler method) are supported by every tool. For an example, see Examples.Systems.ControlledMixingUnit.
- --A clocked partition is a set of equations that depend -on each other and where the boundary variables are marked -with sample and hold operators. -If a clocked partition contains no operator der, delay, -spatialDistribution, no event related operators (with exception of noEvent(…)), -and no when-clause with a Boolean condition, it is a clocked discrete-time -partition, that is, it is a standard sampled data system that is described by difference equations. -If a clocked partition is not a clocked discrete-time partition and -it contains neither operator previous nor operator -interval, it is a -clocked discretized continuous-time partition. -Such a partition has to be solved with a solver method. -It is an error, if none of the two properties hold, e.g., if operators -previous and der are both used in the same partition. -In a clocked discrete-time partition all event generating mechanisms -do no longer apply. Especially neither relations, nor one of the built-in event -triggering operators will trigger an event. -