Spectral method: Difference between revisions

Content deleted Content added
No edit summary
Line 59:
:<math>\partial_{t} u + u \partial_{x} u = \rho \partial_{xx} u + f \quad \forall x\in\left[0,2\pi\right), \forall t>0</math>
where &rho; is the [[viscosity]] coefficient. In weak conservative form this becomes
:<math>\left\langle \partial_{t} u , v \right\rangle = \left\langle \partial_x \left(-\frac{1}{2} u^2 + \rho \partial_{x} u\right) , v \right\rangle + \left\langle f, v \right\rangle \quad \forall v\in \mathcal{V}, \forall t>0</math>
where <math>\langle f, g \rangle := \int_{0}^{2\pi} f(x)
\overline{g(x)}\,dx</math> following [[inner product space|inner product]] notation. [[integration by parts|Integrating by parts]] and using periodicity grants
:<math>\langle \partial_{t} u , v \rangle = \left\langle \frac{1}{2} u^2 - \rho \partial_{x} u , \partial_x v\right\rangle+\left\langle f, v \right\rangle \quad \forall v\in \mathcal{V}, \forall t>0.</math>
 
To apply the Fourier-[[Galerkin method]], choose both
Line 69:
:<math>\mathcal{V}^N :=\text{ span}\left\{ e^{i k x} : k\in -N/2,\dots,N/2-1\right\}</math>
where <math>\hat{u}_k(t):=\frac{1}{2\pi}\langle u(x,t), e^{i k x} \rangle</math>. This reduces the problem to finding <math>u\in\mathcal{U}^N</math> such that
:<math>\langle \partial_{t} u , e^{i k x} \rangle = \left\langle \frac{1}{2} u^2 - \rho \partial_{x} u , \partial_x e^{i k x} \right\rangle + \left\langle f, e^{i k x} \right\rangle \quad \forall k\in \left\{ -N/2,\dots,N/2-1 \right\}, \forall t>0.</math>
 
Using the [[orthogonality]] relation <math>\langle e^{i l x}, e^{i k x} \rangle = 2 \pi \delta_{lk}</math> where <math>\delta_{lk}</math> is the [[Kronecker delta]], we simplify the above three terms for each <math>k</math> to see
:<math>
\begin{align}
\left\langle \partial_{t} u , e^{i k x}\right\rangle &= \left\langle \partial_{t} \sum_{l} \hat{u}_{l} e^{i l x} , e^{i k x} \right\rangle = \left\langle \sum_{l} \partial_{t} \hat{u}_{l} e^{i l x} , e^{i k x} \right\rangle = 2 \pi \partial_t \hat{u}_k,
\\
\left\langle f , e^{i k x} \right\rangle &= \left\langle \sum_{l} \hat{f}_{l} e^{i l x} , e^{i k x}\right\rangle= 2 \pi \hat{f}_k, \text{ and}
\\
\left\langle
\frac{1}{2} u^2 - \rho \partial_{x} u
,
\partial_x e^{i k x}
\right\rangle
&=
\left\langle
\frac{1}{2}
\left(\sum_{p} \hat{u}_p e^{i p x}\right)
Line 91:
,
\partial_x e^{i k x}
\right\rangle
\\
&=
\left\langle
\frac{1}{2}
\sum_{p} \sum_{q} \hat{u}_p \hat{u}_q e^{i \left(p+q\right) x}
,
i k e^{i k x}
\right\rangle
-
\left\langle
\rho i \sum_{l} l \hat{u}_l e^{i l x}
,
i k e^{i k x}
\right\rangle
\\
&=
-\frac{i k}{2}
\left\langle
\sum_{p} \sum_{q} \hat{u}_p \hat{u}_q e^{i \left(p+q\right) x}
,
e^{i k x}
\right\rangle
- \rho k
\left\langle
\sum_{l} l \hat{u}_l e^{i l x}
,
e^{i k x}
\right\rangle
\\
&=