Skip to content

Commit

Permalink
last error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaime Arriaga Garcia committed Nov 12, 2024
1 parent 76dbed2 commit 7d8bf9e
Showing 1 changed file with 10 additions and 39 deletions.
49 changes: 10 additions & 39 deletions book/fvm/advection_1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -414,61 +414,32 @@
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Stability\n",
"\n",
"**Method of Lines** converts partial differential equation (PDE) into a system of ordinary differential equations (ODEs). \n",
"This equation can be rewritten to isolate the amplification factor: \n",
"\n",
"$$\n",
"\\frac{\\phi_{i}^{n+1}-\\phi_{i}^{n}}{\\Delta t}\n",
"= D \\frac{ \\phi_{i-1}- 2\\phi_i + \\phi_{i+1} }{\\Delta x^2} \n",
"\\phi_i^{n+1} = (1-2*\\Delta t D/\\Delta x^2)\\phi_i^n + \\Delta t D \\frac{\\phi_{i-1}^n + \\phi_{i+1}^n}{\\Delta x^2}\n",
"$$\n",
"\n",
"**Time Integration**: We can now apply time-stepping methods like Forward Euler or Backward Euler to integrate these ODEs over time.\n",
"where the amplification factor is multiplying $\\phi_i^n$ and should be lower than 1 to ensure stability:\n",
"\n",
" - **Forward Euler (Explicit)**:\n",
"\n",
" $$\n",
" \\phi_i^{n+1} = \\phi_i^n + \\Delta t D \\frac{\\phi_{i-1}^n - 2\\phi_i^n + \\phi_{i+1}^n}{\\Delta x^2}\n",
" $$\n",
"\n",
" This can be rewritten as \n",
" $$\n",
" \\phi_i^{n+1} = (1-2*\\Delta t D/\\Delta x^2)\\phi_i^n + \\Delta t D \\frac{\\phi_{i-1}^n + \\phi_{i+1}^n}{\\Delta x^2}\n",
" $$\n",
"$$\n",
"-1 < 1-2D \\frac{\\Delta t}{\\Delta x^2} < 1\n",
"$$\n",
"\n",
" Therefore, the amplification factor should be lower than 1:\n",
"thus \n",
"\n",
" $$\n",
" -1 < 1-2D \\frac{\\Delta t}{\\Delta x^2} < 1\n",
" $$\n",
" \n",
" $$\n",
" D \\frac{\\Delta t}{\\Delta x^2} <= 1/2\n",
" $$\n",
"$$\n",
"D \\frac{\\Delta t}{\\Delta x^2} <= 1/2\n",
"$$\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit 7d8bf9e

Please sign in to comment.