This example demonstrates the implementation of a simple room model
that is implemented in the Python module Resources/Python-Sources/SimpleRoom.py
.
The Python model computes a first-order response to the room model.
It returns the current room air temperature and the energy consumed during the simulation.
The Python module also passes an object from one call to the next. This object
contains the past room temperature, energy and time when the function was called,
stored as a Python dictionary.
This illustrates how Python data structures can be passed between function calls,
thereby enabling for example to call some (memory-intensive) machine learning program,
implemented in Python, from a Modelica block that may then pass the output of this program
to a controller.
Note that this example is for demonstration only. An implementation in Modelica would be much simpler and computationally more efficient.
OnOffController
.
This is for
#3595.