- observed order of convergence
- refinement ratio
- LTE - p.9
- GTE - p.10
- intro to PDEs - all equations summary p.15
- Definitions of consistency, stability, and convergence
- If the numerical diffusion coefficient is negative, the solution will be unstable
- FTCS is unstable for linear convection (unconditionally unstable) p.10
- von Neumann stability analysis p.11
- conservation laws p.16
- classification of PDEs
- upwind schemes: BS - unstable for negative waves, numerical scheme should have the same directionality p.17
- Lax-equivalence theorem: For a well-posed IVP. and a consistent discretization scheme, stability is the necessary and sufficient condition for convergence.
- Rusanov flux
- Backward Euler method (implicit):
u^(n+1) = u^n + Δt RHS^(n+1)p.12 - BCs for implicit method
[A][x] = [b] + [BCs]: LHS set at the beginning, RHS updated every time step p.15- stability of implicit schemes: unconditionally stable, but stability does not mean the convergence
- 2D stability:
σx + σy ≤ 12
- Crank-Nicolson: semi-implicit scheme, second-order accurate in time
- CS scheme
- All-in-one explanation p.7
- elliptic equations: no time-dependence (steady-state solution), driven by BCs
- 2D Laplace p.6
- Jacobi method p.8
- L2-norm p.12
- second-order Neumann condition p.15
- summary of relaxation methods with equations p.12
- Phogoid mode - intro
- First-order systems
- Euler step
- L1 norm (analytical solution)
- L1 norm (no analytical solution / grid convergence)
- Order of convergence
- Second-order methods: explicit midpoint method / modified Euler method / RK2 method
- Multi-step methods:
- 1D linear convection
- Spatial discretizing: forward, backward, central
- Spatial truncation error
- CFL condition
- 1D diffusion
- Discretizing 2nd order derivatives
- Stability of diffusion equation
- Burgers' equation
- SymPy: diff, lambdify
- Animations: update
- Conservation laws
- Traffic flow model
- FTBS
- Lax-Friedrichs: convection > FTCS is unstable; this stabilizes FTCS by replacing
rho_i^nby its average; but introduces 1st order error - Lax-Wendroff: first scheme ever to achieve 2nd-order accuracy in both space and time; captures the sharpness of the shock; makes an overshoot; needs to calculate expensive Jacobian every time step
- MacCormack: two steps; predictor and corrector;
- Odd-even coupling: staircase behavior on the leading edge of the wave
- Taylor series expansion
- Better flux model
- SymPy: equation solving
- Finite volume method
- Godunov's method: first-order method that uses the integral form of the conservation laws
- Riemann problem: a situation where you have a conservation law with a constant initial condition, except for a single jump discontinuity (has an analytical solution)
- Godunov: represent solution as piecewise constant, use the analytical solution of the Riemann problem at each cell boundary, gives all the information about the characteristic structure of the solution, including the sign of the wave speed, union of all the Riemann solutions at cell boundaries gets the full solution
- first-order accurate, not appropriate for hyperbolic conservation laws
- Rusanov flux
- MUSCLE scheme - Monotonic Upstream-Centered Scheme for Conservation Laws
- minmod - use the smallest one-sided slope in magnitude, if slopes have different sign, use the constant reconstruction, i.e. Godunov's method
- MUSCL: no oscillations, but the features are not as sharp
- Parabolic PDEs
- Diffusion: eg. heat conduction
- FTCS
- Dirichlet BC
- Neumann BC
- Explicit schemes: need small step sizes, BC changes affect the next time step
- implicit method - 1D
- put what we don't know on the left and what we do know on the right
- 2D - heat conduction
- 2D stability
- pyplot.contourf
- implicit method - 2D
- put what we don't know on the left and what we do know on the right
- iterate over the nodes in an x-major order: index
iwill run faster.
- Crank-Nicolson scheme: second-order method in both time and space (all others first-order in time and second-order in space)
- Crank-Nicolson is an unconditionally stable scheme for the diffusion equation
- comparison on spatial convegence and time convergence
- BCs can affect the convergence and accuracy of your solution!
- Elliptic PDEs
- Possion's equation:
uis unknown,fa function of space, need all BCs - Laplce's equation:
f=0(homogeneous case) - Studey of solutions to Laplace's eqn = potential theory; solutions = potential fields
- Jacobi method: simplest relaxation scheme, worst iterative solver
- 3D surface plots + colormaps
- normalized L2 norm
- Dirichlet conditions are order-agnostic
- Possion equation: source term = RHS
- Algebraic convergence
- Spatial convergence: Dirichlet boundaries are "exact" and will never impact spatial convergence
- %%timeit
- Gauss-Seidal: 2x faster than Jacobi method
- Numba - JIT with nopython:
@jit(nopython=True) - SOR (Successive over-relaxation): improve on the Gauss-Seidel method by using in the update a linear combination of the previous and the current solution
- SOR stable only for
0<ω<2:ω = 1= Gauss-Seidal,ω < 1= under relaxation,ω > 1= over relaxation (must converge fater than GS) - Tuned SOR: over-relax the solution as much as possible without introducing instability
- Decay of the difference between iterates
- Steepest descent: two successive jumps are orthogonal, not too good when used with large systems or more complicated right-hand sides in the Poisson equation
- Conjugate gradient (CG): residual