6.13.1. Real-time Simulation

6.13.1.1. How to run RT-simulations

EINSTEIN is running in batch mode when called from command line whenever the –real-time option is specified

python einstein.py [projectName] [alternativeProposalNo] –real-time=<Source> [–rtmode=<Mode> …]

6.13.1.2. Command line parameters

projectName: Name of the project in the data base to be simulated (default: last opened project)

alternativeProposalNo: Number of the alternative in the project to be simulated (default: last alternative used)

–real-time: Source of data being used for real time simulation This can be a csv-data file or a SQL data base configuration file

–rtmode: One of the following modes

  • real-time: real time simulation. New simulation steps are carried out whenever new monitoring data are available.
  • real-time-emulation: Emulates the behaviour of real-time simulation (for testing purposes) reading data ex-post.
  • ex-post: Simulation of the system ex-post using available monitoring data

–start: Start date of simulation Default: simulation beginning at first entry in data source

In case a start date is given, EINSTEIN looks up for a file “<source>.state” in order to continue a previous simulation.

–stop: End date of simulation Default: simulation ending at last entry in data source (for rtmode=real-time-emulation and ex-post); endless loop in case of rtmode=real-time

–forecast: Tuple (t_fc, dt_fc, fcMode[:fcPars]) indicating time of forecast t_fc, the time step for forecast simulation dt_fc (both in hours) and the forecast mode fcMode with corresponding parameters fcPars (see below):

fcMode is the forecast mode (see technical manual for details:

  • CONST: actual value assumed to remain constant in the future
  • TREND: starting from actual value approaching gradually a linear trend

fcPars list of parameter values separated by a semicolon (;), depending on the fcMode

fcMode CONST: 0 parameters

fcMode TREND: 5 parameters

1: tau_trend time constant with which the level of the trend curve is updated

2: tau_gtrend time constant with which the derivative of the trend curve is updated

3: tau_inst time constant for the approach from last actual value to trend curve in actual forecast

4: tau_random …

5: tau_xy …

EXAMPLE: –forecast=(4.0, 0.25, “TREND: 4.0; 8.0; 1.0; 0.0; 0.0”)

–opt: file name of data file (in APPDATA folder) containing the configuration data for parameter optimisation (see section on optimisation)

6.13.1.3. CSV file format

See format of monitoring data files

6.13.1.4. SQL database configuration

SQL databases used should have the following tables:

  • Sensors
  • Data

6.13.1.5. Interruption and reanudation of simulations - state file

Real time simulations can be interrupted (by the user, or by accident, e.g. current shut-down, …) and reanudated without loss of information. For this purpose the state variables of the simulation (such as storage temperatures, etc.) are stored in the .state-file, located in the APPDATA folder. (adding to the real-time source file the extension “.state”)

Whenever such a state file is present, the state variables are loaded from this file and the real-time simulation reanudates the previous simulation.

In order to start a simulation from scratch again, this state-file can be manually removed.