<jupyter_start><jupyter_text>Real-time Control of Stormwater Systems using Network Optimization 1. Introduction    - Problem Description    - Literature Review    - Contribution of the work2. Model3. Algorithm4. Numerical Studies 5. Conclusion<jupyter_code># Python boilerplate 
import numpy as np
import scipy as spy
import matplotlib.pyplot as plt
%matplotlib notebook
%config InlineBackend.print_figure_kwargs = {}
import seaborn as sns
sns.set_style("whitegrid")
# Optimization thingy 
from gurobipy import *<jupyter_output><empty_output><jupyter_text>Introduction   ModelDyanmics of the stormwater systems are nonlinear and these dynamics have to be accounted for achiving finer control of the system. But for achiving certain objective, like minimizing flooding and minimizing CSO's we can just control the network to effectively move the mass of water in the network, which can be achived by sorta linearnizing the system.  Virtual Tank Models Links:Flow of water in the links is highly non-linear. Usually, we have to solve kinematic wave equation to model the flow of water in the links. But for this problem we ignore this, to assume that flow in and flow out are perfect. i.e no losses and more similar to the network links we have been looking in the class.  Nodes:We assume that the Nodes are idealized cylinders. $$ V^t  = V^{t-1} + q_{in}^t - q_{out}^t $$But the amount water that can leave the system is constrained by the water level in the tank. $$ q_{out} \leq \sqrt{2 \times g \times water level} \times C_D $$We linearize this constaraint by approximating the square root operation.<jupyter_code># Generate the outflows 
volume  = np.linspace(0,1000,100)
area    = 100
height  = volume/area
outflow = np.sqrt(2*9.81*height)

# Get the first order polyfit 
coeffws = np.polyfit(height, outflow, 1)
plt.plot(height, outflow, label = "True")
plt.plot(height, coeffws[0]*height + coeffws[1], label = "Linearized")
plt.ylabel("Outflows")
plt.xlabel("Water Level")
plt.legend()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07418397626112759, 'fraction_numerical': 0.012363996043521267, 'mean_word_length': 4.95, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '47972', 'license': 'MIT', 'n_tokens_mistral': 621, 'n_tokens_neox': 582, 'n_words': 256, 'path': 'notebooks/Draft Paper.ipynb', 'repo_name': 'kLabUM/NetworkOptimization', 'size': '2022'}