Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged two PRs and added make_html.py #71

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3d38504
separated out code to compute trajectories and use to plot red/blue s…
rjleveque Apr 23, 2017
ddd8257
fix exact_solvers/traffic_LWR.py to use new trajectories code.
rjleveque Apr 24, 2017
bb9b10d
Initial effort at compiling book.
ketch Apr 24, 2017
863239d
Use report template and update script name.
ketch Apr 24, 2017
ac60084
Add 5 more chapters to book.
ketch Apr 24, 2017
a718c89
Merge branch 'master' into bookform
ketch Apr 24, 2017
ef59ba4
Remove stray comma from merge.
ketch Apr 24, 2017
0729c6b
Run pdflatex one more time for citations.
ketch Apr 24, 2017
660ed53
New Introduction.ipynb from old Prologue notebooks, with SW stripe ex…
rjleveque Apr 24, 2017
b4b0a19
Minor cleanup of stripe plotting code.
ketch Apr 25, 2017
decc0ef
Add acoustics phase plane demo.
ketch Apr 25, 2017
65f9b99
no reload in Python 3
ketch Apr 25, 2017
4e62f82
Use t=0.2 instead of t=0 for static widget output.
ketch Apr 25, 2017
eadfc63
Improved presentation in Shallow_water.ipynb.
ketch Apr 27, 2017
8bd584f
Add Preface and fix some issues with bookbook.
ketch Apr 30, 2017
b7ea741
Merge branch 'master' into bookform
ketch Apr 30, 2017
0d30c94
Apply SIAM book formatting to pdf.
ketch Apr 30, 2017
e63f58d
change 'time' to 't' and initialize to 0 in Introduction
rjleveque May 1, 2017
345c798
First pass at utils/jsanimate_widgets.py, illustrated in Introduction
rjleveque May 1, 2017
547bfd8
rjleveque version for debugging bookbook
rjleveque May 4, 2017
56d97f8
Add a bit to Introduction
rjleveque May 6, 2017
078387d
Merge branch 'master' into plot_red_blue_stripes
rjleveque May 6, 2017
442fde2
Add shallow water javascript to Introduction
rjleveque May 6, 2017
66a614d
first pass at script to convert all notebooks to html for a webpage
rjleveque May 6, 2017
9b22312
fix import statements for interact
rjleveque May 6, 2017
4368d3a
Merge branch 'bookform' into make_html_test and fixed conflicting cha…
rjleveque May 6, 2017
e5c1a08
add Introduction to make_chapters.py
rjleveque May 6, 2017
f135c16
revert change needed only by rjleveque due to python3 path issue
rjleveque May 6, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 57 additions & 98 deletions Acoustics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@
"cells": [
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"metadata": {},
"source": [
"\n",
"# Riemann problem for acoustics\n",
"\n",
"This notebook illustrates some features of the exact solution to the 1-dimensional constant coefficient acoustics equations, as described in more detail in Chapter 3 of <cite data-cite=\"fvmhp\"><a href=\"riemann.html#fvmhp\">(LeVeque 2002)<a></cite>"
"This notebook illustrates some features of the exact solution to the 1-dimensional constant coefficient acoustics equations, as described in more detail in Chapter 3 of <cite data-cite=\"fvmhp\"><a href=\"riemann.html#fvmhp\">(LeVeque 2002)<a></cite>\n",
"\n",
"**Need to rewrite to use widgets**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
"collapsed": false
},
"outputs": [],
"source": [
Expand All @@ -30,10 +27,7 @@
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"metadata": {},
"source": [
"The next cell imports a module containing a function that takes a Riemann problem (left state, right state, and approximate solver), and computes the Riemann solution, as well as functions to plot the solution in various forms. "
]
Expand All @@ -42,9 +36,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
"collapsed": false
},
"outputs": [],
"source": [
Expand All @@ -55,9 +47,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
"collapsed": false
},
"outputs": [],
"source": [
Expand All @@ -69,10 +59,7 @@
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"metadata": {},
"source": [
"# Acoustics: exact solution\n",
"We can use this to examine the exact solution of an acoustics Riemann problem.\n",
Expand All @@ -97,9 +84,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
"collapsed": false
},
"outputs": [],
"source": [
Expand All @@ -109,10 +94,7 @@
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"metadata": {},
"source": [
"### Set some problem data needed by the solver:"
]
Expand All @@ -121,9 +103,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
"collapsed": false
},
"outputs": [],
"source": [
Expand All @@ -143,10 +123,7 @@
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"metadata": {},
"source": [
"### Set the left and right states, and solve the Riemann problem"
]
Expand All @@ -155,9 +132,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
"collapsed": false
},
"outputs": [],
"source": [
Expand All @@ -170,10 +145,7 @@
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"metadata": {},
"source": [
"### Plot the states in the phase plane:"
]
Expand All @@ -182,9 +154,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
"collapsed": false
},
"outputs": [],
"source": [
Expand All @@ -195,10 +165,7 @@
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"metadata": {},
"source": [
"### Plot the waves in the x-t plane, and the solution at one particular time:"
]
Expand All @@ -207,9 +174,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
"collapsed": false
},
"outputs": [],
"source": [
Expand All @@ -218,10 +183,7 @@
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"metadata": {},
"source": [
"### Animate the Riemann solution:"
]
Expand All @@ -230,9 +192,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
"collapsed": false
},
"outputs": [],
"source": [
Expand All @@ -241,10 +201,7 @@
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"metadata": {},
"source": [
"## Shock tube problem:\n",
"\n",
Expand All @@ -255,9 +212,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
"collapsed": false
},
"outputs": [],
"source": [
Expand All @@ -276,9 +231,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
"collapsed": false
},
"outputs": [],
"source": [
Expand All @@ -287,10 +240,7 @@
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"metadata": {},
"source": [
"### Plot the particle trajectories\n",
"\n",
Expand All @@ -309,21 +259,27 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
"collapsed": false
},
"outputs": [],
"source": [
"riemann_tools.plot_riemann_trajectories(states,s,riemann_eval,i_vel=1)"
"wave_types = ['contact','contact'] # for a linear system of 2 equations\n",
"\n",
"# Specify number of trajectories to left and right:\n",
"num_left = 10\n",
"num_right = 10\n",
"\n",
"# compute trajectories:\n",
"x_traj, t_traj, xmax = riemann_tools.compute_riemann_trajectories(states, s, riemann_eval, wave_types,\n",
" i_vel=1, num_left=num_left, num_right=num_right)\n",
"\n",
"# plot trajectories along with waves in the x-t plane:\n",
"riemann_tools.plot_riemann_trajectories(x_traj, t_traj, s, wave_types)"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"metadata": {},
"source": [
"## Flow into a wall:\n",
"\n",
Expand All @@ -334,9 +290,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
"collapsed": false
},
"outputs": [],
"source": [
Expand All @@ -355,34 +309,39 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
"collapsed": false
},
"outputs": [],
"source": [
"riemann_tools.JSAnimate_plot_riemann(states,s,riemann_eval)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Again we can plot particle trajectories:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
"collapsed": false
},
"outputs": [],
"source": [
"riemann_tools.plot_riemann_trajectories(states,s,riemann_eval,i_vel=1)"
"# compute trajectories:\n",
"x_traj, t_traj, xmax = riemann_tools.compute_riemann_trajectories(states, s, riemann_eval, wave_types,\n",
" i_vel=1, num_left=num_left, num_right=num_right)\n",
"\n",
"# plot trajectories along with waves in the x-t plane:\n",
"riemann_tools.plot_riemann_trajectories(x_traj, t_traj, s, wave_types)"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"metadata": {},
"source": [
"If you discard half the solution (for $x>0$ or for $x<0$) then what you see can be viewed as the solution to a problem with fluid streaming at constant velocity toward a solid wall. The result is an acoustic wave that moves away from the wall, and the fluid behind the shock has been decelerated to velocity 0, i.e. it is stationary at the wall.\n",
"\n",
Expand All @@ -406,9 +365,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.13"
"version": "2.7.12"
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 1
}
11 changes: 8 additions & 3 deletions Advection.ipynb
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Advection"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
Expand Down
Loading