Exercise 1a Two nodes
Create a new model
Ceate a new network called Exercise 1a using the following template:
Pywr child template v1 (March 2021) - flow units in Mm3/day
Follow the instrucions here for a reminder on how to set up the model:
Set Up Time Horizon
This step is mandatory for all networks as it defines the simulation's start, end, and timestep. For this example, we will configure a 1-year simulation horizon with a daily timestep.
Adding Nodes
Navigate to the left panel and click on Build to open the Nodes list.
Drag and drop to the workspace Map:
Note: To learn more about different node types, refer to the documentation here.
Adding Edges
To create a connection between nodes, first click on the input node and then click on the output node. Edges are directional, and the direction is set from the first to the second node.
Add flow input node and Run the network
Double-click on the input node. This will open the node panel on the right side of the screen.
Node Panel Sections:
Details: Here, you can change the name and description of the node.
Inputs: This section contains the basic attributes that need to be configured for each node. These attributes are user-defined.
Outputs: This section displays the results after the simulation.
Select the input node and change max_flow to 10.
A new window will pop-up, click on Submit
Wait until the Runs panel shows a green indicator for successful execution.
The following plots are the results generated by the network
Explanation
The input node acts as a water supply source, providing a maximum of 10Mm³/day, according to the demand required, as the output node doesn’t have an allocation penalty associated, then no water supply is required.
Add priority to the output node and Run The network
Select the output node and change allocation penalty to -10. A negative value sets up a higher priority for the node. For more information on allocation penalties, refer to the Allocation Penalty documentation
Run the model and visualize the results as described on the previous step
Explanation
The input node acts as a water supply source, providing a maximum of 10Mm³/day.
The allocation penalty in the output node is set to a negative value (-10), prioritizing the allocation of water to this node, with no constraint on maximum flow, the output node can consume as much water as the network can supply to it.
Add required flow to the output node and Run The network
Select the output node and change max_flow to 6Mm³/day, it tells the network which is the required consumption for this output node.
On the left panel click on Run a Model . Run the model and visualize the results as described previously
Explanation
The input node acts as a water supply source, providing a maximum of 10Mm³/day.
The allocation penalty prioritizes the allocation of water to the output node, a constrain to maximum 6Mm³/day withdrawal has been added, now the output only gets the constrained 6Mm³/day a maximum supply of the requested demand.
Last updated