Code
using Ribasim
@@ -602,22 +602,22 @@
Min F[(Basin #5, UserDemand #6)]² + F[(Basin #2, UserDemand #3)]²
Subject to
- F[(Basin #2, LinearResistance #4)] ≥ 0
- F[(LinearResistance #4, Basin #2)] ≥ 0
- F[(FlowBoundary #1, Basin #2)] ≥ 0
F[(UserDemand #6, Basin #5)] ≥ 0
F[(LinearResistance #4, Basin #5)] ≥ 0
F[(Basin #5, LinearResistance #4)] ≥ 0
F[(TabulatedRatingCurve #7, Terminal #8)] ≥ 0
- F[(Basin #5, UserDemand #6)] ≥ 0
+ F[(Basin #2, LinearResistance #4)] ≥ 0
+ F[(LinearResistance #4, Basin #2)] ≥ 0
+ F[(UserDemand #3, Basin #2)] ≥ 0
+ F[(FlowBoundary #1, Basin #2)] ≥ 0
F[(Basin #5, TabulatedRatingCurve #7)] ≥ 0
+ F[(Basin #5, UserDemand #6)] ≥ 0
F[(Basin #2, UserDemand #3)] ≥ 0
- F[(UserDemand #3, Basin #2)] ≥ 0
- flow_conservation[Basin #2] : -F[(Basin #2, LinearResistance #4)] + F[(LinearResistance #4, Basin #2)] + F[(FlowBoundary #1, Basin #2)] - F[(Basin #2, UserDemand #3)] + F[(UserDemand #3, Basin #2)] = 0
- flow_conservation[Terminal #8] : F[(TabulatedRatingCurve #7, Terminal #8)] = 0
- flow_conservation[Basin #5] : F[(UserDemand #6, Basin #5)] + F[(LinearResistance #4, Basin #5)] - F[(Basin #5, LinearResistance #4)] - F[(Basin #5, UserDemand #6)] - F[(Basin #5, TabulatedRatingCurve #7)] = 0
+ flow_conservation[LinearResistance #4] : -F[(LinearResistance #4, Basin #5)] + F[(Basin #5, LinearResistance #4)] + F[(Basin #2, LinearResistance #4)] - F[(LinearResistance #4, Basin #2)] = 0
flow_conservation[TabulatedRatingCurve #7] : -F[(TabulatedRatingCurve #7, Terminal #8)] + F[(Basin #5, TabulatedRatingCurve #7)] = 0
- flow_conservation[LinearResistance #4] : F[(Basin #2, LinearResistance #4)] - F[(LinearResistance #4, Basin #2)] - F[(LinearResistance #4, Basin #5)] + F[(Basin #5, LinearResistance #4)] = 0
+ flow_conservation[Basin #2] : -F[(Basin #2, LinearResistance #4)] + F[(LinearResistance #4, Basin #2)] + F[(UserDemand #3, Basin #2)] + F[(FlowBoundary #1, Basin #2)] - F[(Basin #2, UserDemand #3)] = 0
+ flow_conservation[Basin #5] : F[(UserDemand #6, Basin #5)] + F[(LinearResistance #4, Basin #5)] - F[(Basin #5, LinearResistance #4)] - F[(Basin #5, TabulatedRatingCurve #7)] - F[(Basin #5, UserDemand #6)] = 0
+ flow_conservation[Terminal #8] : F[(TabulatedRatingCurve #7, Terminal #8)] = 0
source[(FlowBoundary #1, Basin #2)] : F[(FlowBoundary #1, Basin #2)] ≤ 172800
source_user[UserDemand #3] : F[(UserDemand #3, Basin #2)] ≤ 0
source_user[UserDemand #6] : F[(UserDemand #6, Basin #5)] ≤ 0
diff --git a/guide/delwaq.html b/guide/delwaq.html
index 7be3d4c01..f2fdcac57 100644
--- a/guide/delwaq.html
+++ b/guide/delwaq.html
@@ -897,28 +897,28 @@ 2020-01-01 00:00:00
1
0.0
-FlowBoundary
+LevelBoundary
2928
2020-01-01 00:00:00
1
0.0
-UserDemand
+Precipitation
4392
2020-01-01 00:00:00
1
0.0
-Terminal
+Bar
5856
2020-01-01 00:00:00
1
0.0
-Drainage
+Cl
...
@@ -931,36 +931,36 @@ 11711
2020-12-31 00:00:00
9
-0.330137
-Precipitation
+0.000108
+Initial
13175
2020-12-31 00:00:00
9
-0.970239
-Tracer
+0.0
+UserDemand
14639
2020-12-31 00:00:00
9
-1.008239
-Cl
+0.640103
+FlowBoundary
16103
2020-12-31 00:00:00
9
-0.000108
-Initial
+0.0
+Drainage
17567
2020-12-31 00:00:00
9
-0.029654
-LevelBoundary
+0.970239
+Tracer
@@ -969,7 +969,7 @@
-
{'Foo', 'FlowBoundary', 'UserDemand', 'Terminal', 'Drainage', 'Bar', 'Continuity', 'Precipitation', 'Tracer', 'Cl', 'Initial', 'LevelBoundary'}
+{'Foo', 'LevelBoundary', 'Precipitation', 'Bar', 'Cl', 'Continuity', 'Terminal', 'Initial', 'UserDemand', 'FlowBoundary', 'Drainage', 'Tracer'}
@@ -1004,78 +1004,78 @@ 1472
1472
2020-01-03 00:00:00
1
-0.744403
-FlowBoundary
+0.034251
+LevelBoundary
2936
2020-01-03 00:00:00
1
-0.0
-UserDemand
+0.177087
+Precipitation
4400
2020-01-03 00:00:00
1
0.0
-Terminal
+Bar
5864
2020-01-03 00:00:00
1
-0.0
-Drainage
+1.164538
+Cl
7328
2020-01-03 00:00:00
1
-0.0
-Bar
+1.0
+Continuity
8792
2020-01-03 00:00:00
1
-1.0
-Continuity
+0.0
+Terminal
10256
2020-01-03 00:00:00
1
-0.177087
-Precipitation
+0.044259
+Initial
11720
2020-01-03 00:00:00
1
-0.92149
-Tracer
+0.0
+UserDemand
13184
2020-01-03 00:00:00
1
-1.164538
-Cl
+0.744403
+FlowBoundary
14648
2020-01-03 00:00:00
1
-0.044259
-Initial
+0.0
+Drainage
16112
2020-01-03 00:00:00
1
-0.034251
-LevelBoundary
+0.92149
+Tracer
9
@@ -1088,78 +1088,78 @@ 1473
2020-01-03 00:00:00
3
-0.0
-FlowBoundary
+0.851086
+LevelBoundary
2937
2020-01-03 00:00:00
3
-0.0
-UserDemand
+0.119639
+Precipitation
4401
2020-01-03 00:00:00
3
0.0
-Terminal
+Bar
5865
2020-01-03 00:00:00
3
-0.0
-Drainage
+28.936922
+Cl
7329
2020-01-03 00:00:00
3
-0.0
-Bar
+1.0
+Continuity
8793
2020-01-03 00:00:00
3
-1.0
-Continuity
+0.0
+Terminal
10257
2020-01-03 00:00:00
3
-0.119639
-Precipitation
+0.029275
+Initial
11721
2020-01-03 00:00:00
3
-0.119639
-Tracer
+0.0
+UserDemand
13185
2020-01-03 00:00:00
3
-28.936922
-Cl
+0.0
+FlowBoundary
14649
2020-01-03 00:00:00
3
-0.029275
-Initial
+0.0
+Drainage
16113
2020-01-03 00:00:00
3
-0.851086
-LevelBoundary
+0.119639
+Tracer
10
@@ -1172,78 +1172,78 @@ 1474
2020-01-03 00:00:00
6
-0.748699
-FlowBoundary
+0.03994
+LevelBoundary
2938
2020-01-03 00:00:00
6
-0.0
-UserDemand
+0.178862
+Precipitation
4402
2020-01-03 00:00:00
6
-0.0
-Terminal
+0.748699
+Bar
5866
2020-01-03 00:00:00
6
-0.0
-Drainage
+1.357952
+Cl
7330
2020-01-03 00:00:00
6
-0.748699
-Bar
+1.0
+Continuity
8794
2020-01-03 00:00:00
6
-1.0
-Continuity
+0.0
+Terminal
10258
2020-01-03 00:00:00
6
-0.178862
-Precipitation
+0.032499
+Initial
11722
2020-01-03 00:00:00
6
-0.927561
-Tracer
+0.0
+UserDemand
13186
2020-01-03 00:00:00
6
-1.357952
-Cl
+0.748699
+FlowBoundary
14650
2020-01-03 00:00:00
6
-0.032499
-Initial
+0.0
+Drainage
16114
2020-01-03 00:00:00
6
-0.03994
-LevelBoundary
+0.927561
+Tracer
11
@@ -1256,78 +1256,78 @@ 1475
2020-01-03 00:00:00
9
-0.04955
-FlowBoundary
+0.913229
+LevelBoundary
2939
2020-01-03 00:00:00
9
-0.0
-UserDemand
+0.029421
+Precipitation
4403
2020-01-03 00:00:00
9
-0.0
-Terminal
+0.04955
+Bar
5867
2020-01-03 00:00:00
9
-0.0
-Drainage
+31.049776
+Cl
7331
2020-01-03 00:00:00
9
-0.04955
-Bar
+1.0
+Continuity
8795
2020-01-03 00:00:00
9
-1.0
-Continuity
+0.0
+Terminal
10259
2020-01-03 00:00:00
9
-0.029421
-Precipitation
+0.0078
+Initial
11723
2020-01-03 00:00:00
9
-0.078971
-Tracer
+0.0
+UserDemand
13187
2020-01-03 00:00:00
9
-31.049776
-Cl
+0.04955
+FlowBoundary
14651
2020-01-03 00:00:00
9
-0.0078
-Initial
+0.0
+Drainage
16115
2020-01-03 00:00:00
9
-0.913229
-LevelBoundary
+0.078971
+Tracer
diff --git a/guide/examples_files/figure-html/cell-56-output-1.png b/guide/examples_files/figure-html/cell-56-output-1.png
index d0914e2c1..2d446817a 100644
Binary files a/guide/examples_files/figure-html/cell-56-output-1.png and b/guide/examples_files/figure-html/cell-56-output-1.png differ
diff --git a/guide/examples_files/figure-html/cell-57-output-2.png b/guide/examples_files/figure-html/cell-57-output-2.png
index 92d84df31..961c6e295 100644
Binary files a/guide/examples_files/figure-html/cell-57-output-2.png and b/guide/examples_files/figure-html/cell-57-output-2.png differ
diff --git a/guide/examples_files/figure-html/cell-68-output-1.png b/guide/examples_files/figure-html/cell-68-output-1.png
index 9e9d98365..cca5f6384 100644
Binary files a/guide/examples_files/figure-html/cell-68-output-1.png and b/guide/examples_files/figure-html/cell-68-output-1.png differ
diff --git a/reference/node/basin.html b/reference/node/basin.html
index 0835c3ac1..849cba656 100644
--- a/reference/node/basin.html
+++ b/reference/node/basin.html
@@ -476,7 +476,7 @@
1.2.1 Interpolation
At the given timestamps the values are set in the simulation, such that the timeseries can be seen as forward filled.
-
+
Code
import numpy as np
@@ -675,7 +675,7 @@
1.4.1.1 Level to area
The level to area relationship is defined with the Basin / profile
data using linear interpolation. An example of such a relationship is shown below.
-
+
Code
= plt.subplots()
@@ -758,7 +758,7 @@ fig, ax \[
S(h) = \int_{h_0}^h A(h')\text{d}h'.
\]
-
+
Code
= np.diff(level) * area[:-1] + 0.5 * np.diff(area) * np.diff(level)
@@ -803,7 +803,7 @@ storage
1.4.1.3 Interactive basin example
The profile data is not detailed enough to create a full 3D picture of the basin. However, if we assume the profile data is for a stretch of canal of given length, the following plot shows a cross section of the basin.
-
+
Code
import plotly.graph_objects as go
@@ -918,9 +918,9 @@
fig.show()
-
1473
2020-01-03 00:00:00
3
-0.0
-FlowBoundary
+0.851086
+LevelBoundary
1474
2020-01-03 00:00:00
6
-0.748699
-FlowBoundary
+0.03994
+LevelBoundary
1475
2020-01-03 00:00:00
9
-0.04955
-FlowBoundary
+0.913229
+LevelBoundary
1.2.1 Interpolation
At the given timestamps the values are set in the simulation, such that the timeseries can be seen as forward filled.
-
+
Code
import numpy as np
@@ -675,7 +675,7 @@
1.4.1.1 Level to area
The level to area relationship is defined with the Basin / profile
data using linear interpolation. An example of such a relationship is shown below.
-
+
Code
= plt.subplots()
@@ -758,7 +758,7 @@ fig, ax \[
S(h) = \int_{h_0}^h A(h')\text{d}h'.
\]
-
+
Code
= np.diff(level) * area[:-1] + 0.5 * np.diff(area) * np.diff(level)
@@ -803,7 +803,7 @@ storage
1.4.1.3 Interactive basin example
The profile data is not detailed enough to create a full 3D picture of the basin. However, if we assume the profile data is for a stretch of canal of given length, the following plot shows a cross section of the basin.
-
+
Code
import plotly.graph_objects as go
@@ -918,9 +918,9 @@
fig.show()
-