-
Notifications
You must be signed in to change notification settings - Fork 2
Sources
In PARODIS, parameters and disturbances can have data sources. Hereby, the sources for both are handled in very much the same way.
To manage and access data sources, PARODIS uses the SourceManager
, which exposes the public method getDataFromSource
function [data] = getDataFromSource(T, source, callingAgent, agents, numScenarios)
Three types of sources are available: function handles, filenames to CSV sources, static values.
-
Function handles: If a function handle is given as a source, it is called with the same arguments as
getDataFromSource
, minus thesource
argument
data = source(T, callingAgent, agents, numScenarios);
-
CSV sources: if a CSV shall be used as a data source,
source
must be the path to the CSV file (any file extension is allowed, the file must be in CSV format). The CSV must contain column-wise time series representation of the data, and PARODIS will linearly interpolate the actual data at timestepsT
from these timeseries. -
Static: If the parameter or disturbance shall always take the same value, it can simply be put as the source. The source manager will return the static value wrapped into a cell-array with
numScenarios
entries
How these sources are treated differs from the use case, though:
There are two disturbances sources, one for the predicted disturbances and one for the real disturbances:
- controller.predDisturbanceSource
- controller.realDisturbanceSource
For the predicted disturbance, it is expected that the function handle returns a cell array with numScenarios
entries, which are all
For the real disturbance source, it is expected that one cell with a
For CSV sources, two possibly file formats are allowed for predicted disturbance sources:
- A) A file with
$N$ rows and$1+n_d \cdot N_\mathrm{pred}$ columns - B) A file with
$N$ rows and$1+n_d$ columns
where first row is always some time in simulation time scale (i.e. in the same unit as the sample times T_s
).
In case A), at each time step within the simulation, PARODIS will read an entirely new prediction matrix from the file, i.e. one row in the CSV file is one entire prediction matrix.
In case B), PARODIS will interpolate T(1)
, so the predictions are "rolled" through.
In both cases, PARODIS will repeat the data numScenarios
times.
For real disturbances sources, case B) applies for the file format. PARODIS will then interpolate only the first entry, instead of an entire horizon, and return that value.
Parameter sources behave very much like disturbance sources, yet are a little less complicated
Since parameters have predefined dimensions, recalling
controller.addParam(name, dimensions, source, scenarioDependent)
The source must return values of the defined dimensions
. If a function handle is used, it must return a cell array with numScenarios
cells, each filled with a matrix of size dimensions
. For a static value, the matrix dimensions must simply match.
At this moment, CSV files are only supported like case B) for the CSV files of disturbance sources. This means, the CSV file must contain n_p
is the number of rows the parameter has. From these files, PARODIS will interpolate T(1)
, so the predictions are "rolled" through.
From this, PARODIS will wrap the interpolated numScenarios
entries.
- Prerequisites
- Installing PARODIS
- Creating an Ansatz
- Setting up an Agent
- Setting up a Simulation
- Setting up Figures
Pareto Optimization
Modules
- Simulation
- Agent
- Model
- Controllers
- Cost Functions
- Sources
- Plotting
Other