.DESLib.ARENALib.UsersGuide.HybridModel

Information

Hybrid system modeling using ARENALib

DEVSLib Compatibility

Due to the compatibility between DEVSLib and ARENALib, the functionalities included in DEVSLib for modeling hybrid systems can be used in ARENALib. This is, the Quantizer, CrossUP, CrossDOWN and DICO models can be combined with the ARENALib blocks.

The use of the CrossDOWN and CrossUP models to detect the condition to generate new messages is shown in the next figure.

Assign Module

The Assign module has been developed using the ExternalAssign block from the SIMANLib library to provide an interaction mechanism between the flow of entities and the continuous-time part of the model. Like in the behavior of the ExternalAssign block, the discrete assignments to ARENALib variables or attributes are translated to a continuous-time real variable (y). A boolean port, named change, has also been included and switches its value every time a new assignment is perfomed by the module.
These ports are shown in the Assign block (SetFlowRate) included in the previous figure.

The following code shows the detection of variable assignments (checking the value of the truckL1.change port, where truckL1 is an ExternalAssign block) and the reinitialization of continuous-time variables.

when change(SetFlowRate.change) then tankFlowRate := SetFlowRate.y; end when;

ExternalProcess Module

Additionally, in order to provide a mechanism to describe the duration of the processes in the system using continuous-time models instead of probability distributions, the ExternalProcess module has been developed and included in ARENALib.
This module is basically a Process module, that represents a process applied to the entities, but includes two additional ports: EntityStart and EntityEnd. These ports are shown in the next figure.

Each time an entity has to be processed, the ExternalProcess module sets its EntityStart port with the value of the serial number of that entity.
The external process has to check the changes in the values of that port, in order to detect new entity arrivals and start processing them.
When the external process finishes with the entity, it has to set the EntityEnd port of the ExternalProcess module with the serial number of the entity that just finished the process.
The module detects the finished entity and sends it to the next flowchart module.


Generated at 2024-04-28T18:16:21Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos