diff --git a/concept/allocation.html b/concept/allocation.html index 802fc22f9..27c624b12 100644 --- a/concept/allocation.html +++ b/concept/allocation.html @@ -574,7 +574,7 @@

4.4 Example

The following is an example of an optimization problem for the example shown here:

-
+
Code
using Ribasim
@@ -597,27 +597,27 @@ 

println(p.allocation.allocation_models[1].problem)

-
Min F[(Basin #5, UserDemand #6)]² + F[(Basin #2, UserDemand #3)]²
+
Min F[(Basin #2, UserDemand #3)]² + F[(Basin #5, UserDemand #6)]²
 Subject to
  flow_conservation[Basin #5] : -F[(Basin #5, TabulatedRatingCurve #7)] + F[(LinearResistance #4, Basin #5)] - F[(Basin #5, LinearResistance #4)] + F[(UserDemand #6, Basin #5)] - F[(Basin #5, UserDemand #6)] = 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[Terminal #8] : F[(TabulatedRatingCurve #7, Terminal #8)] = 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[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[(Basin #5, TabulatedRatingCurve #7)] - F[(TabulatedRatingCurve #7, Terminal #8)] = 0
+ flow_conservation[Basin #2] : F[(UserDemand #3, Basin #2)] - F[(Basin #2, UserDemand #3)] - F[(Basin #2, LinearResistance #4)] + F[(LinearResistance #4, Basin #2)] + F[(FlowBoundary #1, Basin #2)] = 0
  F[(Basin #5, TabulatedRatingCurve #7)] ≥ 0
- F[(Basin #2, LinearResistance #4)] ≥ 0
- F[(LinearResistance #4, Basin #2)] ≥ 0
+ F[(TabulatedRatingCurve #7, Terminal #8)] ≥ 0
+ F[(UserDemand #3, Basin #2)] ≥ 0
  F[(LinearResistance #4, Basin #5)] ≥ 0
  F[(Basin #5, LinearResistance #4)] ≥ 0
- F[(UserDemand #3, Basin #2)] ≥ 0
+ F[(Basin #2, UserDemand #3)] ≥ 0
  F[(UserDemand #6, Basin #5)] ≥ 0
+ F[(Basin #2, LinearResistance #4)] ≥ 0
+ F[(LinearResistance #4, Basin #2)] ≥ 0
  F[(Basin #5, UserDemand #6)] ≥ 0
  F[(FlowBoundary #1, Basin #2)] ≥ 0
- F[(TabulatedRatingCurve #7, Terminal #8)] ≥ 0
- F[(Basin #2, UserDemand #3)] ≥ 0
  source[(FlowBoundary #1, Basin #2)] : F[(FlowBoundary #1, Basin #2)] ≤ 172800
- source_user[UserDemand #6] : F[(UserDemand #6, Basin #5)] ≤ 0
  source_user[UserDemand #3] : F[(UserDemand #3, Basin #2)] ≤ 0
+ source_user[UserDemand #6] : F[(UserDemand #6, Basin #5)] ≤ 0
 
diff --git a/guide/examples_files/figure-html/cell-18-output-1.png b/guide/examples_files/figure-html/cell-18-output-1.png index aee543a67..b2c8c49d7 100644 Binary files a/guide/examples_files/figure-html/cell-18-output-1.png and b/guide/examples_files/figure-html/cell-18-output-1.png differ diff --git a/guide/examples_files/figure-html/cell-19-output-1.png b/guide/examples_files/figure-html/cell-19-output-1.png index 3cf065fcd..d53a64009 100644 Binary files a/guide/examples_files/figure-html/cell-19-output-1.png and b/guide/examples_files/figure-html/cell-19-output-1.png differ 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 4dd26aa63..5a08ff5da 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 248a20b68..42981c7cf 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 9d1c067b8..45b4f4e39 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/guide/quickstart.html b/guide/quickstart.html index a826060c0..574cc2ef1 100644 --- a/guide/quickstart.html +++ b/guide/quickstart.html @@ -337,7 +337,7 @@

Quick start guide

-

+

@@ -405,7 +405,7 @@

3 Modual 1 - Crys
- +
Figure 1: Crystal Basin based on natural flow @@ -483,7 +483,7 @@

- +
Figure 2: Basin node concept for the confluence @@ -575,7 +575,7 @@

- +
Figure 3: Discharge at corresponding water levels @@ -622,7 +622,7 @@

- +
Figure 4: Schematization of the Crystal basin 1.1 @@ -703,7 +703,7 @@

- +
Figure 5: Simulated basin level and storage @@ -714,7 +714,7 @@

- +
Figure 6: Simulated flows on each edge @@ -729,7 +729,7 @@

- +
Figure 7: Crystal basin with irrigation @@ -838,7 +838,7 @@

- +
Figure 8: Schematization of the Crystal basin with irrigation @@ -921,7 +921,7 @@

- +
Figure 9: Simulated basin levels and storages @@ -947,7 +947,7 @@

- +
Figure 10: Simulated flows of each edge @@ -958,7 +958,7 @@

- +
Figure 11: Supplied irrigation and return flow @@ -969,7 +969,7 @@

- +
Figure 12: Simulated flow to Terminal @@ -985,7 +985,7 @@

4 Modual 2 – Re
- +
Figure 13: Crystal basin with demands and a reservoir @@ -1055,7 +1055,7 @@

- +
Figure 14: Simulated basin storages and levels @@ -1133,7 +1133,7 @@

- +
Figure 15: Simulated flows to and from the city @@ -1143,7 +1143,7 @@

- +
Figure 16: Simulated basin storages and levels diff --git a/reference/node/basin.html b/reference/node/basin.html index 44512d47b..504f6a682 100644 --- a/reference/node/basin.html +++ b/reference/node/basin.html @@ -472,7 +472,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
@@ -671,7 +671,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
fig, ax = plt.subplots()
@@ -754,7 +754,7 @@ 

\[ S(h) = \int_{h_0}^h A(h')\text{d}h'. \]

-
+
Code
storage = np.diff(level) * area[:-1] + 0.5 * np.diff(area) * np.diff(level)
@@ -799,7 +799,7 @@ 

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
@@ -914,9 +914,9 @@ 

fig.show()

-