Periodic Hodge-Star

dec.spectral.H(a)[source]
\[\mathbf{H}^0 = \widetilde{\mathbf{H}}^0 = \mathcal{F}^{-1} \mathbf{I}^{-\frac{h}{2}, \frac{h}{2}} \mathcal{F}\]
dec.spectral.Hinv(a)[source]
\[\mathbf{H}^1 = \widetilde{\mathbf{H}}^1 = \mathcal{F}^{-1}{\mathbf{I}^{-\frac{h}{2},\frac{h}{2}}}^{-1}\mathcal{F}\]

where

dec.spectral.I_diag(N, a, b)[source]

A diagonal matrix that corresponds to integration in Fourier space. Corresponds to \(f(x) \mapsto \int_{x+a}^{x+b} f(\xi) d\xi\)

\[\mathbf{I}_{\phantom{a,b}nn}^{a,b} =\frac{e^{inb}-e^{ina}}{in}\]
\[\mathbf{I}_{\phantom{a,b}00}^{a,b}=b-a\]
dec.spectral.S_diag(N, a)[source]

A diagonal matrix that corresponds to shifting in Fourier Space Corresponds to \(f(x) \mapsto f(x-h)\)

\[\mathbf{S}_{\phantom{a}nn}^{a}=e^{ina}\]

Regular Hodge-Star

dec.spectral.H0_regular(f)[source]
\[\mathbf{H}^{0}= \mathbf{A} \mathbf{M}_{0}^{\dagger} \mathbf{I}^{-\frac{h}{2},\frac{h}{2}} \mathbf{M}_{0}^{+}\]
dec.spectral.H0d_regular(f)[source]
\[\widetilde{\mathbf{H}}^{0}= \mathbf{M}_{1}^{\dagger} \mathbf{I}^{-\frac{h}{2},\frac{h}{2}} \mathbf{M}_{1}^{-}\]
dec.spectral.H1_regular(f)[source]
\[\mathbf{H}^{1}= \mathbf{M}_{1}^{\dagger} {\mathbf{I}^{-\frac{h}{2},\frac{h}{2}}}^{-1} \mathbf{M}_{1}^{-}\]
dec.spectral.H1d_regular(f)[source]
\[\widetilde{\mathbf{H}}^{1}= \mathbf{M}_{1}^{\dagger} {\mathbf{I}^{-\frac{h}{2},\frac{h}{2}}}^{-1} \mathbf{M}_{1}^{+} \mathbf{A}^{-1}\]

where

dec.spectral.A_diag(N)[source]
\[\begin{split}\mathbf{A}=\text{diag}\left(\begin{array}{ccccccc}\frac{1}{2} & 1 & 1 & \dots & 1 & 1 & \frac{1}{2}\end{array}\right)\end{split}\]

Chebyshev Hodge-Star

dec.spectral.H0_cheb(f)[source]

Attempt to simplify the hodge-star.

dec.spectral.H0d_cheb(f)[source]
\[\widetilde{\mathbf{H}}^0 = {\mathbf{M}_1}^{\dagger} \mathbf{I}^{-\frac{h}{2}, \frac{h}{2}} \widetilde{\mathbf{\Omega}} \mathbf{M}_1^+\]
dec.spectral.H1_cheb(f)[source]
\[\mathbf{H}^1 = {\mathbf{M}_1}^{\dagger} \widetilde{\mathbf{\Omega}}^{-1} {\mathbf{I}^{-\frac{h}{2}, \frac{h}{2}}}^{-1} \mathbf{M}_1^-\]
dec.spectral.H1d_cheb(f)[source]
\[\widetilde{\mathbf{H}}^{1} = \mathbf{M}_{0}^{\dagger}\left(\mathbf{T^{-\frac{h}{2}}}\mathbf{\Omega}^{-1}\mathbf{T}^{\frac{h}{2}}-\mathbf{B}\mathbf{I}^{0,\frac{h}{2}}-\mathbf{B}^{\dagger}\mathbf{I}^{-\frac{h}{2},0}\right)\mathbf{I}^{-\frac{h}{2},\frac{h}{2}}^{-1}\mathbf{M}_{0}^{-}\mathbf{C}+\mathbf{B}+\mathbf{B}^{\dagger}\]

where

dec.spectral.Omega(N)[source]
\[\mathbf{\Omega}_{nn}=\sin\left(nh\right)\]
dec.spectral.Omega_d(N)[source]
\[\mathbf{\widetilde{\Omega}}_{nn} =\sin\left(\left(n+\frac{1}{2}\right)h\right)\]

If \(\widetilde{\omega}\) is the length of each dual edge, then

\[\mathbf{\widetilde{\Omega}} =\text{diag}(\mathbf{M}_{1}^{\dagger} \mathcal{F}^{-1}{\mathbf{I}^{-\frac{h}{2},\frac{h}{2}}}^{-1} \mathcal{F}\mathbf{M}_{1}^{-}\widetilde{\omega})\]
dec.spectral.extend(f, n)[source]
\[\begin{split}\mathbf{E}^{n}:\quad \begin{bmatrix}x_{0}\\ \vdots\\ x_{N-1} \end{bmatrix} \mapsto \frac{N+2n}{N} \begin{bmatrix}\left.\begin{array}{c} 0\\ \vdots\\ 0 \end{array}\right\} n\\ \begin{array}{c} x_{0}\\ \vdots\\ x_{N-1} \end{array}\\ \left.\begin{array}{c} 0\\ \vdots\\ 0 \end{array}\right\} n \end{bmatrix}\end{split}\]

(Source code, png, hires.png, pdf)

_images/resample.png
dec.spectral.unextend(f, n)[source]
\[\begin{split}\mathbf{E}^{-n}:\quad\begin{bmatrix}\left.\begin{array}{c} x_{-n}\\ \vdots\\ x_{-1} \end{array}\right\} n\\ \begin{array}{c} x_{0}\\ \vdots\\ x_{N-1} \end{array}\\ \left.\begin{array}{c} x_{N}\\ \vdots\\ x_{N+n-1} \end{array}\right\} n \end{bmatrix}\mapsto\frac{N-2n}{N}\begin{bmatrix}\left.\begin{array}{c} x_{0}+x_{N}\\ \vdots\\ x_{n-1}+x_{N+n-1} \end{array}\right\} n\\ \begin{array}{c} x_{n}\\ \vdots\\ x_{N-n-1} \end{array}\\ \left.\begin{array}{c} x_{N-n}+x_{-n}\\ \vdots\\ x_{N-1}+x_{-1} \end{array}\right\} n \end{bmatrix}\end{split}\]
dec.spectral.mirror0(f, sign=1)[source]
\[\begin{split}\mathbf{M}_{0}^{\pm}:\quad\begin{bmatrix}x_{0}\\ x_{1}\\ \vdots\\ x_{N-2}\\ x_{N-1} \end{bmatrix}\mapsto \begin{bmatrix}x_{0}\\ x_{1}\\ \vdots\\ x_{N-2}\\ x_{N-1}\\ \pm x_{N-2}\\ \vdots\\ \pm x_{1} \end{bmatrix}\end{split}\]
>>> mirror0(array([1, 2, 3]))
array([1, 2, 3, 2])
>>> mirror0(array([1, 2, 3]), -1)
array([ 1,  2,  3, -2])
>>> to_matrix(mirror0, 3)
array([[ 1.,  0.,  0.],
       [ 0.,  1.,  0.],
       [ 0.,  0.,  1.],
       [ 0.,  1.,  0.]])
>>> to_matrix(lambda x: mirror0(x, -1), 3)
array([[ 1.,  0.,  0.],
       [ 0.,  1.,  0.],
       [ 0.,  0.,  1.],
       [-0., -1., -0.]])
