Skip to content

Commit

Permalink
Adding notes about stability in the high-precision DG1 notebook.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermes committed Feb 29, 2016
1 parent 85b9671 commit 4555c35
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion assignment1/dg1_high_prec.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"total_time = mpmath.mpf('1.0')\n",
"p_order = 3\n",
"num_intervals = 16\n",
"# CFL condition breaks down between 107 and 106 time steps.\n",
"\n",
"dt = mpmath.mpf('1') / 108\n",
"solver = dg1.DG1Solver(num_intervals=num_intervals,\n",
" p_order=p_order,\n",
Expand All @@ -31,6 +31,27 @@
" points_on_ref_int=dg1_high_prec.gauss_lobatto_points)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The CFL / RK condition breaks down between $106$ and $107$ time steps.\n",
"\n",
"We actually don't expect stability until $N_T = 111$ (number of timesteps).\n",
"The stability function\n",
"$$R(z) = 1 + z + \\frac{z^2}{2} + \\frac{z^3}{6} + \\frac{z^4}{24}$$\n",
"is evaluated at \n",
"$$z = \\frac{\\lambda \\Delta t}{\\Delta x} = \\frac{16 \\lambda}{N_T}$$\n",
"(since we have $16$ space steps and $N_T$ time steps and both the\n",
"space and time intervals are length 1).\n",
"\n",
"When $p = 3$, the largest magnitude value in the spectrum of the space\n",
"discretization is $\\lambda \\approx \\frac{-19.15688121515517}{\\Delta x}$ \n",
"and we enter the region of absolute stability when\n",
"$$R\\left(\\frac{16 \\lambda}{111}\\right) \\approx 0.96450003389941052 < 1 < \n",
"1.0017531696935333 \\approx R\\left(\\frac{16 \\lambda}{110}\\right).$$"
]
},
{
"cell_type": "code",
"execution_count": 2,
Expand Down

0 comments on commit 4555c35

Please sign in to comment.