About eELib
The implementations of the eELib hold some characteristics that are explained in the following. The focus is on the architecture of simulations (we use the co-simulation framework mosaik to run simulations with eELib models) and the design of simulations (event-based such that we take interdependence between models into account).
Coupling With mosaik and Architecture of a Simulation
One major thing to know for working with and using the eELib is that we are using a co-simulation tool (mosaik) to run simulations, as the eELib itself just provides the implementation of models and no configuration to run a simulation, respectively, no central simulator. To make the above mentioned investigation cases possible, one needs to couple the different models of the library in scenarios to be created, e.g., a PV system with the energy management system (EMS). For this purpose, an Orchestrator is to be used, which performs the exchange of data sets between models, calls the calculation of the individual models and controls the general model flow as well as the coupling with a database. mosaik is intended for these tasks. Certain input values are assumed, data sets are calculated internally, and output data sets are issued. See the eELib docomentation part on mosaik for more information. The eELib should definetily be usable with other orchestrators of a simulation, but the explanations in this documentation are done for mosaik and its simulation orchestration. Additionally, the eELib provides simulators to its models that serve the prupose of APIs for a simulation with mosaik.
The following graphic illustrates the architecture of a simulation and the usage of mosaik in it. To explain the terms used for the parties, look at the glossary. While the eELib provides implementations for the models and their simulators, mosaik is used for a simulation. Additionally, a scenario script and data for the scenario (like parameterization of the model entities and linking of entities) have to be provided. Examples for these last two are provided within the eELib in an examples part.
The architecture of a simulation using mosaik with the eELib.
For a setup of a simulation, have a look at the following illustration. It depicts the physical and data connections between the different parts of the eELib.
The setup of a (grid) simulation with the eELib.
Event-Based Simulation
The computations within the eELib - using mosaik - are executed in an event-based manner. This implies the simulation process to depend on the triggering of events. Independent of a step size - the length of a simulation step in seconds - the process within one simulation step is executed by event triggering, as depicted in the following figure. To add to the explanation of mosaik, the execution of events depends on triggering such events. E.g. the simulation of a BSS is triggered by an EMS sending a power set value to the BSS. For this, mosaik knows about …
… when each model has to be called for calculation.
… which outputs for the models are send to which inputs for other models.
The simulation process of event-based simulation.
mosaik calls the calculation of the entities via the simulator
models calculate output with the already given input
simulator returns the timestep, when the models have to be calculated next
mosaik sends the output to a connected entity (e.g. the power generation of a PV system to the HEMS)
mosaik then calls the calculation of the next entity for which all inputs have been collected (this is done by means of the word “triggering”, so the finalized calculation of one entity triggers the calculation of another entity…)
This is done within a single timestep as long as data is sent between the entities so that the renewed calculation of a model entity is triggered. mosaik calls the execution of the models in the way they are connected to each other and send values each way. If everything is finished for this timestep, mosaik advances to the next timestep and the simulation process carries on.
The following figure better shows the implementation of the event-based process within one simulation step. It shows that when a model is called, the inputs for the models are provided by mosaik and set by the simulator. Afterward, the models are stepped, and ultimately, the simulators are called to extract the (by mosaik requested) result outputs from the models.