Skip to content

Commit

Permalink
update EX11
Browse files Browse the repository at this point in the history
  • Loading branch information
OlafKolditz committed Jul 15, 2021
1 parent 33d923b commit 66cb284
Showing 1 changed file with 45 additions and 19 deletions.
64 changes: 45 additions & 19 deletions BHYWI-08-11/EX11-jupyter-notebook-c++2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,47 @@
"***Exercise EX10 - Open channel flow*** <br/>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This figure is summarizing and illustrating the concept of the lecture \"Hydroinformatics II\"\n",
"<img src=\"lecture_concept.png\" alt=\"drawing\" width=\"500\"/>\n",
"The final exercise \"EX11\" is dealing with open channel flow. A sketch for model set-up is shown in the below figure (Paine 1991)\n",
"<img src=\"paine1.png\" alt=\"drawing\" width=\"250\"/>\n",
"The theoretical basis is founded by the energy balance law (Bernoulli equation):\n",
"\\begin{eqnarray}\n",
"f(h)\n",
"=\n",
"\\left( h + \\frac{Q^2}{2gA^2} \\right)\\mid_D\n",
"-\n",
"\\left( h + \\frac{Q^2}{2gA^2} \\right)\\mid_U\n",
"+\n",
"\\Delta x \\frac{(S_{f,U} + S_{f,D})}{2}\n",
"\\nonumber\\\\\n",
"\\label{eqn:paine7}\n",
"\\end{eqnarray}\n",
"Based on the energy conversation, a Newton scheme is constructed for solving the non-linear open channel flow equation:\n",
"\\begin{eqnarray}\n",
"h_{k+1}\n",
"=\n",
"h_k\n",
"+\n",
"\\frac{f(h_k)}{f'(h_k)}\n",
"=\n",
"h_k\n",
"+\n",
"\\frac{\\mathbf R_k}{\\mathbf J_k}\n",
"\\label{eqn:newton}\n",
"\\end{eqnarray}\n",
"We use a Jupyter notebook, which is using two kernels Python3 und C++."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hello Jupyter!\n",
"This is Hydroinformatics II 2021: EX10 (open channel flow) on Jupter\n"
]
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#include <iostream>\n",
"using namespace std;\n",
Expand All @@ -54,10 +79,11 @@
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.1"
"ename": "SyntaxError",
"evalue": "invalid syntax (<ipython-input-2-af3b3f6effbc>, line 4)",
"output_type": "error",
"traceback": [
"\u001b[1;36m File \u001b[1;32m\"<ipython-input-2-af3b3f6effbc>\"\u001b[1;36m, line \u001b[1;32m4\u001b[0m\n\u001b[1;33m using namespace std;\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
]
}
],
Expand Down Expand Up @@ -324,7 +350,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.7.4"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 66cb284

Please sign in to comment.