.ModelicaDEVS.Templates.EEBlock

Information

Electrical-Electrical Block

Electrical-electrical blocks are the analogon to CCBlocks - they are used to wrap electrical components built from ModelicaDEVS blocks.

From an electrical signal to a DEVS signal, two type conversions have to be made: the first one is from electrical to real-type, the second one from real-type to DEVS. Hence, between the electrical positive/negative pins and the first/last DEVS component, there is an additional RealSignal connector (see the following figure and the code snippet below).




Note that the first/last DEVS block still has to be a transformation block that transforms the real-type signal to a genuine DEVS signal or vice-versa.
The following code snippet gives the declarations of the EEBlock:
1  partial model EEBlock
2    extends Modelica.Electrical.Analog.Interfaces.OnePort;
3    parameter Integer qssMethod=3 "Use QSS1, QSS2 or QSS3";
4    inner Miscellaneous.worldModel world(qss=qssMethod);
5
6  protected
7    Modelica.Blocks.Interfaces.RealSignal inDEVS ;
8    Modelica.Blocks.Interfaces.RealSignal outDEVS;
9
10 equation
11
12   inDEVS=p.i;
13   v=outDEVS;
14
15 end EEBlock;
Due to the need of a electrical-to-real type conversion, virtual connections from the electrical pins to the real-type ports (inDEVS and outDEVS) have to be drawn. This is done by the two equations on line 12+13.

It is important to mention that this kind of electrical-electrical block assumes the current to be given and calculates the voltage. This has to be done because of Modelica's concept of equations instead of assignments that entails non-directed data flow, if not otherwise stated by declaring variables to be of type input or output. DEVS blocks, on the other hand, are always directed. Hence, assumptions about the flow of data have to be made when transforming from electical Modelica components to ModelicaDEVS blocks.


Generated at 2024-12-26T19:25:54Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos