{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "*This notebook contains material from [Controlling Natural Watersheds](https://jckantor.github.io/Controlling-Natural-Watersheds);\n", "content is available [on Github](https://github.com/jckantor/Controlling-Natural-Watersheds.git).*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "< [Analysis and Design of Rule Curves](http://nbviewer.jupyter.org/github/jckantor/Controlling-Natural-Watersheds/blob/master/notebooks/03.00-Analysis_and_Design_of_Rule_Curves.ipynb) | [Contents](toc.ipynb) | [Imputing the Effect of the 2000 Rule Curve Changes on Rainy River](http://nbviewer.jupyter.org/github/jckantor/Controlling-Natural-Watersheds/blob/master/notebooks/03.02-Imputing_the_Effect_of_the_2000_Rule_Curve_Changes_on_Rainy_River.ipynb) >
"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"# Feasibility of Rainy Lake Rule Curves"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"Under what conditions is it possible to maintain lake levels at the target levels?\n",
"\n",
"The IJC Supplementary Order of 2000 set the target level for Rainy Lake at the middle of the upper and lower rule curves. Calling the target lake level $H_{target}$, it must satisfy the mass balance\n",
"\n",
"$$A \\frac{dH_{target}}{dt} = Q_{in} - Q_{out}$$\n",
"\n",
"The combined stage-discharge charateristics of upper Rainy River and the International Falls Dam establishes an upper bound on $Q_{out}$ such that\n",
"\n",
"$$Q_{out} \\leq Q^{\\max}_{out}(H)$$\n",
"\n",
"To maintain the lake level at $H_{target}$, then\n",
"\n",
"$$Q_{in} \\leq \\underbrace{\\frac{dH_{target}}{dt} + Q^{\\max}_{out}(H_{target})}_{Q^{\\max}_{in}}$$\n",
"\n",
"The purpose of this notebook is to estimate ${Q^{\\max}_{in}}$, then test whether historical inflows to Rainy Lake are typically within that limit."
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"## Initialization"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
"# Display graphics inline with the notebook\n",
"%matplotlib inline\n",
"\n",
"# Standard Python modules\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import matplotlib.dates as mdates\n",
"import pandas as pd\n",
"import os\n",
"import datetime\n",
"import pickle\n",
"\n",
"# Module to enhance matplotlib plotting\n",
"import seaborn\n",
"seaborn.set()\n",
"\n",
"# Modules to display images and data tables\n",
"from IPython.display import Image\n",
"from IPython.core.display import display\n",
"\n",
"# Data Directory\n",
"dir = '../data/'"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"### Load Needed Rainy Lake Data"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'pd' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m "
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
\n",
" \n",
"
\n",
"\n",
" \n",
" \n",
" \n",
" \n",
" Level \n",
" Inflow \n",
" \n",
" \n",
" 1948-01-01 \n",
" 337.728 \n",
" 222.246187 \n",
" \n",
" \n",
" 1948-01-02 \n",
" 337.728 \n",
" 286.000000 \n",
" \n",
" \n",
" 1948-01-03 \n",
" 337.724 \n",
" 258.753813 \n",
" \n",
" \n",
" 1948-01-04 \n",
" 337.718 \n",
" 238.162224 \n",
" \n",
" \n",
" \n",
"1948-01-05 \n",
" 337.715 \n",
" 280.095289 \n",
"