Skip to content

Commit

Permalink
deploy: a596627
Browse files Browse the repository at this point in the history
  • Loading branch information
SouthEndMusic committed Jun 12, 2024
1 parent 5dcabb2 commit 943bfcd
Show file tree
Hide file tree
Showing 20 changed files with 1,865 additions and 902 deletions.
32 changes: 16 additions & 16 deletions background/allocation.html
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,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="../python/examples.ipynb#model-with-allocation-user-demand">here</a>:</p>
<div id="ac27b236" class="cell" data-execution_count="1">
<div id="e5fcfffd" 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 @@ -626,37 +626,37 @@ <h2 data-number="4.4" class="anchored" data-anchor-id="example"><span class="hea
<div class="cell-output cell-output-stdout">
<pre><code>Min F[(Basin #2, UserDemand #3)]² + F[(Basin #12, UserDemand #13)]² + F[(Basin #5, UserDemand #6)]²
Subject to
flow_conservation[Basin #5] : F[(LinearResistance #4, Basin #5)] - F[(Basin #5, LinearResistance #4)] + F[(UserDemand #6, Basin #5)] - F[(Basin #5, UserDemand #6)] - F[(Basin #5, TabulatedRatingCurve #7)] = 0
flow_conservation[FractionalFlow #8] : F[(TabulatedRatingCurve #7, FractionalFlow #8)] - F[(FractionalFlow #8, Terminal #10)] = 0
flow_conservation[Basin #2] : -F[(Basin #2, UserDemand #3)] - F[(Basin #2, LinearResistance #4)] + F[(LinearResistance #4, Basin #2)] + F[(FlowBoundary #1, Basin #2)] + F[(UserDemand #3, Basin #2)] = 0
flow_conservation[TabulatedRatingCurve #7] : F[(Basin #5, TabulatedRatingCurve #7)] - F[(TabulatedRatingCurve #7, FractionalFlow #8)] - F[(TabulatedRatingCurve #7, FractionalFlow #9)] - F_flow_buffer_in[TabulatedRatingCurve #7] + F_flow_buffer_out[TabulatedRatingCurve #7] = 0
flow_conservation[Terminal #10] : F[(FractionalFlow #8, Terminal #10)] + F[(UserDemand #13, Terminal #10)] = 0
flow_conservation[FractionalFlow #8] : -F[(FractionalFlow #8, Terminal #10)] + F[(TabulatedRatingCurve #7, FractionalFlow #8)] = 0
flow_conservation[Basin #2] : F[(FlowBoundary #1, Basin #2)] - F[(Basin #2, UserDemand #3)] - F[(Basin #2, LinearResistance #4)] + F[(LinearResistance #4, Basin #2)] + F[(UserDemand #3, Basin #2)] = 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[Basin #12] : F[(FractionalFlow #9, Basin #12)] - F[(Basin #12, UserDemand #13)] = 0
flow_conservation[Basin #12] : -F[(Basin #12, UserDemand #13)] + F[(FractionalFlow #9, Basin #12)] = 0
flow_conservation[FractionalFlow #9] : -F[(FractionalFlow #9, Basin #12)] + F[(TabulatedRatingCurve #7, FractionalFlow #9)] = 0
flow_conservation[Terminal #10] : F[(UserDemand #13, Terminal #10)] + F[(FractionalFlow #8, Terminal #10)] = 0
flow_conservation[Basin #5] : F[(LinearResistance #4, Basin #5)] - F[(Basin #5, LinearResistance #4)] - F[(Basin #5, TabulatedRatingCurve #7)] - F[(Basin #5, UserDemand #6)] + F[(UserDemand #6, Basin #5)] = 0
flow_conservation[TabulatedRatingCurve #7] : F[(Basin #5, TabulatedRatingCurve #7)] - F[(TabulatedRatingCurve #7, FractionalFlow #8)] - F[(TabulatedRatingCurve #7, FractionalFlow #9)] - F_flow_buffer_in[TabulatedRatingCurve #7] + F_flow_buffer_out[TabulatedRatingCurve #7] = 0
source[(FlowBoundary #1, Basin #2)] : F[(FlowBoundary #1, Basin #2)] ≤ 172800
source_user[UserDemand #13] : F[(UserDemand #13, Terminal #10)] ≤ 0
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
fractional_flow[(TabulatedRatingCurve #7, FractionalFlow #8)] : -0.6 F[(Basin #5, TabulatedRatingCurve #7)] + F[(TabulatedRatingCurve #7, FractionalFlow #8)] ≤ 0
fractional_flow[(TabulatedRatingCurve #7, FractionalFlow #9)] : -0.4 F[(Basin #5, TabulatedRatingCurve #7)] + F[(TabulatedRatingCurve #7, FractionalFlow #9)] ≤ 0
flow_buffer_outflow[TabulatedRatingCurve #7] : F_flow_buffer_out[TabulatedRatingCurve #7] ≤ 0
F[(FractionalFlow #8, Terminal #10)] ≥ 0
F[(FlowBoundary #1, Basin #2)] ≥ 0
F[(LinearResistance #4, Basin #5)] ≥ 0
F[(Basin #5, LinearResistance #4)] ≥ 0
F[(Basin #2, UserDemand #3)] ≥ 0
F[(UserDemand #6, Basin #5)] ≥ 0
F[(FractionalFlow #9, Basin #12)] ≥ 0
F[(Basin #12, UserDemand #13)] ≥ 0
F[(UserDemand #13, Terminal #10)] ≥ 0
F[(Basin #5, UserDemand #6)] ≥ 0
F[(Basin #5, TabulatedRatingCurve #7)] ≥ 0
F[(Basin #12, UserDemand #13)] ≥ 0
F[(FractionalFlow #9, Basin #12)] ≥ 0
F[(Basin #2, LinearResistance #4)] ≥ 0
F[(LinearResistance #4, Basin #2)] ≥ 0
F[(TabulatedRatingCurve #7, FractionalFlow #8)] ≥ 0
F[(FlowBoundary #1, Basin #2)] ≥ 0
F[(UserDemand #3, Basin #2)] ≥ 0
F[(Basin #5, UserDemand #6)] ≥ 0
F[(TabulatedRatingCurve #7, FractionalFlow #9)] ≥ 0
F[(FractionalFlow #8, Terminal #10)] ≥ 0
F[(UserDemand #6, Basin #5)] ≥ 0
F[(UserDemand #3, Basin #2)] ≥ 0
F[(UserDemand #13, Terminal #10)] ≥ 0
F_flow_buffer_in[TabulatedRatingCurve #7] ≥ 0
F_flow_buffer_out[TabulatedRatingCurve #7] ≥ 0
</code></pre>
Expand Down
2 changes: 1 addition & 1 deletion background/equations.html
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ <h2 data-number="2.1" class="anchored" data-anchor-id="sec-reduction_factor"><sp
\end{cases}
\end{align}\]</span></p>
<p>Here <span class="math inline">\(p &gt; 0\)</span> is the threshold value which determines the interval <span class="math inline">\([0,p]\)</span> of the smooth transition between <span class="math inline">\(0\)</span> and <span class="math inline">\(1\)</span>, see the plot below.</p>
<div id="81f13c82" class="cell" data-execution_count="1">
<div id="d7d49b5b" class="cell" data-execution_count="1">
<details class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> numpy <span class="im">as</span> np</span>
Expand Down
4 changes: 2 additions & 2 deletions background/validation.html
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ <h1 class="title">Validation</h1>
<section id="connectivity" class="level1" data-number="1">
<h1 data-number="1"><span class="header-section-number">1</span> Connectivity</h1>
<p>In the table below, each column shows which node types are allowed to be downstream (or ‘down-control’) of the node type at the top of the column.</p>
<div id="16a92ed1" class="cell" data-execution_count="1">
<div id="65c63786" 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 Down Expand Up @@ -648,7 +648,7 @@ <h1 data-number="1"><span class="header-section-number">1</span> Connectivity</h
<section id="neighbor-amounts" class="level1" data-number="2">
<h1 data-number="2"><span class="header-section-number">2</span> Neighbor amounts</h1>
<p>The table below shows for each node type between which bounds the amount of in- and outneighbors must be, for both flow and control edges.</p>
<div id="96a79a8a" class="cell" data-execution_count="2">
<div id="a26062a8" class="cell" data-execution_count="2">
<details class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>flow_in_min <span class="op">=</span> <span class="fu">Vector</span><span class="dt">{String}</span>()</span>
Expand Down
6 changes: 6 additions & 0 deletions dev/python.html
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,12 @@
<a href="../guides/release.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">Release process</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../guides/bmi.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">Basic Model Interface (BMI)</span></a>
</div>
</li>
</ul>
</li>
Expand Down
6 changes: 6 additions & 0 deletions guides/addnode.html
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@
<a href="../guides/release.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">Release process</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../guides/bmi.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">Basic Model Interface (BMI)</span></a>
</div>
</li>
</ul>
</li>
Expand Down
Loading

0 comments on commit 943bfcd

Please sign in to comment.