Skip to content

Commit

Permalink
Fix equations rendering in Nbviewer
Browse files Browse the repository at this point in the history
[L3-5] Fix equations rendering

[L3-5] Fix equations rendering

[L3-5] Fix equations rendering

[L4-2] Fix equations rendering

[L4-4] Fix equations rendering

[L4-5] Fix equations rendering

[L5-1] Use Lx and Ly instead of L and H
  • Loading branch information
mesnardo committed Aug 21, 2018
1 parent d3eabf0 commit 316ab62
Show file tree
Hide file tree
Showing 5 changed files with 231 additions and 181 deletions.
134 changes: 69 additions & 65 deletions lessons/03_wave/03_05_Sods_Shock_Tube.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,23 @@
"\n",
"$$\n",
"\\begin{equation}\n",
"\\frac{\\partial}{\\partial t} \\left[\n",
"\\begin{array}{c}\n",
"\\rho \\\\\n",
"\\rho u \\\\\n",
"\\rho e_T \\\\ \n",
"\\end{array}\n",
"\\right]\n",
"+ \\frac{\\partial}{\\partial x} \\left[ \\begin{array}{c}\n",
"\\rho u \\\\\n",
"\\rho u^2 + p \\\\\n",
"(\\rho e_T + p) u \\\\\n",
"\\end{array}\n",
"\\right]\n",
"=0\n",
" \\frac{\\partial}{\\partial t}\n",
" \\left[\n",
" \\begin{array}{c}\n",
" \\rho \\\\\n",
" \\rho u \\\\\n",
" \\rho e_T \\\\\n",
" \\end{array}\n",
" \\right] +\n",
" \\frac{\\partial}{\\partial x}\n",
" \\left[\n",
" \\begin{array}{c}\n",
" \\rho u \\\\\n",
" \\rho u^2 + p \\\\\n",
" (\\rho e_T + p) u \\\\\n",
" \\end{array}\n",
" \\right] =\n",
" 0\n",
"\\end{equation}\n",
"$$\n",
"\n",
Expand Down Expand Up @@ -238,40 +241,39 @@
"In order to get everything squared away, we need to represent $\\underline{\\mathbf{f}}$ in terms of $\\underline{\\mathbf{u}}$.\n",
"We can introduce a little shorthand for the $\\underline{\\mathbf{u}}$ and $\\underline{\\mathbf{f}}$ vectors and define:\n",
"\n",
"\n",
"$$\n",
"\\underline{\\mathbf{u}} = \\left[\n",
"\\begin{array}{c}\n",
"u_1 \\\\\n",
"u_2 \\\\\n",
"u_3 \\\\ \n",
"\\end{array}\n",
"\\right]\n",
"=\n",
"\\underline{\\mathbf{u}} =\n",
"\\left[\n",
"\\begin{array}{c}\n",
"\\rho \\\\\n",
"\\rho u \\\\\n",
"\\rho e_T \\\\ \n",
"\\end{array}\n",
" \\begin{array}{c}\n",
" u_1 \\\\\n",
" u_2 \\\\\n",
" u_3 \\\\\n",
" \\end{array}\n",
"\\right] =\n",
"\\left[\n",
" \\begin{array}{c}\n",
" \\rho \\\\\n",
" \\rho u \\\\\n",
" \\rho e_T \\\\\n",
" \\end{array}\n",
"\\right]\n",
"$$\n",
"\n",
"$$\n",
"\\underline{\\mathbf{f}} = \\left[\n",
"\\begin{array}{c}\n",
"f_1 \\\\\n",
"f_2 \\\\\n",
"f_3 \\\\\n",
"\\end{array}\n",
"\\right]\n",
"=\n",
"\\underline{\\mathbf{f}} =\n",
"\\left[\n",
"\\begin{array}{c}\n",
"\\rho u \\\\\n",
"\\rho u^2 + p \\\\\n",
"(\\rho e_T + p) u \\\\\n",
"\\end{array}\n",
" \\begin{array}{c}\n",
" f_1 \\\\\n",
" f_2 \\\\\n",
" f_3 \\\\\n",
" \\end{array}\n",
"\\right] =\n",
"\\left[\n",
" \\begin{array}{c}\n",
" \\rho u \\\\\n",
" \\rho u^2 + p \\\\\n",
" (\\rho e_T + p) u \\\\\n",
" \\end{array}\n",
"\\right]\n",
"$$ \n",
"\n",
Expand Down Expand Up @@ -315,36 +317,38 @@
"In a tube spanning from $x = -10 \\text{m}$ to $x = 10 \\text{m}$ with the rigid membrane at $x = 0 \\text{m}$, we have the following initial gas states:\n",
"\n",
"$$\n",
"\\underline{IC}_L = \\left[\n",
"\\begin{array}{c}\n",
"\\rho_L \\\\\n",
"u_L \\\\\n",
"p_L \\\\\n",
"\\end{array}\n",
"\\right] = \n",
"\\underline{IC}_L =\n",
"\\left[\n",
"\\begin{array}{c}\n",
"1\\ kg/m^3 \\\\\n",
"0\\ m/s \\\\\n",
"100\\ kN/m^2 \\\\\n",
"\\end{array}\n",
" \\begin{array}{c}\n",
" \\rho_L \\\\\n",
" u_L \\\\\n",
" p_L \\\\\n",
" \\end{array}\n",
"\\right] =\n",
"\\left[\n",
" \\begin{array}{c}\n",
" 1.0 \\, kg/m^3 \\\\\n",
" 0 \\, m/s \\\\\n",
" 100 \\, kN/m^2 \\\\\n",
" \\end{array}\n",
"\\right]\n",
"$$\n",
"\n",
"$$\n",
"\\underline{IC}_R = \\left[\n",
"\\begin{array}{c}\n",
"\\rho_R \\\\\n",
"u_R \\\\\n",
"p_R \\\\\n",
"\\end{array}\n",
"\\right] = \n",
"\\underline{IC}_R =\n",
"\\left[\n",
"\\begin{array}{c}\n",
"0.125\\ kg/m^3 \\\\\n",
"0\\ m/s \\\\\n",
"10\\ kN/m^2 \\\\\n",
"\\end{array}\n",
" \\begin{array}{c}\n",
" \\rho_R \\\\\n",
" u_R \\\\\n",
" p_R \\\\\n",
" \\end{array}\n",
"\\right] =\n",
"\\left[\n",
" \\begin{array}{c}\n",
" 0.125 \\, kg/m^3 \\\\\n",
" 0 \\, m/s \\\\\n",
" 10 \\, kN/m^2 \\\\\n",
" \\end{array}\n",
"\\right]\n",
"$$\n",
"\n",
Expand Down
69 changes: 33 additions & 36 deletions lessons/04_spreadout/04_02_Heat_Equation_1D_Implicit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
"\n",
"$$\n",
"\\begin{equation}\n",
"- T_{N-3}^{n+1} + \\left( 1 + \\frac{\\Delta x^2}{\\alpha\\Delta t}\\right) T_{N-2}^{n+1} = T_{N-2}^{n}\\frac{\\Delta x^2}{\\alpha\\Delta t} + \\Delta x q\n",
" -T_{N-3}^{n+1} + \\left( 1 + \\frac{\\Delta x^2}{\\alpha\\Delta t} \\right) T_{N-2}^{n+1} = T_{N-2}^{n} \\frac{\\Delta x^2}{\\alpha\\Delta t} + \\Delta x q\n",
"\\end{equation}\n",
"$$\n",
"\n",
Expand All @@ -197,41 +197,38 @@
"source": [
"$$\n",
"\\begin{align}\n",
"\\left[\n",
"\\begin{array}{cccccc}\n",
"\\left(2 + \\frac{1}{\\sigma}\\right) & -1 & 0 & \\cdots & & 0 \\\\\n",
"-1 & \\left(2 + \\frac{1}{\\sigma}\\right) & -1 & 0 & \\cdots & 0 \\\\\n",
"0 & & \\ddots& & & \\vdots \\\\\n",
"\\vdots & & & & \\left(2 + \\frac{1}{\\sigma}\\right)& \\\\\n",
"0 & \\cdots & & & -1 & \\left(1 + \\frac{1}{\\sigma}\\right)\n",
"\\end{array}\n",
"\\right]\n",
"\\cdot \n",
"\\left[\n",
"\\begin{array}{c} \n",
"T_1^{n+1} \\\\\n",
"T_2^{n+1} \\\\\n",
"\\vdots \\\\ \\\\\n",
"T_{N-2}^{n+1}\n",
"\\end{array}\n",
"\\right]\n",
"=\n",
"\\left[\n",
"\\begin{array}{c} \n",
"T_1^n \\frac{1}{\\sigma} \\\\\n",
"T_2^{n}\\frac{1}{\\sigma} \\\\\n",
"\\vdots \\\\ \\\\\n",
"T_{N-2}^{n}\\frac{1}{\\sigma}\n",
"\\end{array}\n",
"\\right]\n",
"+\n",
"\\begin{bmatrix}\n",
"T_0^{n+1} \\\\\n",
"0 \\\\ \\\\\n",
"\\vdots \\\\ \\\\\n",
"0 \\\\\n",
"q\\Delta x\n",
"\\end{bmatrix}\n",
" \\left[\n",
" \\begin{array}{cccccc}\n",
" \\left( 2 + \\frac{1}{\\sigma} \\right) & -1 & 0 & \\cdots & & 0 \\\\\n",
" -1 & \\left( 2 + \\frac{1}{\\sigma} \\right) & -1 & 0 & \\cdots & 0 \\\\\n",
" 0 & & \\ddots & & & \\vdots \\\\\n",
" \\vdots & & & & \\left( 2 + \\frac{1}{\\sigma} \\right) & \\\\\n",
" 0 & \\cdots & & & -1 & \\left( 1 + \\frac{1}{\\sigma} \\right)\n",
" \\end{array}\n",
" \\right] \\cdot \n",
" \\left[\n",
" \\begin{array}{c} \n",
" T_1^{n+1} \\\\\n",
" T_2^{n+1} \\\\\n",
" \\vdots \\\\ \\\\\n",
" T_{N-2}^{n+1}\n",
" \\end{array}\n",
" \\right] =\n",
" \\left[\n",
" \\begin{array}{c} \n",
" T_1^n \\frac{1}{\\sigma} \\\\\n",
" T_2^{n} \\frac{1}{\\sigma} \\\\\n",
" \\vdots \\\\ \\\\\n",
" T_{N-2}^{n} \\frac{1}{\\sigma}\n",
" \\end{array}\n",
" \\right] +\n",
" \\begin{bmatrix}\n",
" T_0^{n+1} \\\\\n",
" 0 \\\\\n",
" \\vdots \\\\\n",
" 0 \\\\\n",
" q\\Delta x\n",
" \\end{bmatrix}\n",
"\\end{align}\n",
"$$\n",
" \n",
Expand Down
Loading

0 comments on commit 316ab62

Please sign in to comment.