RapidNet
Fast Stochastic MPC for Drinking Water Networks
|
Public Member Functions | |
SmpcController (Forecaster *myForecaster, Engine *myEngine, SmpcConfiguration *mySmpcConfig) | |
SmpcController (string pathToConfigFile) | |
void | initialiseSmpcController () |
void | controllerSmpc () |
uint_t | controlAction (real_t *u) |
uint_t | controlAction (fstream &controlOutputJson) |
DwnNetwork * | getDwnNetwork () |
ScenarioTree * | getScenarioTree () |
SmpcConfiguration * | getSmpcConfiguration () |
Forecaster * | getForecaster () |
Engine * | getEngine () |
void | moveForewardInTime () |
real_t | getEconomicKpi (uint_t simulationTime) |
real_t | getSmoothKpi (uint_t simulationTime) |
real_t | getNetworkKpi (uint_t simulationTime) |
real_t | getSafetyKpi (uint_t simulationTime) |
void | updateKpi (real_t *state, real_t *control) |
~SmpcController () | |
Protected Member Functions | |
void | dualExtrapolationStep (real_t lambda) |
void | solveStep () |
void | proximalFunG () |
void | dualUpdate () |
uint_t | algorithmApg () |
void | updateSmpcConfiguration (real_t *updateState, real_t *control, real_t *demand) |
GPU-based stochastic model predictive controller for management of the drinking water water network. This method is used dual proximal gradient method to solve the optimisation problem resulted from the stochastic mpc controller. This algorithm is completely parallelisable takes full advantage of parallel computational capability of the GPU devices.
The object initiates the controller object. This contains
SmpcController::SmpcController | ( | Forecaster * | myForecaster, |
Engine * | myEngine, | ||
SmpcConfiguration * | mySmpcConfig | ||
) |
Construct a new Controller with a given engine.
myForecaster | An instance of the Forecaster object |
myEngine | An instance of Engine object |
mySmpcConfig | An instance of the Smpc controller configuration object |
SmpcController::SmpcController | ( | string | pathToConfigFile | ) |
Construct a new Controller with a given engine.
pathToConfigFile | path to the controller configuration file |
SmpcController::~SmpcController | ( | ) |
Destructor. Frees allocated memory.
|
protected |
This method executes the APG algorithm and returns the primal infeasibility.
Computes a control action and returns a status code which is an integer (1 = success).
u | pointer to computed control action (CPU variable) |
uint_t SmpcController::controlAction | ( | fstream & | controlOutputJson | ) |
Compute the control action, stores in the json file provided to it and returns a status code (1 = success).
controlJson | file pointer to the output json file |
void SmpcController::controllerSmpc | ( | ) |
Invoke the SMPC controller on the current state of the network. This method invokes #updateStateControl, eliminateInputDistubanceCoupling and finally algorithmApg.
|
protected |
Performs the dual extrapolation step with given parameter.
extrapolation | parameter. |
|
protected |
Performs the update of the dual vector.
DwnNetwork * SmpcController::getDwnNetwork | ( | ) |
Get's the network object
Forecaster * SmpcController::getForecaster | ( | ) |
Get's the Forecaster object
Get's the forecaster object
ScenarioTree * SmpcController::getScenarioTree | ( | ) |
Get's the scenario tree object
SmpcConfiguration * SmpcController::getSmpcConfiguration | ( | ) |
Get's the Smpc controller configuration object
void SmpcController::initialiseSmpcController | ( | ) |
Performs the initialise the smpc controller
void SmpcController::moveForewardInTime | ( | ) |
|
protected |
Computes the proximal operator of g at the current point and updates (primal psi, primal xi) - Hx, (dual psi, dual xi) - z.
|
protected |
Computes the dual gradient.This is the main computational algorithm for the proximal gradient algorithm
update the KPI at the current time instance
|
protected |
When the SIMULATOR FLAG is set to 1, the previousControl, currentState and previousDemand vectors in the smpc controller configuration file are set.
updateState | update the currentX in the controller configuration json |
control | update the prevU in the controller configuration json |
demand | update the prevDemand in the controller configuration json |
Update tje json file using the commands from rapidJson functions When the SIMULATOR FLAG is set to 1, the previousControl, currentState and previousDemand vectors in the smpc controller configuration file are set.
|
protected |
|
protected |
Pointer array for device pointers of accelerated psi
|
protected |
Pointer array for device pointers of accelerated xi
|
protected |
Pointer array for device pointers of primal psi
|
protected |
Pointer array for device pointer of primal xi
|
protected |
Pointer array for device pointers of cost Q
|
protected |
Pointer array for device pointers of cost R
|
protected |
Pointer array for device pointers of control
|
protected |
Pointer array for device pointers of reduced decision variable
|
protected |
Pointer array for device pointers of state
|
protected |
Updated state for the simulator
|
protected |
Pointer to device accelerated Psi
|
protected |
Pointer to device accelerated Xi
|
protected |
Pointer to device dual Psi
|
protected |
Pointer to device dual Xi
|
protected |
Pointer array for primal infeasibility Hx-z
|
protected |
Pointer to device primal Psi
|
protected |
Pointer to device primal Xi
|
protected |
Pointer to device Psi
|
protected |
Pointer for cost Q
|
protected |
Pointer for cost R
|
protected |
Pointer to device control
|
protected |
Pointer to device update psi
|
protected |
Pointer to device updated xi
|
protected |
Pointer to device reduced control
|
protected |
Pointer to device state
|
protected |
Pointer to device Xi
|
protected |
|
protected |
Flag Factor step
|
protected |
|
protected |
|
protected |
Pointer to the Forecaster object This contains the forecast of the demand and prices
|
protected |
Pointer to the Smpc configuration object This contains the configurations for the controller
|
protected |
|
protected |
|
protected |
|
protected |
Step size
|
protected |