Main Page: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
No edit summary
No edit summary
 
(493 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
{{Refimprove|date=December 2009}}
This is a preview for the new '''MathML rendering mode''' (with SVG fallback), which is availble in production for registered users.
[[Image:Pseudo-spectral.PNG|thumb|80px|right|Gaussian wavepacket scattering off square well — simulation using pseudo-spectral method]]


'''Pseudo-spectral methods''' <ref>{{cite journal|last=Orszag|first=Steven A.|authorlink=Steven A. Orszag|year=1972|title=Comparison of Pseudospectral and Spectral Approximation|journal=Studies in Applied Mathematics|volume=51|issue=1972|pages=253–259}}</ref>  are a class of [[numerical methods]] used in [[applied mathematics]] and [[scientific computing]] for the solution of [[Partial differential equation|PDEs]], such as the direct simulation of a particle with an arbitrary [[wavefunction]] interacting with an arbitrary [[Potential energy|potential]]. They are related to [[spectral method]]s and are used extensively in computational fluid dynamics and other areas, but are demonstrated below on an example from [[quantum physics]].
If you would like use the '''MathML''' rendering mode, you need a wikipedia user account that can be registered here [[https://en.wikipedia.org/wiki/Special:UserLogin/signup]]
* Only registered users will be able to execute this rendering mode.
* Note: you need not enter a email address (nor any other private information). Please do not use a password that you use elsewhere.


==Background==
Registered users will be able to choose between the following three rendering modes:
The Schrödinger wave equation,


: <math>H \psi(\mathbf{r},t) = i \hbar \frac{\partial}{\partial t} \psi(\mathbf{r},t) </math>
'''MathML'''
:<math forcemathmode="mathml">E=mc^2</math>


can be written
<!--'''PNG'''  (currently default in production)
:<math forcemathmode="png">E=mc^2</math>


: <math>\frac{H}{i \hbar} \psi(\mathbf{r},t) = \frac{\partial}{\partial t} \psi(\mathbf{r},t) </math>
'''source'''
:<math forcemathmode="source">E=mc^2</math> -->


which resembles the [[linear]] [[ordinary differential equation]]
<span style="color: red">Follow this [https://en.wikipedia.org/wiki/Special:Preferences#mw-prefsection-rendering link] to change your Math rendering settings.</span> You can also add a [https://en.wikipedia.org/wiki/Special:Preferences#mw-prefsection-rendering-skin Custom CSS] to force the MathML/SVG rendering or select different font families. See [https://www.mediawiki.org/wiki/Extension:Math#CSS_for_the_MathML_with_SVG_fallback_mode these examples].


: <math>r f(t) = \frac{d}{dt} f(t) </math>
==Demos==


with solution
Here are some [https://commons.wikimedia.org/w/index.php?title=Special:ListFiles/Frederic.wang demos]:


: <math>f(t) = A e^{r t} \,\!</math>


In fact, using the theory of [[linear operator]]s, it can be shown that the general solution to the Schrödinger wave equation is
* accessibility:
** Safari + VoiceOver: [https://commons.wikimedia.org/wiki/File:VoiceOver-Mac-Safari.ogv video only], [[File:Voiceover-mathml-example-1.wav|thumb|Voiceover-mathml-example-1]], [[File:Voiceover-mathml-example-2.wav|thumb|Voiceover-mathml-example-2]], [[File:Voiceover-mathml-example-3.wav|thumb|Voiceover-mathml-example-3]], [[File:Voiceover-mathml-example-4.wav|thumb|Voiceover-mathml-example-4]], [[File:Voiceover-mathml-example-5.wav|thumb|Voiceover-mathml-example-5]], [[File:Voiceover-mathml-example-6.wav|thumb|Voiceover-mathml-example-6]], [[File:Voiceover-mathml-example-7.wav|thumb|Voiceover-mathml-example-7]]
** [https://commons.wikimedia.org/wiki/File:MathPlayer-Audio-Windows7-InternetExplorer.ogg Internet Explorer + MathPlayer (audio)]
** [https://commons.wikimedia.org/wiki/File:MathPlayer-SynchronizedHighlighting-WIndows7-InternetExplorer.png Internet Explorer + MathPlayer (synchronized highlighting)]
** [https://commons.wikimedia.org/wiki/File:MathPlayer-Braille-Windows7-InternetExplorer.png Internet Explorer + MathPlayer (braille)]
** NVDA+MathPlayer: [[File:Nvda-mathml-example-1.wav|thumb|Nvda-mathml-example-1]], [[File:Nvda-mathml-example-2.wav|thumb|Nvda-mathml-example-2]], [[File:Nvda-mathml-example-3.wav|thumb|Nvda-mathml-example-3]], [[File:Nvda-mathml-example-4.wav|thumb|Nvda-mathml-example-4]], [[File:Nvda-mathml-example-5.wav|thumb|Nvda-mathml-example-5]], [[File:Nvda-mathml-example-6.wav|thumb|Nvda-mathml-example-6]], [[File:Nvda-mathml-example-7.wav|thumb|Nvda-mathml-example-7]].
** Orca: There is ongoing work, but no support at all at the moment [[File:Orca-mathml-example-1.wav|thumb|Orca-mathml-example-1]], [[File:Orca-mathml-example-2.wav|thumb|Orca-mathml-example-2]], [[File:Orca-mathml-example-3.wav|thumb|Orca-mathml-example-3]], [[File:Orca-mathml-example-4.wav|thumb|Orca-mathml-example-4]], [[File:Orca-mathml-example-5.wav|thumb|Orca-mathml-example-5]], [[File:Orca-mathml-example-6.wav|thumb|Orca-mathml-example-6]], [[File:Orca-mathml-example-7.wav|thumb|Orca-mathml-example-7]].
** From our testing, ChromeVox and JAWS are not able to read the formulas generated by the MathML mode.


: <math> \psi(\mathbf{r},t) = e^{-i H t / \hbar} \psi(\mathbf{r},0) </math>
==Test pages ==


where exponentiation of operators is defined using [[power series]].  Now remember that
To test the '''MathML''', '''PNG''', and '''source''' rendering modes, please go to one of the following test pages:
*[[Displaystyle]]
*[[MathAxisAlignment]]
*[[Styling]]
*[[Linebreaking]]
*[[Unique Ids]]
*[[Help:Formula]]


: <math>H = T + V \,\!</math>
*[[Inputtypes|Inputtypes (private Wikis only)]]
 
*[[Url2Image|Url2Image (private Wikis only)]]
where the kinetic energy
==Bug reporting==
<math>T</math>
If you find any bugs, please report them at [https://bugzilla.wikimedia.org/enter_bug.cgi?product=MediaWiki%20extensions&component=Math&version=master&short_desc=Math-preview%20rendering%20problem Bugzilla], or write an email to math_bugs (at) ckurs (dot) de .
is given by
 
: <math> T = \frac{p^2}{2 m} = - \frac{\hbar^2}{2m} {\nabla}^2 </math>
 
and the potential energy <math>V</math> often depends only on position
(i.e., <math>V=V(\mathbf{r})</math>
).  We can write
 
: <math> \psi(\mathbf{r},t) = e^{-i (T + V(\mathbf{r})) t / \hbar} \psi(\mathbf{r},0). </math>
 
It is tempting to write
 
: <math> \psi(\mathbf{r},t) = e^{-i T t / \hbar} e^{-i V(\mathbf{r}) t / \hbar}\psi(\mathbf{r},0) </math>
 
so that we may treat each factor separately.  However, this is only true if the operators <math>T</math> and <math>V(\mathbf{r})</math> [[Commutative property|commute]], which is not true in general.  Luckily, it turns out that
 
: <math> \psi(\mathbf{r},t) \approx e^{-i V(\mathbf{r}) t / 2 \hbar} e^{-i T t / \hbar} e^{-i V(\mathbf{r}) t / 2 \hbar}\psi(\mathbf{r},0) </math>
 
is a good approximation for small values of <math>t</math>.  This is known as the symmetric decomposition.  The heart of the pseudo-spectral method is using this approximation iteratively to calculate the wavefunction <math>\psi(\mathbf{r},t) </math> for arbitrary values of <math>t</math>.
 
==The method==
For simplicity, we will consider the one-dimensional case.  The method is readily extended to multiple dimensions.
 
Given <math>\psi(x,t) </math>, we wish to find <math>\psi(x,t + \Delta t) </math> where <math>\Delta t</math> is small.  The first step is to calculate an intermediate value <math>\phi_{1}(x)</math> by applying the rightmost operator in the symmetric decomposition,
 
: <math> \phi_{1}(x) = e^{-i V(\mathbf{r}) \Delta t / 2 \hbar}\psi(x,t) </math>
 
This requires only a pointwise multiplication.  The next step is to apply the middle operator,
 
: <math> \phi_{2}(x) = e^{-i T \Delta t / \hbar} \phi_{1}(x) </math>
 
This is an infeasible calculation to make in [[configuration space]].  Fortunately, in [[momentum space]], the calculation is greatly simplified.  If <math> \Phi_{1}(k)</math> is the momentum space representation of <math>\phi_{1}(x)</math>, then
 
: <math> \Phi_{2}(k) = e^{i \hbar k^{2} \Delta t / 2 m} \Phi_{1}(k) </math>
 
which also requires only a pointwise multiplication.  Numerically, <math>\Phi_{1}(k)</math> is obtained from <math> \phi_{1}(x) </math> using the [[Fast Fourier transform]] (FFT) and <math> \phi_{2}(x) </math> is obtained from <math> \Phi_{2}(k) </math> using the inverse FFT.
 
The final calculation is
 
: <math>\psi(x,t + \Delta t) = e^{-i V(\mathbf{r}) \Delta t / 2 \hbar}\phi_{2}(x) </math>
 
This sequence can be summarized as
 
: <math>\psi(x,t + \Delta t) = e^{-i V(\mathbf{r}) \Delta t / 2 \hbar} \mathcal{F}^{-1} [e^{i \hbar k^{2} \Delta t / 2 m} \mathcal{F} [e^{-i V(\mathbf{r}) \Delta t / 2 \hbar}\psi(x,t)] ] </math>
 
==Analysis of algorithm==
If the wavefunction is approximated by its value at <math>n</math> distinct points, each iteration requires 3 pointwise multiplications, one FFT, and one inverse FFT.  The pointwise multiplications each require <math>O(n)</math> effort, and the FFT and inverse FFT each require <math>O(n \lg n)</math> effort. The total computational effort is therefore determined largely by the FFT steps, so it is imperative to use an efficient (and accurate) implementation of the FFT. Fortunately, many are freely available.
 
==Error analysis==
{{Expand section|date=June 2008}}
The error in the pseudo-spectral method is overwhelmingly due to [[discretization error]].
 
==References==
{{Reflist}}
* Steven A. Orszag (1969) ''Numerical Methods for the Simulation of Turbulence'', Phys. Fluids Supp. II, 12, 250-257
* D. Gottlieb and S. Orzag (1977) "Numerical Analysis of Spectral Methods : Theory and Applications", SIAM, Philadelphia, PA
* J. Hesthaven, S. Gottlieb and D. Gottlieb (2007) "Spectral methods for time-dependent problems", Cambridge UP, Cambridge, UK
* Lloyd N. Trefethen (2000) ''Spectral Methods in MATLAB.'' SIAM, Philadelphia, PA
* Bengt Fornberg (1996) ''A Practical Guide to Pseudospectral Methods.'' Cambridge University Press, Cambridge, UK
* [http://www-personal.umich.edu/~jpboyd/BOOK_Spectral2000.html Chebyshev and Fourier Spectral Methods] by John P. Boyd.
* [http://cdm.unimo.it/home/matematica/funaro.daniele/bube.htm Polynomial Approximation of Differential Equations], by Daniele Funaro, Lecture Notes in Physics, Volume 8, Springer-Verlag, Heidelberg 1992
* Javier de Frutos, Julia Novo: [http://epubs.siam.org/sam-bin/dbq/article/35198 A Spectral Element Method for the Navier--Stokes Equations with Improved Accuracy]
* Canuto C., [[M. Yousuff Hussaini|Hussaini M. Y.]], Quarteroni A., and Zang T.A. (2006) ''Spectral Methods. Fundamentals in Single Domains.'' Springer-Verlag, Berlin Heidelberg
*{{Cite book | last1=Press | first1=WH | last2=Teukolsky | first2=SA | last3=Vetterling | first3=WT | last4=Flannery | first4=BP | year=2007 | title=Numerical Recipes: The Art of Scientific Computing | edition=3rd | publisher=Cambridge University Press |  publication-place=New York | isbn=978-0-521-88068-8 | chapter=Section 20.7. Spectral Methods | chapter-url=http://apps.nrbook.com/empanel/index.html#pg=1083}}
{{DEFAULTSORT:Pseudo-Spectral Method}}
[[Category:Numerical analysis]]

Latest revision as of 23:52, 15 September 2019

This is a preview for the new MathML rendering mode (with SVG fallback), which is availble in production for registered users.

If you would like use the MathML rendering mode, you need a wikipedia user account that can be registered here [[1]]

  • Only registered users will be able to execute this rendering mode.
  • Note: you need not enter a email address (nor any other private information). Please do not use a password that you use elsewhere.

Registered users will be able to choose between the following three rendering modes:

MathML


Follow this link to change your Math rendering settings. You can also add a Custom CSS to force the MathML/SVG rendering or select different font families. See these examples.

Demos

Here are some demos:


Test pages

To test the MathML, PNG, and source rendering modes, please go to one of the following test pages:

Bug reporting

If you find any bugs, please report them at Bugzilla, or write an email to math_bugs (at) ckurs (dot) de .