Suppose we are solving $$ \begin{align*} -\Delta u &= f \\ u &= 0\quad\text{on }\Gamma, \end{align*} $$ in $\Omega = [0,1]^2$ (unit square)
Idea: why not $$ v^{(k,\ell)} := \sin(k \pi x) \sin(\ell \pi x) $$ as basis functions?
It is a good idea: $$ -\Delta v^{(k,\ell)} = \pi^2 (k^2+\ell^2) v^{(k,\ell)} $$ (in other words, $v^{(k,\ell)}$ are eigenvalues of $-\Delta$)
Can use Fast Sine Transform (FST) to obtain the coefficients in $$ u^h = \sum _{k,\ell} c _{k,\ell} v^{(k,\ell)} $$
We then can easily solve:
Find the coefficients $\hat{f} _{k,\ell}$ in $$ f = \sum _{k,\ell} \hat{f} _{k,\ell} v^{(k,\ell)} $$ (i.e., apply the FST)
Find the coefficients of the solution $$ {\pi^2(k^2+\ell^2)} \hat{u}^h _{k,\ell} = \hat{f} _{k,\ell} $$
To think: Did we discretize the domain?
Smoothness in x <-> fast decay in the Fourier domain
Smooth in Fourier domain <-> decays fast in x
in $\Omega = [0,1]^2$ (unit square)
If we assume the same spatial discretization, then $$ u _h(t,x,y) = \sum _{k,\ell} e^{-(k^2+\ell^2) t} \hat{u}^0 _{k,\ell} v^{(k,\ell)} $$
The algorithm is then:
Suppose we need to compute $$ {\rm div}(K \nabla u) $$ with (for a change) periodic boundary conditions (so FFT can be applied) in a unit square.
The algorithm is then:
Nonlinear problems can be treated in a similar way
In [1]:
from IPython.core.display import HTML
def css_styling():
styles = open("./styles/alex.css", "r").read()
return HTML(styles)
css_styling()
Out[1]:
In [ ]: