Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Spectral method
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Examples of spectral methods== ===A concrete, linear example=== Here we presume an understanding of basic multivariate [[calculus]] and [[Fourier series]]. If <math>g(x,y)</math> is a known, complex-valued function of two real variables, and g is periodic in x and y (that is, <math>g(x,y)=g(x+2\pi,y)=g(x,y+2\pi)</math>) then we are interested in finding a function ''f''(''x'',''y'') so that :<math>\left(\frac{\partial^2}{\partial x^2}+\frac{\partial^2}{\partial y^2}\right)f(x,y)=g(x,y)\quad \text{for all } x,y</math> <!--math>f_{xx}(x,y)+f_{yy}(x,y)=g(x,y)\quad \text{for all} x,y</math--> where the expression on the left denotes the second partial derivatives of ''f'' in ''x'' and ''y'', respectively. This is the [[Poisson equation]], and can be physically interpreted as some sort of heat conduction problem, or a problem in potential theory, among other possibilities. If we write ''f'' and ''g'' in Fourier series: :<math>\begin{align} f&=:\sum a_{j,k}e^{i(jx+ky)}, \\[5mu] g&=:\sum b_{j,k}e^{i(jx+ky)}, \end{align}</math> and substitute into the differential equation, we obtain this equation: :<math>\sum -a_{j,k}(j^2+k^2)e^{i(jx+ky)}=\sum b_{j,k}e^{i(jx+ky)}.</math> We have exchanged partial differentiation with an infinite sum, which is legitimate if we assume for instance that ''f'' has a continuous second derivative. By the uniqueness theorem for Fourier expansions, we must then equate the Fourier coefficients term by term, giving {{NumBlk|:| <math>a_{j,k}=-\frac{b_{j,k}}{j^2+k^2}</math>|{{EquationRef|<nowiki>*</nowiki>}}}} which is an explicit formula for the Fourier coefficients ''a''<sub>''j'',''k''</sub>. With periodic boundary conditions, the [[Poisson equation]] possesses a solution only if ''b''<sub>0,0</sub> = 0. Therefore, we can freely choose ''a''<sub>0,0</sub> which will be equal to the mean of the resolution. This corresponds to choosing the integration constant. To turn this into an algorithm, only finitely many frequencies are solved for. This introduces an error which can be shown to be proportional to <math>h^n</math>, where <math>h := 1/n</math> and <math>n</math> is the highest frequency treated. ==== Algorithm ==== # Compute the Fourier transform (''b<sub>j,k</sub>'') of ''g''. # Compute the Fourier transform (''a<sub>j,k</sub>'') of ''f'' via the formula ({{EquationNote|*}}). # Compute ''f'' by taking an inverse Fourier transform of (''a<sub>j,k</sub>''). Since we're only interested in a finite window of frequencies (of size ''n'', say) this can be done using a [[fast Fourier transform]] algorithm. Therefore, globally the algorithm runs in {{nowrap|time ''O''(''n'' log ''n'').}} ===Nonlinear example=== We wish to solve the forced, transient, nonlinear [[Burgers' equation]] using a spectral approach. Given <math>u(x,0)</math> on the periodic domain <math>x\in\left[0,2\pi\right)</math>, find <math>u \in \mathcal{U}</math> such that :<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 ρ is the [[viscosity]] coefficient. In weak conservative form this becomes :<math>\left\langle \partial_{t} u , v \right\rangle = \Bigl\langle \partial_x \left(-\tfrac12 u^2 + \rho \partial_{x} u\right) , v \Bigr\rangle + \left\langle f, v \right\rangle \quad \forall v\in \mathcal{V}, \forall t>0</math> where 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 \tfrac12 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 :<math>\mathcal{U}^N := \biggl\{ u : u(x,t)=\sum_{k=-N/2}^{N/2-1} \hat{u}_{k}(t) e^{i k x}\biggr\}</math> and :<math>\mathcal{V}^N :=\operatorname{span}\left\{ e^{i k x} : k\in -\tfrac12 N,\dots,\tfrac12N - 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 \tfrac12 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\{ -\tfrac12N,\dots,\tfrac12N-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 &= \biggl\langle \partial_{t} \sum_{l} \hat{u}_{l} e^{i l x} , e^{i k x} \biggr\rangle = \biggl\langle \sum_{l} \partial_{t} \hat{u}_{l} e^{i l x} , e^{i k x} \biggr\rangle = 2 \pi \partial_t \hat{u}_k, \\ \left\langle f , e^{i k x} \right\rangle &= \biggl\langle \sum_{l} \hat{f}_{l} e^{i l x} , e^{i k x}\biggr\rangle= 2 \pi \hat{f}_k, \text{ and} \\ \left\langle \tfrac12 u^2 - \rho \partial_{x} u , \partial_x e^{i k x} \right\rangle &= \biggl\langle \tfrac12 \Bigl(\sum_{p} \hat{u}_p e^{i p x}\Bigr) \Bigl(\sum_{q} \hat{u}_q e^{i q x}\Bigr) - \rho \partial_x \sum_{l} \hat{u}_l e^{i l x} , \partial_x e^{i k x} \biggr\rangle \\ &= \biggl\langle \tfrac12 \sum_{p} \sum_{q} \hat{u}_p \hat{u}_q e^{i \left(p+q\right) x} , i k e^{i k x} \biggr\rangle - \biggl\langle \rho i \sum_{l} l \hat{u}_l e^{i l x} , i k e^{i k x} \biggr\rangle \\ &= -\tfrac12 i k \biggl\langle \sum_{p} \sum_{q} \hat{u}_p \hat{u}_q e^{i \left(p+q\right) x} , e^{i k x} \biggr\rangle - \rho k \biggl\langle \sum_{l} l \hat{u}_l e^{i l x} , e^{i k x} \biggr\rangle \\ &= - i \pi k \sum_{p+q=k} \hat{u}_p \hat{u}_q - 2\pi\rho{}k^2\hat{u}_k. \end{align} </math> Assemble the three terms for each <math>k</math> to obtain :<math> 2 \pi \partial_t \hat{u}_k = - i \pi k \sum_{p+q=k} \hat{u}_p \hat{u}_q - 2\pi\rho{}k^2\hat{u}_k + 2 \pi \hat{f}_k \quad k\in\left\{ -\tfrac12N,\dots,\tfrac12N-1 \right\}, \forall t>0. </math> Dividing through by <math>2\pi</math>, we finally arrive at :<math> \partial_t \hat{u}_k = - \frac{i k}{2} \sum_{p+q=k} \hat{u}_p \hat{u}_q - \rho{}k^2\hat{u}_k + \hat{f}_k \quad k\in\left\{ -\tfrac12N,\dots,\tfrac12N-1 \right\}, \forall t>0. </math> With Fourier transformed initial conditions <math>\hat{u}_{k}(0)</math> and forcing <math>\hat{f}_{k}(t)</math>, this coupled system of ordinary differential equations may be integrated in time (using, e.g., a [[Runge Kutta]] technique) to find a solution. The nonlinear term is a [[convolution]], and there are several transform-based techniques for evaluating it efficiently. See the references by Boyd and Canuto et al. for more details.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)