Numerics:
ETK:
Method of Lines (thorn MoL):
(Dis)advantages:
To represent $\phi(x)$ as finite data:
ETK works best with FD and FV.
Approximate:
Example:
$$ \begin{aligned} && \partial_t \phi + \partial_x (v \phi) & = 0 \\ \rightarrow && \partial_t \phi_i & = \frac{-v \left( \phi_{i+1} - \phi_{i-1} \right)}{2 \, \Delta x}. \end{aligned} $$Finite differencing errors $\propto \Delta x^p = N^{-p}$:
$$ \partial_t \phi_i + \frac{v \left( \phi_{i+1} - \phi_{i-1} \right)}{2 \, \Delta x} = \mathcal{O} \left( \Delta x^2 \right). $$$\Delta x$ "small": higher order usually better. However, costs increase:
$$ \partial_x \phi \simeq \frac{-\phi_{i+2} + \phi_{i-2} + 8 (\phi_{i+1} - \phi_{i-1})}{12 \, \Delta x}. $$Usual to plot convergence with $N$ or $\Delta x$. Really resource (eg CPU time) that matters.
Finite differencing errors:
Phase error dependence on $\Delta x$ can be estimated.
For 1kHz wave for 1s, 1% phase error:
| $2^{\textrm{nd}}$ order | $4^{\textrm{th}}$ order | $6^{\textrm{th}}$ order |
|---|---|---|
| $10$m | $265$m | $784$m |
Phase errors dependence on $\Delta x$ can be estimated.
For 10kHz wave for 1s, 0.01% phase error:
| $2^{\textrm{nd}}$ order | $4^{\textrm{th}}$ order | $6^{\textrm{th}}$ order |
|---|---|---|
| $0.3$m | $47$m | $247$m |
Higher order is better: use all information. Mode expand:
$$ \phi = \sum_i \hat{\phi}_i \sin \left(\frac{2 \pi i x}{L} \right). $$Then $\partial_x \phi \simeq D \hat{\phi}$.
Spectral error $\sim \exp(-p N)$.
Accuracy of full evolution often constrained.
ETK has spectral initial data (TwoPunctures, LORENE), no evolution.
Any high order method shows Gibbs' oscillations at jumps.
No convergence with resolution.
Use piecewise polynomial reconstruction (eg WENO) to avoid oscillations.
See GRHydro, IllinoisGRMHD, Spritz, WhiskyTHC.
Classic CPU (Carpet etc): split domain.
GPUs (CarpetX etc): create tasks.
Formally need to work with weak form
$$ \begin{aligned} && \partial_t \phi + \nabla_k f^{(k)}(\phi) & = 0 \\ \implies && \frac{\text{d}}{\text{d}t} \int_V \phi + \oint_{\partial V} \hat{n}_k f^{(k)}(\phi) & = 0. \end{aligned} $$Discrete version, 1d:
$$ \frac{\text{d}}{\text{d}t} \hat{\phi}_i + \frac{1}{\Delta x} \left[ f_{i+1/2} - f_{i-1/2} \right] = 0. $$
Finding the flux $f_{k \pm 1/2}$ depends on the model (for fluids see GRHydro etc).
Using the right weak form is essential.
$$ \begin{aligned} && \partial_t q^n + \frac{n}{n+1} \partial_x q^{n+1} & = 0 \\ \implies && \partial_t q + q \partial_x q & = 0. \end{aligned} $$Strong solutions agree when continuous; inconsistent at shocks.
Can use entropy pairs, path-consistent methods for complex cases. Links to SummationByParts.
Want high order, low communication. Apply weak form to basis expansion $q(x, t) \sim \hat{q}_m(t) P_m(x)$, getting
$$ M \partial_t \hat{q} + S^T f(\hat{q}) = - \left[ F \right]_{i-1/2}^{i+1/2}. $$
No code in ETK (?) - see Spectre.
For $\dot{q} = -\tau^{-1} f(q)$,
Stable does not mean accurate!
IMEX methods can be added to MoL.
The Cattaneo model for heat is stiff:
$$ \begin{aligned} \partial_t T & = \partial_x q, \\ \partial_t q & = - \tau^{-1} \left( q - \kappa \partial_x T \right). \end{aligned} $$For $\tau \ll 1$ write $q = \kappa \partial_x T + \mathcal{O}(\tau)$, finding
$$ \partial_t T = \kappa \partial_{xx} T + \tau \kappa^3 \partial_x^{(4)} T. $$Solve heat equation explicitly whilst $\Delta t \gtrsim \kappa \Delta x^2 / 2$.
Changing model can reduce costs by
Choose model adaptively to improve numerics while capturing physics.
Examples:
Asymptotic preserving models and schemes are needed.
The ETK is optimized for
CarpetX should add GPU support.
Adaptive and hybrid methods becoming common, but complex.
Uncertainty quantification a key buzzword - lots of formal (non-GR) work to understand.