Modelica Blocks Clause Samples

Modelica Blocks. ‌ Though Modelica is, at its core, a textual language for describing dynamical systems, it also has a sophisticated diagrammatic frontend for traditional block-based control law diagrams. Modelica control blocks are a specialisation of models that divide the contin- uous variables into inputs, outputs, and internal variables. A Modelica block diagram describes the behaviour of all continuous variables by a collection of blocks with connec- tions from inputs to outputs. These connections effectively become additional algebraic equations of the model that tie together pairs of variables in different blocks. Modelica has a large library of blocks in the Modelica.Blocks namespace includ- ing: • Continuous blocks, like Integrator and Derivative • Discrete blocks, that sample at a fixed time period • Logical blocks, that implement logic gate style blocks • Math blocks, that include arithmetic, trigonometry, and other related functions • Sources blocks, that include various signal generators An example block diagram is shown in Figure 6, which represents a similar bouncing ball model as that described in Example 7.1. We use a number of blocks from Modelica’s ▇▇▇▇- dard library including an Integrator from the Modelica.Blocks.Continuous namespace (Height), and a Gain block from Modelica.Blocks.Math (Restitution). Modelica also allows straightforward definition of customised blocks, and we therefore also define two of our own blocks. For convenience, we add textual labels to each of the connections in the diagram in dark red. The core dynamical behaviour of this diagram is provided by two integrator blocks, called respectively Velocity and Height. The Velocity block corresponds to the differential equation v˙ = −9.81, and the Height block to the differential equation h˙ = v. The gravitional constant is supplied to the former integrator by a constant block called Gravity which provides a constant signal output, and the input of Height is connected to the output of Velocity. The Height block is an instance of the Modelica Integrator block, which takes a single input signal, and provides the integrated signal output. The Velocity block is an adapted block called ResetIntegrator. The latter takes two inputs, in addition to the middle one that takes the signal to integrate. The top input is an initial value, which is used to construct the initial value problem. Initially, this value is supplied by the constant block InitVel that supplies a constant 0. The bottom input i...