This repository contains the code used for demonstrating the capabilities of the cloud-native simulation as a service-implementation developed at the chair of automation and energy systems at Saarland university by means of two use cases.
The repository also contains a very small Modelica-library DemoCloudNativeSIMaaS. The library implements the thermistor and thermistor circuit used in the second use case. An example ready to be simulated in a Modelica-IDE as well as the model used for export as FMU are included, too.
Clone the repository, then install the dependencies (specified in Pipfile
/Pipfile.lock
) into a new Pipenv-environment using pipenv install
.
All environment variables without a default value MUST be set before starting the program. Otherwise, a fatal error will be raised and the program will terminate with a non-zero exit code.
For example, the ENVVARs can be set by putting export UC1D_*=…
-statements in a file named .env
and then loading the contents of this file via source .env
.
Environment Variable | Description | Default Value |
---|---|---|
|
The origin of the URL identifying/locating simulation as a service-instance. Make sure that this can be resolved from the |
— |
|
The maximum number of retries for polling the status of a simulation (parsed as integer) |
|
|
The time between to retries for polling the status of a simulation in seconds (parsed as float) |
|
|
The minimal included log level that shall be printed |
|
|
The path to the FMU used for the ensemble PV forecast |
— |
|
The path to the FMU used for the parameter fitting-example using a genetic algorithm |
— |
|
Load the weather data from |
|
|
The origin of the URL identifying/locating an instance of the dwd_data_access-API; e.g.: |
— [1] |
|
The JSON web token for authentication with the dwd_data_access-API |
|
There are two demos:
-
demo-efc
implements an ensemble forecast for the power generated by a PV system. By default, it uses weather forecasts created at different points in time for the same day as input which doesn’t really make sense except for demonstrating that the process works. -
demo-ga
uses a genetic algorithm (GA) to search for a set of values for the components of a thermistor circuit that results in a desired voltage over temperature-curve. Each individual represents a combination of component values and the fitness of each individual in a generation is evaluated by a SIMaaS-instance — in parallel if and only if there are more than one worker instances.The parameters of the GA are currently not exposed, but could be tuned manually by editing lines 816 ff..
The code uses Invoke to create a CLI — see the code snippets below for usage instructions.
# Activate virtual environment
pipenv shell
# List available demos
invoke -c demo --list
# Load ENVVARs and run demo
source .env; invoke -c demo demo-efc
The code in this repository represents a proof of concept, published for educational purposes only.
There are no plans for further development.
From January 2017 to March 2021, this work was supported by the SINTEG-project “Designetz” funded by the German Federal Ministry of Economic Affairs and Energy (BMWi) under grant 03SIN224.