Skip to content

Commit

Permalink
deploy: 61f777d
Browse files Browse the repository at this point in the history
  • Loading branch information
visr committed Aug 22, 2024
1 parent 58c0bb9 commit fe813e4
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 68 deletions.
28 changes: 14 additions & 14 deletions concept/allocation.html
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ <h2 id="toc-title">On this page</h2>

<ul>
<li><a href="#introduction" id="toc-introduction" class="nav-link active" data-scroll-target="#introduction"><span class="header-section-number">1</span> Introduction</a></li>
<li><a href="#the-high-level-algorithm" id="toc-the-high-level-algorithm" class="nav-link" data-scroll-target="#the-high-level-algorithm"><span class="header-section-number">2</span> The high level algorithm</a></li>
<li><a href="#sec-high-level-algorithm" id="toc-sec-high-level-algorithm" class="nav-link" data-scroll-target="#sec-high-level-algorithm"><span class="header-section-number">2</span> The high level algorithm</a></li>
<li><a href="#elements-of-allocation" id="toc-elements-of-allocation" class="nav-link" data-scroll-target="#elements-of-allocation"><span class="header-section-number">3</span> Elements of allocation</a>
<ul class="collapse">
<li><a href="#schematisation-input" id="toc-schematisation-input" class="nav-link" data-scroll-target="#schematisation-input"><span class="header-section-number">3.1</span> Schematisation input</a>
Expand Down Expand Up @@ -355,7 +355,7 @@ <h1 data-number="1"><span class="header-section-number">1</span> Introduction</h
</div>
</div>
</section>
<section id="the-high-level-algorithm" class="level1" data-number="2">
<section id="sec-high-level-algorithm" class="level1" data-number="2">
<h1 data-number="2"><span class="header-section-number">2</span> The high level algorithm</h1>
<p>The allocation algorithm contains 3 types of optimization:</p>
<ul>
Expand Down Expand Up @@ -584,7 +584,7 @@ <h2 data-number="4.3" class="anchored" data-anchor-id="the-optimization-constrai
<section id="example" class="level2" data-number="4.4">
<h2 data-number="4.4" class="anchored" data-anchor-id="example"><span class="header-section-number">4.4</span> Example</h2>
<p>The following is an example of an optimization problem for the example shown <a href="../guide/examples.html#model-with-allocation-user-demand">here</a>:</p>
<div id="6a791467" class="cell" data-execution_count="1">
<div id="7006a8bc" class="cell" data-execution_count="1">
<details class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">using</span> <span class="bu">Ribasim</span></span>
Expand All @@ -607,27 +607,27 @@ <h2 data-number="4.4" class="anchored" data-anchor-id="example"><span class="hea
<span id="cb1-18"><a href="#cb1-18" aria-hidden="true" tabindex="-1"></a><span class="fu">println</span>(p.allocation.allocation_models[<span class="fl">1</span>].problem)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>Min F[(Basin #5, UserDemand #6)]² + F[(Basin #2, UserDemand #3)]²
<pre><code>Min F[(Basin #2, UserDemand #3)]² + F[(Basin #5, UserDemand #6)]²
Subject to
F[(UserDemand #3, Basin #2)] ≥ 0
F[(UserDemand #6, Basin #5)] ≥ 0
F[(TabulatedRatingCurve #7, Terminal #8)] ≥ 0
F[(Basin #5, TabulatedRatingCurve #7)] ≥ 0
F[(Basin #2, UserDemand #3)] ≥ 0
F[(UserDemand #3, Basin #2)] ≥ 0
F[(Basin #2, LinearResistance #4)] ≥ 0
F[(LinearResistance #4, Basin #2)] ≥ 0
F[(LinearResistance #4, Basin #5)] ≥ 0
F[(Basin #5, LinearResistance #4)] ≥ 0
F[(Basin #5, UserDemand #6)] ≥ 0
F[(FlowBoundary #1, Basin #2)] ≥ 0
F[(Basin #5, TabulatedRatingCurve #7)] ≥ 0
F[(Basin #2, UserDemand #3)] ≥ 0
flow_conservation[Terminal #8] : F[(TabulatedRatingCurve #7, Terminal #8)] = 0
flow_conservation[Basin #2] : F[(UserDemand #3, Basin #2)] - F[(Basin #2, LinearResistance #4)] + F[(LinearResistance #4, 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, UserDemand #6)] - F[(Basin #5, TabulatedRatingCurve #7)] = 0
F[(UserDemand #6, Basin #5)] ≥ 0
F[(LinearResistance #4, Basin #5)] ≥ 0
F[(Basin #5, LinearResistance #4)] ≥ 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[Terminal #8] : F[(TabulatedRatingCurve #7, Terminal #8)] = 0
flow_conservation[Basin #5] : -F[(Basin #5, TabulatedRatingCurve #7)] - F[(Basin #5, UserDemand #6)] + F[(UserDemand #6, Basin #5)] + F[(LinearResistance #4, Basin #5)] - F[(Basin #5, LinearResistance #4)] = 0
flow_conservation[TabulatedRatingCurve #7] : -F[(TabulatedRatingCurve #7, Terminal #8)] + F[(Basin #5, TabulatedRatingCurve #7)] = 0
flow_conservation[Basin #2] : -F[(Basin #2, UserDemand #3)] + F[(UserDemand #3, Basin #2)] - F[(Basin #2, LinearResistance #4)] + F[(LinearResistance #4, Basin #2)] + F[(FlowBoundary #1, Basin #2)] = 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
source_user[UserDemand #3] : F[(UserDemand #3, Basin #2)] ≤ 0
</code></pre>
</div>
</div>
Expand Down
31 changes: 28 additions & 3 deletions concept/concept.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,27 @@
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
vertical-align: middle;
}
</style>
/* CSS for citations */
div.csl-bib-body { }
div.csl-entry {
clear: both;
margin-bottom: 0em;
}
.hanging-indent div.csl-entry {
margin-left:2em;
text-indent:-2em;
}
div.csl-left-margin {
min-width:2em;
float:left;
}
div.csl-right-inline {
margin-left:2em;
padding-left:1em;
}
div.csl-indent {
margin-left: 2em;
}</style>


<script src="../site_libs/quarto-nav/quarto-nav.js"></script>
Expand Down Expand Up @@ -267,7 +287,7 @@ <h1 data-number="1"><span class="header-section-number">1</span> Introduction</h
<h1 data-number="2"><span class="header-section-number">2</span> Concept</h1>
<section id="sec-physical" class="level2" data-number="2.1">
<h2 data-number="2.1" class="anchored" data-anchor-id="sec-physical"><span class="header-section-number">2.1</span> Physical layer</h2>
<p>To represent the physical characteristics of the water system in an area, Ribasim allows you to divide the area into a network of connected representative elementary watersheds (<a href="https://deltares.github.io/Ribasim/#ref-REGGIANI1998367">Reggiani, Sivapalan, and Majid Hassanizadeh 1998</a>). Within Ribasim, these elements are called basins, which are essentially buckets or reservoirs holding an aggregated volume of water bodies in an area. Basins are chained in a graph with connector nodes determining the exchange of water between the basins. These connector nodes can represent open water connections (e.g.&nbsp;bifurcations or resistance in a free flowing open water channel) or infrastructure elements such as pumps, gates or weirs. An overview of node types and associated data inputs is provided on the <a href="../reference/usage.html">usage page</a>, while the associated mathematical formations are described on the <a href="../concept/equations.html">equations page</a>.</p>
<p>To represent the physical characteristics of the water system in an area, Ribasim allows you to divide the area into a network of connected representative elementary watersheds <span class="citation" data-cites="REGGIANI1998367">(<a href="#ref-REGGIANI1998367" role="doc-biblioref">Reggiani, Sivapalan, and Majid Hassanizadeh 1998</a>)</span>. Within Ribasim, these elements are called basins, which are essentially buckets or reservoirs holding an aggregated volume of water bodies in an area. Basins are chained in a graph with connector nodes determining the exchange of water between the basins. These connector nodes can represent open water connections (e.g.&nbsp;bifurcations or resistance in a free flowing open water channel) or infrastructure elements such as pumps, gates or weirs. An overview of node types and associated data inputs is provided on the <a href="../reference/usage.html">usage page</a>, while the associated mathematical formations are described on the <a href="../concept/equations.html">equations page</a>.</p>
</section>
<section id="sec-control" class="level2" data-number="2.2">
<h2 data-number="2.2" class="anchored" data-anchor-id="sec-control"><span class="header-section-number">2.2</span> Control layer</h2>
Expand Down Expand Up @@ -323,10 +343,15 @@ <h2 data-number="2.3" class="anchored" data-anchor-id="sec-allocation"><span cla
</div>



</section>
</section>

</main> <!-- /main -->
<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" role="doc-bibliography" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0" role="list">
<div id="ref-REGGIANI1998367" class="csl-entry" role="listitem">
Reggiani, Paolo, Murugesu Sivapalan, and S. Majid Hassanizadeh. 1998. <span>“A Unifying Framework for Watershed Thermodynamics: Balance Equations for Mass, Momentum, Energy and Entropy, and the Second Law of Thermodynamics.”</span> <em>Advances in Water Resources</em> 22 (4): 367–98. https://doi.org/<a href="https://doi.org/10.1016/S0309-1708(98)00012-8">https://doi.org/10.1016/S0309-1708(98)00012-8</a>.
</div>
</div></section></div></main> <!-- /main -->
<script id="quarto-html-after-body" type="application/javascript">
window.document.addEventListener("DOMContentLoaded", function (event) {
const toggleBodyColorMode = (bsSheetEl) => {
Expand Down
Loading

0 comments on commit fe813e4

Please sign in to comment.