WaterStrategy
English
English
  • WaterStrategy Documentation
  • Support
  • Getting Started
    • Creating an Account
    • Logging In
    • Tour of WaterStrategy
    • Creating a new Project and Network
    • Sharing Projects and Networks
    • Exporting and Importing Models
    • Dealing with Model Errors
    • Uploading External Data
  • Modeling Basics
    • Water Resource System Modeling?
    • What is Pywr?
    • Pywr Concepts
    • Node Types
      • Water Input
        • Input Node
        • Catchment Node
        • Proportional Input Node
      • Water Transport
        • Link Node
        • River Node
        • Delay Node
        • RiverSplit Node
        • RiverSplitWithGauge Node
        • RiverGauge Node
        • BreakLink Node
        • PiecewiseLink Node
        • MultiSplitLink Node
      • Water Storage
        • Storage Node
        • Reservoir Node
        • VirtualStorage Node
        • RollingVirtualStorage Node
        • AnnualVirtualStorage Node
        • SeasonalVirtualStorage Node
        • AggregatedStorage Node
      • Water Output
        • Output Node
        • Loss Link Node
      • Hydropower
        • Turbine Node
      • Others
        • AggregatedNode
    • Allocation Penalties
    • Scenarios
      • WaterStrategy Scenarios
      • Pywr-Scenarios
        • Parameter and pywr-scenario Integration
    • Parameters
      • Base Parameter Class
        • Parameter
        • IndexParameter
      • Simple Parameters
        • Constant
        • Constant Scenario Parameter
        • Constant Scenario Index Parameter
      • Combining multiple parameters
        • Aggregated Parameter
        • Aggregated Index Parameter
        • Division Parameter
        • Negative Parameter
        • MaxParameter
        • Negative MaxParameter
        • MinParameter
        • Negative MinParameter
        • Offset Parameter
      • Time Series and Profiles
        • Daily Profile
        • Weekly Profile
        • Monthly Profile
        • Uniform Drawdown Profile
        • Scenario Daily Profile
        • Scenario Weekly Profile
        • Scenario Monthly Profile
        • Array Indexed Scenario Monthly Factors
        • RBF Profile
      • DataFrame Parameter
      • HDF5 Parameter
      • Array Based Parameters
        • Array Indexed Parameter
        • Array Indexed Scenario Parameter
        • Indexed Array Parameter
      • Threshold Parameters
        • Abstract Threshold
        • Storage Threshold
        • Node Threshold
        • Parameter Threshold
        • Recorder Threshold
        • Current Year Threshold
        • Current Ordinal Day Threshold
      • Interpolation Parameters
        • Interpolated Parameter
        • Interpolated Quadrature
        • Interpolated Flow
        • Interpolated Volume
      • Control Curve Parameters
        • Base Control Curve
        • Control Curve Interpolated Parameter
        • Control Curve Piecewise Interpolated Parameter
        • Control Curve Index Parameter
      • Hydropower Parameters
      • Others
        • Annual Harmonic Series Parameter
        • Deficit Parameter
        • Scenario Wrapper Parameter
        • Piecewise Integral Parameter
        • Flow Parameter
        • Flow Delay Parameter
        • Discount Factor Parameter
    • Recorders
      • Base Recorder
        • Recorder
        • Node Recorder
        • Storage Recorder
        • Parameter Recorder
        • Index Parameter Recorder
        • Aggregator
      • Numpy Array Recorders
        • Numpy Array Node Recorder
        • Numpy Array Storage Recorder
        • Numpy Array Level Recorder
        • Numpy Array Area Recorder
        • Numpy Array Parameter Recorder
        • Numpy Array Index Parameter Recorder
        • Numpy Array Daily Profile Parameter Recorder
      • Flow Duration Curve Recorders
        • Flow Duration Curve Recorder
        • Storage Duration Curve Recorder
        • Flow Duration Curve Deviation Recorder
        • Seasonal Flow Duration Curve Recorder
      • Deficit Recorders
        • Numpy Array Node Deficit Recorder
        • Numpy Array Node Supplied Ratio Recorder
        • Numpy Array Node Curtailment Ratio Recorder
        • Total Deficit Node Recorder
        • Deficit Frequency Node Recorder
      • Statistical Recorders
        • Aggregated Recorder
        • Mean Flow Node Recorder
        • Total Flow Node Recorder
        • Annual Total Flow Recorder
        • Mean Parameter Recorder
        • Total Parameter Recorder
        • Rolling Mean Flow Node Recorder
        • Minimum Volume Storage Recorder
        • Minimum Threshold Volume Storage Recorder
        • Timestep Count Index Parameter Recorder
        • Annual Count Index Threshold Recorder
        • Rolling Window Parameter Recorder
      • Index Recorders
        • Annual Count Index Parameter Recorder
      • File Recorders
        • CSV Recorder
        • Tables Recorder
      • Hydro-power Recorders
        • Hydropower Recorder
        • Total Hydro Energy Recorder
  • Applied Modeling
    • Reservoir and Storage Nodes
  • Tutorials
    • Creating and running a simple model
      • Creating and Running a Model
        • Setting up a Project and Network
        • Adding Nodes and Links (Edges)
        • Add Data to the Nodes
        • Setting the Time Horizon
        • Running the Model and Visualizing its Outputs
        • Creating a New Scenario
        • Exercise
      • Making Changes to a Model
        • Adding a Reservoir
        • Adding Basic Operating Rules
    • Modelling basin reservoir systems
      • Creating a New Project and Network
      • Adding a Dam (Reservoir)
      • Adding a Demand
      • Adding a Water Treatment Works with Losses
      • Adding a Source Representing Groundwater
      • Additional Exercises
      • Adding reservoir bathymetry, evaporation, and rainfall
        • Background on Evaporation and Precipitation on Reservoirs
        • Adding reservoir bathymetry (Area)
        • Adding reservoir bathymetry (Level)
        • Adding monthly evaporation and rainfall
      • Using allocation penalties and control rules to balance sources
      • Control Curves and Demand Savings
        • Adding reservoir control curves and demand savings (reductions)
    • Using Allocation Penalties to Allocate Water
      • Exercise 1a Two nodes
      • Exercise 1b Two demands
      • Exercise 1c Minimum Flow Properties
      • Exercise 2a Simple system with reservoir draw downs
      • Exercise 2b Simple system with overflow
    • Pywr-scenarios reading external DataFrame and adding Custom Rules
      • Uploading Files
      • Reading CSV DataFrame
      • Running pywr-scenarios
      • Reading h5 DataFrame for pywr-scenarios
      • Create Custom Rule - TranscientDecisionParameter
