{ "cells": [ { "cell_type": "markdown", "metadata": { "nbpages": { "level": 0, "link": "[](https://jckantor.github.io/CBE30338/03.07-Interacting-Tanks.html)", "section": "" } }, "source": [ "\n", "*This notebook contains material from [CBE30338](https://jckantor.github.io/CBE30338);\n", "content is available [on Github](https://github.com/jckantor/CBE30338.git).*\n" ] }, { "cell_type": "markdown", "metadata": { "nbpages": { "level": 0, "link": "[](https://jckantor.github.io/CBE30338/03.07-Interacting-Tanks.html)", "section": "" } }, "source": [ "\n", "< [3.6 Second Order Models](https://jckantor.github.io/CBE30338/03.06-Second-Order-Models.html) | [Contents](toc.html) | [Tag Index](tag_index.html) | [3.8 Manometer Models and Dynamics](https://jckantor.github.io/CBE30338/03.08-Manometer-Models-and-Dynamics.html) >
"
]
},
{
"cell_type": "markdown",
"metadata": {
"nbpages": {
"level": 1,
"link": "[3.7 Interacting Tanks](https://jckantor.github.io/CBE30338/03.07-Interacting-Tanks.html#3.7-Interacting-Tanks)",
"section": "3.7 Interacting Tanks"
}
},
"source": [
"# 3.7 Interacting Tanks"
]
},
{
"cell_type": "markdown",
"metadata": {
"nbpages": {
"level": 2,
"link": "[3.7.1 Problem Statement](https://jckantor.github.io/CBE30338/03.07-Interacting-Tanks.html#3.7.1-Problem-Statement)",
"section": "3.7.1 Problem Statement"
}
},
"source": [
"## 3.7.1 Problem Statement\n",
"\n",
"The following diagram shows a pair of interacting tanks.\n",
"\n",
"\n",
"\n",
"Assume the pressure driven flow into and out of the tanks is linearly proportional to tank levels. The steady state flowrate through the tanks is 3 cubic ft per minute, the steady state heights are 7 and 3 feet, respectively, and a constant cross-sectional area 5 sq. ft. The equations are written as\n",
"\n",
"$$\\begin{align*}\n",
"\\frac{dh_1}{dt} & = \\frac{F_0}{A_1} - \\frac{\\beta_1}{A_1}\\left(h_1-h_2\\right) \\\\\n",
"\\frac{dh_2}{dt} & = \\frac{\\beta_1}{A_2}\\left(h_1-h_2\\right) - \\frac{\\beta_2}{A_2}h_2\n",
"\\end{align*}$$\n",
"\n",
"**a.** Use the problem data to determine values for all constants in the model equations.\n",
"\n",
"**b.** Construct a Phython simulation using `odeint`, and show a plot of the tank levels as function of time starting with an initial condition $h_1(0)=6$ and $h_2(0)$ = 5. Is this an overdamped or underdamped system."
]
},
{
"cell_type": "markdown",
"metadata": {
"nbpages": {
"level": 2,
"link": "[3.7.2 Solution](https://jckantor.github.io/CBE30338/03.07-Interacting-Tanks.html#3.7.2-Solution)",
"section": "3.7.2 Solution"
}
},
"source": [
"## 3.7.2 Solution"
]
},
{
"cell_type": "markdown",
"metadata": {
"nbpages": {
"level": 3,
"link": "[3.7.2.1 Part a. ](https://jckantor.github.io/CBE30338/03.07-Interacting-Tanks.html#3.7.2.1-Part-a.)",
"section": "3.7.2.1 Part a. "
}
},
"source": [
"### 3.7.2.1 Part a. \n",
"\n",
"The parameters that need to be determined are $\\beta_1$ and $\\beta_2$. At steady state all of the flows must be identical and\n",
"\n",
"$$\\begin{align*}\n",
"0 & = F_0 - \\beta_1(h_1 - h_2) \\\\\n",
"0 & = \\beta_1(h_1 - h_2) - \\beta_2h_2 \n",
"\\end{align*}$$\n",
"\n",
"Substituting problem data,\n",
"\n",
"$$\\beta_1 = \\frac{F_0}{h_1-h_2} = \\frac{3\\text{ cu.ft./min}}{4\\text{ ft}} = 0.75\\text{ sq.ft./min}$$ \n",
"\n",
"$$\\beta_2 = \\frac{\\beta_1(h_1 - h_2)}{h_2} = \\frac{3\\text{ cu.ft./min}}{3\\text{ ft}} = 1.0\\text{ sq.ft./min}$$ "
]
},
{
"cell_type": "markdown",
"metadata": {
"nbpages": {
"level": 3,
"link": "[3.7.2.2 Part b.](https://jckantor.github.io/CBE30338/03.07-Interacting-Tanks.html#3.7.2.2-Part-b.)",
"section": "3.7.2.2 Part b."
}
},
"source": [
"### 3.7.2.2 Part b.\n",
"\n",
"The next step is perform a simulation from a specified initial condition. "
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"nbpages": {
"level": 3,
"link": "[3.7.2.2 Part b.](https://jckantor.github.io/CBE30338/03.07-Interacting-Tanks.html#3.7.2.2-Part-b.)",
"section": "3.7.2.2 Part b."
}
},
"outputs": [
{
"data": {
"text/plain": [
"
"
]
}
],
"metadata": {
"anaconda-cloud": {},
"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.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}