Skip to content

Commit

Permalink
Define subnetwork
Browse files Browse the repository at this point in the history
  • Loading branch information
SouthEndMusic committed Apr 16, 2024
1 parent cd011cb commit 8d84add
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions docs/python/examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@
" basin.State(level=[0.5]),\n",
"]\n",
"model.basin.add(\n",
" Node(2, Point(1.0, 0.0)),\n",
" Node(2, Point(1.0, 0.0), subnetwork_id=2),\n",
" [\n",
" *basin_data,\n",
" basin.Time(\n",
Expand All @@ -1462,7 +1462,7 @@
" ],\n",
")\n",
"model.basin.add(\n",
" Node(5, Point(2.0, -1.0)),\n",
" Node(5, Point(2.0, -1.0), subnetwork_id=2),\n",
" [\n",
" *basin_data,\n",
" basin.Static(\n",
Expand All @@ -1473,9 +1473,6 @@
" urban_runoff=[0.0],\n",
" ),\n",
" ],\n",
")\n",
"profile = pd.DataFrame(\n",
" data={\"node_id\": [2, 2, 5, 5], \"area\": 1e3, \"level\": [0.0, 1.0, 0.0, 1.0]}\n",
")"
]
},
Expand All @@ -1493,15 +1490,15 @@
"outputs": [],
"source": [
"model.flow_boundary.add(\n",
" Node(1, Point(0.0, 0.0)), [flow_boundary.Static(flow_rate=[1e-3])]\n",
" Node(1, Point(0.0, 0.0), subnetwork_id=2), [flow_boundary.Static(flow_rate=[1e-3])]\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Setup allocation level control:\n"
"Setup level demand:\n"
]
},
{
Expand All @@ -1511,7 +1508,7 @@
"outputs": [],
"source": [
"model.level_demand.add(\n",
" Node(4, Point(1.0, -1.0)),\n",
" Node(4, Point(1.0, -1.0), subnetwork_id=2),\n",
" [level_demand.Static(priority=[1], min_level=[1.0], max_level=[1.5])],\n",
")"
]
Expand All @@ -1530,7 +1527,7 @@
"outputs": [],
"source": [
"model.user_demand.add(\n",
" Node(3, Point(2.0, 0.0)),\n",
" Node(3, Point(2.0, 0.0), subnetwork_id=2),\n",
" [\n",
" user_demand.Static(\n",
" priority=[2], demand=[1.5e-3], return_factor=[0.2], min_level=[0.2]\n",
Expand Down

0 comments on commit 8d84add

Please sign in to comment.