# Parameters

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](https://pywr.github.io/pywr-docs/master/json.html#parameters). The full list of built-in Pywr parameters are found [here](https://pywr.github.io/pywr-docs/master/api/pywr.parameters.html).

## 1. Creating a Parameter

In a Network, click the 'Parameters' Tab:

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FjaZ399iP3lKIOSySlDgi%2Fimage.png?alt=media&#x26;token=b17b2a4f-f23f-42ed-bc94-4b3575fcffca" alt=""><figcaption><p>CLick the 'parameters' tab</p></figcaption></figure>

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

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FLE8zqyGUi5XSFBPTKpiz%2Fimage.png?alt=media&#x26;token=5d44f068-8db6-401e-b786-8151d8dea753" alt=""><figcaption><p>Click on pywr_parameter</p></figcaption></figure>

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

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2F3FyAwZs26BGcRKl731tt%2Fimage.png?alt=media&#x26;token=ca0641f8-3d39-4177-ac98-05162106dacd" alt=""><figcaption><p>Enter the parameter name</p></figcaption></figure>

Modify the parameter as required in the JSON editor provided:

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FyWPCLakHBieD8GNrUFtR%2Fimage.png?alt=media&#x26;token=7739e253-f778-48f8-9b19-ea00e34828ba" alt=""><figcaption></figcaption></figure>

{% embed url="https://www.youtube.com/watch?v=u-3hotZj_44" %}
Video demonstrating how to use a parameter for multiple nodes
{% endembed %}

## 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:\\

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FSorIuTaedoOGidpvaakp%2Fimage.png?alt=media&#x26;token=8375dcdf-4b36-4f3f-8d20-ded3c04f4b7e" alt=""><figcaption><p>Select PYWR_PARAMETER_MONTHLY_PROFILE</p></figcaption></figure>

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:\\

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FZRANFWnjRCWVJdOL9JVI%2Fimage.png?alt=media&#x26;token=a0e54928-daa2-46db-bc35-677046897b45" alt=""><figcaption><p>Note the values have been edited in a spreadsheet editor</p></figcaption></figure>

These changes automatically update the JSON:

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FmxXWFV5yg1zpoNoyjpT4%2Fimage.png?alt=media&#x26;token=54723415-13de-487b-a65e-5c262e893619" alt=""><figcaption><p>Data is automatically updated in the JSON section</p></figcaption></figure>

##
