Note: This is documentation for version 4.3 of Source. For a different version of Source, select the relevant space by using the Spaces menu in the toolbar above

Restriction Curves

About Restriction Curves

Restriction curves allow you to control your model's behaviour based on when it enters a certain state. For instance, if dam water volumes drop below 60%, restrictions on water supply may be imposed for a period of time to reduce the use of a declining resource. Restrictions are usually lifted when dam water volumes exceed another dam volume higher than the volume at which the restriction was applied. In this way a particular restriction is not lifted until there is some significant recovery in stored water volume above the volume at which the restriction was applied.

Restrictions or triggers can also be used to trigger events such as releases from a certain storage, desalination supply rates or environmental flows based on salinity levels. The aim of the restriction curve is to generate a Restriction Level time series that tracks what level of restriction the system is in. This Restriction Level time series can then be used to modify some other variable such as demand or inflow (desalination) as well as being a measure of the standard of service delivered.

As shown in Figure 1, a restriction curve might have different values depending on whether the system is rising (denotes a filling system) or falling (a falling system). The number in the legend refers to the restriction level (0 for no restrictions, 1 for restriction level 1, 2 for restriction level 2 and so on).

For detailed information, refer to the /wiki/spaces/SD43/pages/53543079.

Note: Restriction curves are associated with a scenario.

Figure 1. Restriction Curve Explorer

Creating Restriction Curves

You can model restrictions in Source with the Restriction Curve Explorer by choosing Edit » Restriction Curves. Right click your scenario and choose Add Restriction/Trigger Level Curve to create a new restriction curve.

Configuration

You can also create multiple restriction curves, each referenced by a unique auto-generated index number, named Index. The first restriction curve has an index of 0 and the next 1, etc. Each restriction curve can be used to trigger a different type of event. For example, one can be used for water resources restrictions, a second for environmental flows and a third for desalination trigger levels.

Initial Level refers to the restriction level that the system starts in. This could be very important when modelling a scenario run with a short time series. For instance, if a model run started during a drought, the initial restriction level would need to be set to reflect this.

Triggers

Specify the following values in the triggers table:

  • Restriction Level – what level of restrictions the model is in;
  • Return value – what value to modify the system with. You can write a function in Inflow or Water User node feature editor (Function Editor menu item) to modify demand and reference the return value in the function (see below);
  • Falling value – the trigger value for entering that restriction level from a lower restriction level; and
  • Rising value – the trigger value for entering that restriction level from a higher restriction level.

 

Note: The falling restriction curve for Restriction Level 0 is redundant and is not used (there is no less severe restriction than Level 0). However, you need to enter rising values for Level 0, or the model cannot leave Restriction Level 1 and enter Level 0.

 

To delete a restriction level and its associated values (ie. a row in the Triggers table), right-click on the row that you wish to delete (the row will turn blue) and press Delete on your keyboard. 

You can also rename or delete the restriction curve using the contextual menu. 

Importing and exporting curves

Once you have designed your restriction curve you can export this as a .xml file. This curve can then be imported into a different project to ensure consistency and reduce set up time. Use the Export and Import buttons respectively.

Using Restriction Curves

To use a restriction curve in your model, you need to set up several functions and modelled variables in the Function Manager. This process is detailed in Table 1, with example functions shown that use the Restriction Curve in Figure 1. In the example, it is assumed that you are familliar with using functions and variables in Source. See/wiki/spaces/SD43/pages/53543436 for more details. 

Table 1. Process of using Restriction curves with a worked example. 
ProcessExample
Create a restriction curve in the Restriction Curve Explorer as described above in Creating Restriction Curves. Ensure that the trigger values are appropriate for the variable that you want to use to modify the system.

Create the restriction curve in Figure 1, with the trigger value being a proportion between 0 and 1. This represents the amount of water present in a storage in proportion to the storage's full supply volume.

In the Function Editor create a variable that will be used to trigger entering or leaving a restriction level. That is, it will be compared to the Rising and Falling trigger values in your Restriction Curve.

Storage Volume as a proportion of Full Supply Volume does not exist as a modelled variable, so instead create a function, $StoreProp, in Function Editor, as follows:

  1. Create a modelled variable $vStoreVol equal to the storage's Storage Volume parameter. Set the Date Range to Current Time Step.
  2. Create a modelled variable $vFSV equal to the storage's Full Supply Volume parameter. Set the Date Range to Current Time Step.
  3. Create a function $StoreProp equal to:

    $vStoreVol/$vFSV
  4. Turn Force Evaluation to ON and set Time of Evaluation to Start of TimeStep. Set Result Units to proportion.
  5. Close the Function Editor(this will ensure the function is available to be mapped to by other functions and variables)

In the Function Editor use the inbuilt GetRestrictionLevel custom function to calculate the Restriction Level. This function requires 3 parameters:

  1. The restriction curve index
  2. The previous restriction level
  3. The trigger value used to lookup the restriction level

Note that this function is iterative, the second parameter is the result of GetRestrictionLevel from the previous time step. This requires creating a modelled variable to represent the previous time step.

  1. Create a function called $RestrictionLevel. Leave it empty. Close and reopen the Function Editor.
  2. Create a modelled variable called $vPrevRestrictionLevel, set it equal to the $RestrictionLevel parameter (under Miscellaneous » Functions).
  3. Edit the $RestrictionLevel function entering the following:

     GetRestrictionLevel(0, $vPrevRestrictionLevel, $StoreProp)

    Note: in this formula, 0 is the index of the Restriction Curve (Figure 1).

  4. Turn Force Evaluation to ON and set Time of Evaluation to Start of TimeStep.
In the Function Manager use the inbuilt GetRestrictionValue to calculate the restriction value, which is the return value given the current restriction level (Figure 1). This function requires 3 parameters:
  1. The restriction curve index
  2. The previous restriction level
  3. The trigger value used to lookup the return value.
  1. Create a function called $RestrictionValue. Enter the following:

     GetRestrictionValue(0, $vPrevRestrictionLevel, $StoreProp)

    Note: in this formula, 0 is the index of the Restriction Curve (Figure 1).

  2. Turn Force Evaluation to ON and set Time of Evaluation to Start of TimeStep.
  3. Close the Function Editor.
Finally, in the appropriate node's feature editor, create a function to modify model behaviour based on the restriction value.

The storage is attached to a water user with a time series demand model. We want to restrict demand based on the current restriction value calculated from our restriction curve. To do this:

  1. Open the Water User Feature Editor
  2. Create a new Time Series Demand Model, and select Function Editor
  3. Create time series variables for evaporation, $tsEvap, and rainfall, $tsRain, and link these to appropriate data sources.
  4. Add a new function, $RestrictedDemand and enter the following:

    0.5*(130+30.9*$tsEvap^0.8-0.8*$tsRain^0.7)*$RestrictionValue
  5. Set Time of Evaluation to Start of TimeStep and Result Units to your flow units (eg. megalitres per day).

  6. Click OK to close the Water User Feature Editor.

 

In Figure 2, an example is shown of the restriction level being modified based on the amount of water in storage, shown as the percentage of the storage's full supply volume (ie. $StoreProp as defined in Table 1).

Figure 2. Example model using Restriction Levels