Powered by GitBook
On this page
  • Introduction
  • Clone the scenario and define a control curve
  • Associate demand factor
  • Define the baseline demand
  • Calculate timestep demand
  • Run the model and view the results
  • Exercise

Was this helpful?

Export as PDF
  1. Tutorials
  2. Modelling basin reservoir systems
  3. Control Curves and Demand Savings

Adding reservoir control curves and demand savings (reductions)

PreviousControl Curves and Demand SavingsNextUsing Allocation Penalties to Allocate Water

Last updated 9 months ago

Was this helpful?

Introduction

Control curves can be used to implement a demand reductions when reservoir levels go below certain thresholds. This represents the implementation of temporary demand management measures. In this exercise the demand will be incrementally reduced as the reservoir goes below certain storage thresholds. This exercise will demonstrate the, the as well as the as well as parameter nesting.

Clone the scenario and define a control curve

  1. Clone the 'Balanced sources' scenario and name the new one 'Demand reductions'

  2. First we will define a control curve which uses storage volume thresholds to progressively reduce demand to model demand restrictions being placed on a demand. The first curve is a (60% in come months and 45% in others) allowing for seasonal changes while the two subsequent curves are (40% and 10% of reservoir storage capacity).

The Control Curve will be defined in the Parameters tab. In the Parameters tab add a Pywr_Parameter.

Name the parameter 'storage control curve' and press Enter.

Paste in the following JSON code snippet below. Please note how the "Example reservoir" is referenced in the "storage_node"attribute.

{
	"type": "controlcurveindexparameter",
	"storage_node": "Example reservoir",
	"control_curves": [
		{
			"type": "monthlyprofileparameter",
			"values": [
				0.45,
				0.45,
				0.45,
				0.45,
				0.45,
				0.45,
				0.45,
				0.45,
				0.45,
				0.45,
				0.6,
				0.6
			]
		},
		{
			"type": "constant",
			"value": 0.4
		},
		{
			"type": "constant",
			"value": 0.1
		}
	],
	"__recorder__": {
		"timeseries": true
	}
}

