Parameters

An overview of Pywr parmeters supported by WaterStrategy

Paramters are functions that return a value in the model at each time-step. These values can be a constant, based on time (e.g., on the day or month), a calculation based on the time step's reservoir storage and many other calculations. Custom parameter can also be written in Python.

This page describes (most of) the parameter types supported by Pywr. An overview of parameters in Pywr can be found here. The full list of built-in Pywr parameters are found here.

1. Creating a Parameter

In a Network, click the 'Parameters' Tab:

CLick the 'parameters' tab

Next to the 'Parameters-Type Categories' section, click the '+' button and select 'PYWR_PARAMETER'.

Click on pywr_parameter

A text-input will appear. Enter the name of your parameter:

Enter the parameter name

Modify the parameter as required in the JSON editor provided:

Video demonstrating how to use a parameter for multiple nodes

2. Parameter editors in WaterStrategy

To make parameter modifications simpler, WaterStrategy offers editors for commonly used Parameters, such as Monthly Profile parameters, with pre-populated default values, and graphical editors to make entering of data simpler.

Example parameter editor

In the Parameters Tab, when adding a new Parameter, select 'PYWR_PARAMETER_MONTHLY_PROFILE' as shown:

Select PYWR_PARAMETER_MONTHLY_PROFILE

Note that the edior which appears will show a JSON tab, but also a Plot and Table tab. Modifying the data in the table will automaticall update the data in the JSON as shown:

Note the values have been edited in a spreadsheet editor

These changes automatically update the JSON:

Data is automatically updated in the JSON section

Last updated

Was this helpful?