dec.spectral.mirror1(f, sign=1)[source]
\[\begin{split}\mathbf{M}_{1}^{\pm}:\quad \begin{bmatrix}x_{0}\\ x_{1}\\ \vdots\\ x_{N-2}\\ x_{N-1} \end{bmatrix}\mapsto \begin{bmatrix}x_{0}\\ x_{1}\\ \vdots\\ x_{N-2}\\ x_{N-1}\\ \pm x_{N-1}\\ \pm x_{N-2}\\ \vdots\\ \pm x_{1}\\ \pm x_{0} \end{bmatrix}\end{split}\]
>>> mirror1(array([1, 2, 3]))
array([1, 2, 3, 3, 2, 1])
>>> mirror1(array([1, 2, 3]), -1)
array([ 1,  2,  3, -3, -2, -1])
>>> to_matrix(mirror1, 2)
array([[ 1.,  0.],
       [ 0.,  1.],
       [ 0.,  1.],
       [ 1.,  0.]])
>>> to_matrix(lambda x: mirror1(x, -1), 2)
array([[ 1.,  0.],
       [ 0.,  1.],
       [-0., -1.],
       [-1., -0.]])
dec.spectral.unmirror0(f)[source]
\[\begin{split}\mathbf{M}_{0}^{\dagger}:\quad\begin{bmatrix}x_{0}\\ x_{1}\\ \vdots\\ x_{N-1}\\ x_{N}\\ \vdots\\ x_{2N-1} \end{bmatrix}\mapsto\begin{bmatrix}x_{0}\\ x_{1}\\ \vdots\\ x_{N-1}\\ x_{N}\\ x_{N+1} \end{bmatrix}\end{split}\]
>>> unmirror0(array([1, 2, 3, 2]))
array([1, 2, 3])
dec.spectral.unmirror1(f)[source]
\[\begin{split}\mathbf{M}_{1}^{\dagger}:\quad\begin{bmatrix}x_{0}\\ x_{1}\\ \vdots\\ x_{N-1}\\ x_{N}\\ \vdots\\ x_{2N-1} \end{bmatrix}\mapsto\begin{bmatrix}x_{0}\\ x_{1}\\ \vdots\\ x_{N-1} \end{bmatrix}\end{split}\]
>>> unmirror1(array([1, 2, 3, -3, -2, -1]))
array([1, 2, 3])
dec.spectral.half_edge_base(N)[source]

This is the discrete version of \(\delta(x)\) - the basis functions for the half edge at -1

\[\mathbf{B}= \text{diag}\left(\underset{N}{\underbrace{ (N-1)^{2},-\frac{1}{2},\frac{1}{2},-\frac{1}{2},\cdots} }\right)\]
\[\mathbf{B}^\dagger= \text{diag}\left(\underset{N}{\underbrace{ \cdots,-\frac{1}{2},\frac{1}{2},-\frac{1}{2},(N-1)^{2}} }\right)\]
>>> half_edge_base(3)
array([ 4.5, -0.5,  0.5])
dec.spectral.pick(f, n)[source]

Pick the nth element in the array f.

\[\begin{split}\mathcal{\mathbf{P}}^{n}:\quad\begin{bmatrix}x_{0}\\ \vdots\\ x_{n-1}\\ x_{n}\\ x_{n+1}\\ \vdots\\ x_{N-1} \end{bmatrix}\mapsto\begin{bmatrix}x_{n}\\ \vdots\\ x_{n}\\ x_{n}\\ x_{n}\\ \vdots\\ x_{n} \end{bmatrix}\end{split}\]
\[\begin{split}\mathcal{\mathbf{P}}^{0}=\begin{pmatrix}1 & 0 & 0 & 0 & 0\\ 1\\ 1\\ 1\\ 1 \end{pmatrix},\quad\mathcal{\mathbf{P}}^{1}=\begin{pmatrix} 0 & 1 & 0 & 0 & 0\\ & 1\\ & 1\\ & 1\\ & 1 \end{pmatrix},\dots\end{split}\]

Table Of Contents

Previous topic

Mapping

Next topic

Poisson Operator

This Page