Associate demand factor

  1. We will associate the following Demand Factors to the different control curve failure levels:

These will reduce demand to 90%, 80% and 50% of the Baseline demand corresponding to 10%, 20% and 50% demand reductions.

  1. Create a new Pywr_Parameter

  1. Name the parameter 'control curve demand factor' and press Enter.

  1. Paste in the following JSON code snippet below. Please note how the"storage control curve" is referenced in the "index_parameter"attribute.

{
	"type": "indexedarrayparameter",
	"index_parameter": "storage control curve",
	"params": [
		1,
		0.9,
		0.8,
		0.5
	],
}

The Paramsattribute takes in either scalars or Pywr parameters and the index of the array corresponds to index in the Parameter referenced in the index_parameter which in this case is the control curve.

  1. Select to make this Parameter output.

Define the baseline demand

Next we will define the baseline demand. This is the demand that the reservoir has before any reductions are implemented. In previous tutorial, the Example demand is defined as a scalar (0.1) on the Max_flow attribute of the Example demand output node:

We will replace this with a Parameter reference.

  1. First, we will define the baseline demand using a Constant Parameter.

Add a new Pywr_parameter.

And name it Baseline demand and press Enter.

  1. The baseline demand will remain 0.1 Mm3/day. Copy and paste the JSON code snippet into the JSON tab.

{
	"type": "constant",
	"value": 0.1
}

At each time step, the modeled demand will be the Baseline Demand multiplied by the Demand Factor:

Timestep demand = Baseline demand x Demand Factor

Calculate timestep demand

  1. Add a new Pywr_parameter.

Name the new parameter 'timestep demand'

  1. Copy and paste the JSON code snippet into the JSON tab.

{
	"type": "AggregatedParameter",
	"agg_func": "product",
	"parameters": [
		"baseline demand",
		"control curve demand factor"
	]
}

Select to make this Paramter value be output in each time step.

  1. The 'timestep demand' defines the demand at each time step taking into account the state (i.e. real-time storage) in the Reservoir.

This Parameter needs to be referenced on the max_flow attribute of the Demand node.

  1. Click on the Demand node and write or paste 'timestep demand' in the max_flow attribute replacing the scalar value (0.1).

Please note, if the Parameter name does not save, change the type of the entry to "Descriptor".

Don't forget to save the changes.

Run the model and view the results

  1. Run the model.

  1. View the simulated _volume on the Reservoir

You can zoom into the drought, for example this is the drought that occurred in 2042-2044.

In the the Scenario with demand reductions, the Reservoir did not go to as low of storage (9.4 vs 8.17 Mm3).

  1. Click on the simulated_flow of the Demand node. The demand reductions can be seen.

  1. You can view the control cure parameter output by clicking on the Network Data view.

Clicking on simulated_storage control curve shows what index the storage control curve is returning at each time step. This varies between 0-2.

Exercise

  1. Increase the Baseline Demand Parameter. How high can baseline demand be before the reservoir fully empties?

At each time step the will return an Index Value as shown below:

These Indices can be associated to a Demand Factor which will be defined using an . The Demand factor will be used to reduce demand when each control curve threshold is passed.

This can be accomplished by using an .

Control Curve Index Parameter
Indexed Array Parameter
Aggregated Parameter
Control Curve Index Parameter
Indexd Array Parameter
Aggregated Parameter
Monthly Profile
Constants
Reservoir control curve
Add a Pywr_Parameter
storage control curve
Paste the code and save
Select recording timeseries and save
Reservoir control curve
Reservoir control curve
Create a new Pywr_Parameter
Name the parameter
Paste the code and save
Select recording timeseries and save
Example demand
Add a new Pywr_parameter
Name the new Pywr_parameter
Paste the code and save
Add a new Pywr_parameter
Name the new parameter
Paste the code and save
Select recording the timeserries
Enter max_flow attribute name
Click on edit the max_flow
Select DESCRIPTOR
Enter the name
Click on to run the model
Simulated _volume on the Reservoir
Simulated _volume on the Reservoir in 2042-2044
simulated_flow of the Demand node
Click to view the control cure parameter output
Control cure parameter output