-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1834409
commit 29d1713
Showing
11 changed files
with
354 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,22 +14,6 @@ | |
"Benjamin Campforts, [email protected]\n", | ||
"Lecture notes on diffusion are partly based on Prof. Dr. Frédéric Herman's course on geophysical processes \n", | ||
"\n", | ||
"> ## Learning Objectives \n", | ||
">\n", | ||
"> * Explain what a for loop does\n", | ||
"> * Correctly write for loops to repeat simple calculations\n", | ||
"> * Trace changes to a loop variable as the loop runs\n", | ||
"> * Trace changes to other variables as they are updated by a for loop\n", | ||
"\n", | ||
"\n", | ||
"\n", | ||
"Many members of our community focus on developing numerical models to study how landscapes evolve over time. The simplest and most commonly used transport law used to capture the evolution of hillslopes is a diffusion equation:\n", | ||
"\n", | ||
"$$\\frac{\\partial z}{\\partial t} = K \\; \\frac{\\partial^2 z}{\\partial x^2}$$\n", | ||
"\n", | ||
"where $z$ is elevation, $x$ is the horizontal distance, and $K$ is a landscape diffusion coefficient.\n", | ||
"\n", | ||
"\n", | ||
"## Diffusion\n", | ||
"\n", | ||
"### Introduction\n", | ||
|
@@ -114,7 +98,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
|
@@ -139,21 +123,9 @@ | |
"print(random.random(), random.random(), random.random())" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### add callout and exercises from 03-loops" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
|
@@ -196,7 +168,7 @@ | |
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Elapsed time is: 6.171136140823364sec\n" | ||
"Elapsed time is: 5.70633602142334sec\n" | ||
] | ||
} | ||
], | ||
|
@@ -245,7 +217,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
|
@@ -504,7 +476,7 @@ | |
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Elapsed time is: 18.42082691192627sec\n" | ||
"Elapsed time is: 16.847065925598145sec\n" | ||
] | ||
} | ||
], | ||
|
@@ -586,17 +558,17 @@ | |
"\n", | ||
"$$ \\frac{\\Delta C}{\\Delta t} = \\frac{q_x -q_{x+dx}}{\\Delta X} \\label{eq:A6} \\tag{A6}$$\n", | ||
"\n", | ||
"Using the definition of a partial difference equation:\n", | ||
"Using the definition of a differential equation:\n", | ||
"\n", | ||
"$$ \\frac{\\delta q}{\\delta x} = \\frac{(q_{x+dx} -q_x)}{\\Delta X} \\label{eq:A7} \\tag{A7}$$\n", | ||
"\n", | ||
"We obtain the following equation:\n", | ||
"We obtain the following equation (note the use of the $\\partial$ symbol: we solve a PDE):\n", | ||
"\n", | ||
"$$ \\frac{\\delta C}{\\delta t} = -\\frac{\\delta q}{\\delta x} \\label{eq:2} \\tag{2}$$\n", | ||
"$$ \\frac{\\partial C}{\\partial t} = -\\frac{\\partial q}{\\partial x} \\label{eq:2} \\tag{2}$$\n", | ||
"By combining Eqs.(\\ref{eq:1}) and (\\ref{eq:2}), we finally obtain the heat\n", | ||
"equation: \n", | ||
"\n", | ||
"$$ \\frac{\\delta C}{\\delta t} = D\\frac{\\delta^2 C}{\\delta x^2} \\label{eq:3} \\tag{3}$$\n", | ||
"$$ \\frac{\\partial C}{\\partial t} = D\\frac{\\partial^2 C}{\\partial x^2} \\label{eq:3} \\tag{3}$$\n", | ||
"\n", | ||
"which depends only on the curvature (i.e. the second derivative) of the concentration and the diffusion constant. Therefore, it is sufficient to know the diffusion coefficient $D$ (which can be measured) and to measure the curvature to estimate the change in concentration over time." | ||
] | ||
|
@@ -631,7 +603,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"execution_count": 6, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
|
@@ -744,7 +716,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"execution_count": 7, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
|
@@ -835,9 +807,7 @@ | |
"\n", | ||
"**Figure:** 1D situation sketch\n", | ||
"\n", | ||
"Solve the spread of ash using the diffusion equation: \n", | ||
"\n", | ||
"$$ \\frac{\\delta C}{\\delta t} = D\\frac{\\delta^2 C}{\\delta x^2} \\label{eq:3} \\tag{3}$$\n", | ||
"Solve the spread of ash using the diffusion equation (Eq. 3)\n", | ||
"\n", | ||
"Define the model parameters: \n", | ||
"- set the diffusivity to 25 km$^2$/h\n", | ||
|
@@ -852,7 +822,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 10, | ||
"execution_count": 8, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
|
@@ -868,7 +838,7 @@ | |
"<Figure size 432x288 with 0 Axes>" | ||
] | ||
}, | ||
"execution_count": 10, | ||
"execution_count": 8, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
}, | ||
|
@@ -944,7 +914,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 11, | ||
"execution_count": 9, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
|
384 changes: 311 additions & 73 deletions
384
lessons/python/ESPIN-06 Models Part 2 (Advection).ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.