Created with ❤️ by Machine Learning & Simulation.
Using the conventions of numpy.fft: Normalization by 1/N on the inverse transform, ordering starts at zero mode, then positive modes in ascending order, then negative modes in ascending order (starting at the "most negative") N is always the number of dof
Function | Fourier Coefficients |
---|---|
Example for $N = 5$ on $\Omega = [0, 2 \pi)$ | |
$ k = \begin{bmatrix} 0 & 1 & 2 & -2 & -1 \end{bmatrix} $ | |
$u(x) = a$ | $ \hat{u}_h = \begin{bmatrix} a 5 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \end{bmatrix} \odot \begin{bmatrix} 1 \\ i \end{bmatrix} $ |
$u(x) = ai$ | $ \hat{u}_h = \begin{bmatrix} 0 & 0 & 0 & 0 & 0 \\ a 5 & 0 & 0 & 0 & 0 \end{bmatrix} \odot \begin{bmatrix} 1 \\ i \end{bmatrix} $ |
$u(x) = a \sin(1 x)$ | $ \hat{u}_h = \begin{bmatrix} 0 & 0 & 0 & 0 & 0 \\ 0 & - a \frac{5}{2} & 0 & 0 & a \frac{5}{2} \end{bmatrix} \odot \begin{bmatrix} 1 \\ i \end{bmatrix} $ |
$u(x) = a \cos(1 x)$ | $ \hat{u}_h = \begin{bmatrix} 0 & a \frac{5}{2} & 0 & 0 & a \frac{5}{2} \\ 0 & 0 & 0 & 0 & 0 \end{bmatrix} \odot \begin{bmatrix} 1 \\ i \end{bmatrix} $ |
$u(x) = a i \sin(1 x)$ | $ \hat{u}_h = \begin{bmatrix} 0 & a \frac{5}{2} & 0 & 0 & - a \frac{5}{2} \\ 0 & 0 & 0 & 0 & 0 \end{bmatrix} \odot \begin{bmatrix} 1 \\ i \end{bmatrix} $ |
$u(x) = a i \cos(1 x)$ | $ \hat{u}_h = \begin{bmatrix} 0 & 0 & 0 & 0 & 0 \\ 0 & a \frac{5}{2} & 0 & 0 & a \frac{5}{2} \end{bmatrix} \odot \begin{bmatrix} 1 \\ i \end{bmatrix} $ |
$u(x) = a \sin(2 x)$ | $ \hat{u}_h = \begin{bmatrix} 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & - a \frac{5}{2} & a \frac{5}{2} & 0 \end{bmatrix} \odot \begin{bmatrix} 1 \\ i \end{bmatrix} $ |
$u(x) = a \cos(2 x)$ | $ \hat{u}_h = \begin{bmatrix} 0 & 0 & a \frac{5}{2} & a \frac{5}{2} & 0 \\ 0 & 0 & 0 & 0 & 0 \end{bmatrix} \odot \begin{bmatrix} 1 \\ i \end{bmatrix} $ |
$u(x) = a i \sin(2 x)$ | $ \hat{u}_h = \begin{bmatrix} 0 & 0 & a \frac{5}{2} & - a \frac{5}{2} & 0 \\ 0 & 0 & 0 & 0 & 0 \end{bmatrix} \odot \begin{bmatrix} 1 \\ i \end{bmatrix} $ |
$u(x) = a i \cos(2 x)$ | $ \hat{u}_h = \begin{bmatrix} 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & a \frac{5}{2} & a \frac{5}{2} & 0 \end{bmatrix} \odot \begin{bmatrix} 1 \\ i \end{bmatrix} $ |
$u(x) = a \sin(3 x)$ | $ \hat{u}_h = \begin{bmatrix} 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & a \frac{5}{2} & - a \frac{5}{2} & 0 \end{bmatrix} \odot \begin{bmatrix} 1 \\ i \end{bmatrix} $ |
$u(x) = a \cos(3 x)$ | $ \hat{u}_h = \begin{bmatrix} 0 & 0 & a \frac{5}{2} & a \frac{5}{2} & 0 \\ 0 & 0 & 0 & 0 & 0 \end{bmatrix} \odot \begin{bmatrix} 1 \\ i \end{bmatrix} $ |
$u(x) = a i \sin(3 x)$ | $ \hat{u}_h = \begin{bmatrix} 0 & 0 & - a \frac{5}{2} & a \frac{5}{2} & 0 \\ 0 & 0 & 0 & 0 & 0 \end{bmatrix} \odot \begin{bmatrix} 1 \\ i \end{bmatrix} $ |
$u(x) = a i \cos(3 x)$ | $ \hat{u}_h = \begin{bmatrix} 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & a \frac{5}{2} & a \frac{5}{2} & 0 \end{bmatrix} \odot \begin{bmatrix} 1 \\ i \end{bmatrix} $ |
Bandlimited | |
$u(x) = a \sin(1 x)$ | $ \hat{u}_k \begin{cases} 0 - a\frac{N}{2}i \quad &k = 1 \\ 0 + a\frac{N}{2}i \quad &k = (N - 1) -1 \\ 0 & \text{else} \end{cases} $ |