Faddeeva function: Difference between revisions

Content deleted Content added
Filling in 1 references using Reflinks
m v2.05b - Bot T20 CW#61 - Fix errors for CW project (Reference before punctuation)
 
(12 intermediate revisions by 9 users not shown)
Line 7:
 
The function arises in various physical problems, typically relating to electromagnetic responses in complicated media.
* problems involving small-amplitude waves propagating through [[Maxwell–Boltzmann distribution|Maxwellian]] [[Plasma (physics)|plasmas]], and in particular appears in the plasma's [[permittivity]] from which [[dispersion relation]]s are derived, hence it is sometimes referred to as the '''plasma dispersion function<ref name=lehtinen>{{cite web|url=http://nlpc.stanford.edu/nleht/Science/reference/errorfun.pdf|title=Error functions|last=Lehtinen|first=Nikolai G.|date=April 23, 2010|website=Lehtinen webpage - Stanford University|url-status=live|archive-url=|archive-date=|access-date=October 8, 2019}}</ref>'''<ref name=Zaghloul11/> (although this name is sometimes used instead for the rescaled function {{nowrap|1=''Z''(''z'') = ''i''{{sqrt|{{pi}}}} ''w''(''z'')}} defined by ''Fried and Conte'', 1961<ref name=lehtinen /><ref>[http://farside.ph.utexas.edu/ Richard Fitzpatrick], [http://farside.ph.utexas.edu/teaching/plasma/lectures/node87.html Plasma Dispersion Function], ''[http://farside.ph.utexas.edu/teaching/plasma/plasma.html Plasma Physics]'' lecture notes, University of Texas at Austin (2011/3/31).</ref>).
* the infrared [[permittivity]] functions of amorphous oxides have resonances (due to [[phonon]]s) that are sometimes too complicated to fit using simple harmonic oscillators. The [[Brendel–Bormann oscillator model]] uses an infinite superposition of oscillators having slightly different frequencies, with a Gaussian distribution.<ref name="BrendelBormann1992">{{cite journal|last1=Brendel|first1=R.|last2=Bormann|first2=D.|title=An infrared dielectric function model for amorphous solids|journal=Journal of Applied Physics|volume=71|issue=1|year=1992|page=1|issn=0021-8979|doi=10.1063/1.350737|bibcode=1992JAP....71....1B}}</ref> The integrated response can be written in terms of the Faddeeva function.
* the Faddeeva function is also used in the analysis of electromagnetic waves of the type used in AM radio.{{citation needed|date=July 2016}} Groundwaves are vertically polarised waves propagating over a lossy ground with finite resistivity and permittivity.
Line 29:
 
=== Relation to the complementary error function ===
The Faddeeva function evaluated on imaginary arguments equals the scaled complementary error function (<math>\mathrm{erfcx}</math>):
:<math>w(iz)=\mathrm{erfcx}(z)=e^{z^2}\mathrm{erfc}(z)</math>,
where erfc is the [[complementary error function]]. For large real ''x'':
Line 54:
:<math>\frac{d\Re_{w}}{dx} = 2\cdot\left(y\cdot\Im_{w} - x\cdot\Re_{w}\right) = \frac{d\Im_{w}}{dy}</math>{{spaces|6|type}}and{{spaces|6|type}}<math>\frac{d\Re_{w}}{dy} = -2\cdot\left(\frac{1}{\sqrt{\pi}} - x\cdot\Im_{w} - y\cdot\Re_{w}\right) = -\frac{d\Im_{w}}{dx}</math>
:<math>\frac{d\Im_{w}}{dx} = 2\cdot\left(\frac{1}{\sqrt{\pi}} - x\cdot\Im_{w} - y\cdot\Re_{w}\right) = -\frac{d\Re_{w}}{dy}</math>{{spaces|6|type}}and{{spaces|6|type}}<math>\frac{d\Im_{w}}{dy} = 2\cdot\left(y\cdot\Im_{w} - x\cdot\Re_{w}\right) = \frac{d\Re_{w}}{dx}</math>
A practical example for the use of these partial derivatives can be found [[Voigt profile#derivative profileDerivative_profile|here]].
 
== Integral representation ==
Line 70:
==Implementations==
 
Two software implementations, which are free for non-commercial use only,<ref>{{cite web | url=http://www.acm.org/publications/policies/softwarecrnotice | title=Software Copyright Notice}}; hence they are not ''free'' in the sense of [[free and open-source software]]</ref> were published in [[ACM Transactions on Mathematical Software]] (TOMS) as Algorithm 680 (in [[Fortran]],<ref>http://www.cs.kent.ac.uk/people/staff/trh/CALGO/680.gz {{Dead link|date=February 2022}}</ref> later translated into [[C (programming language)|C]])<ref>{{cite web |url=http://spec.jpl.nasa.gov/ftp/pub/calpgm/collisions/ZWOFZ.C |title=Collision formulas|website=NASA|access-date=10 April 2023}}</ref>) and Algorithm 916 by Zaghloul and Ali (in [[MATLAB]]).<ref>Mofreh R. Zaghloul and Ahmed N. Ali, "[https://dx.doi.org/10.1145/2049673.2049679 Algorithm 916: Computing the Faddeyeva and Voigt Functions]," ''ACM Trans. Math. Soft.'' '''38''' (2), 15 (2011). Preprint available at [https://arxiv.org/abs/1106.0151 arXiv:1106.0151].</ref>
 
A [[free and open source]] C or C++ implementation derived from a combination of Algorithm 680 and Algorithm 916 (using different algorithms for different ''z'') is also available under the [[MIT License]],<ref name=Faddeeva_w>[http://ab-initio.mit.edu/Faddeeva Faddeeva Package], free/open-source C++ implementation, accessed 13 October 2012.</ref> and is maintained as a library package ''libcerf''.<ref>{{cite web | url=https://jugit.fz-juelich.de/mlz/libcerf | title=Libcerf &#91;MLZ Scientific Computing Group&#93;}}</ref>
This implementation is also available as a [[Plug-in (computing)|plug-in]] for Matlab,<ref name=Faddeeva_w/> [[GNU Octave]],<ref name=Faddeeva_w/> and in [[Python (programming language)|Python]] via [[Scipy]] as <code>scipy.special.wofz</code> (which was originally the TOMS 680 code, but was replaced due to copyright concerns<ref>{{cite web | url=https://github.com/scipy/scipy/issues/2260 | title=SciPy's complex erf code is not free/open-source? (Trac #1741) · Issue #2260 · scipy/scipy| website=[[GitHub]]}}</ref>).
 
For fast but still accurate calculation of plasma dispersion function <math>Z(z)</math>, the J-pole Pade approximation is found to be useful,<ref>{{Cite journal |last=Xie |first=Hua-sheng |date=November 2019 |title=BO: A unified tool for plasma waves and instabilities analysis |url=http://dx.doi.org/10.1016/j.cpc.2019.06.014 |journal=Computer Physics Communications |volume=244 |pages=343–371 |doi=10.1016/j.cpc.2019.06.014 |issn=0010-4655|arxiv=1901.06902 }}</ref> i.e.,
:<math>Z(z)=\sum_{j=1}^{J}\frac{b_j}{z-c_j}.</math>
For J=8, one can use
b1= -0.017340112270401 - 0.046306439626294i;
b2= -0.739917811220052 + 0.839518284620274i;
b3= 5.840632105105495 + 0.953602751322040i;
b4= -5.583374181615043 -11.208550459628098i;
c1= 2.237687725134293 - 1.625941024120362i;
c2= 1.465234091939142 - 1.789620299603315i;
c3= 0.839253966367922 - 1.891995211531426i;
c4= 0.273936218055381 - 1.941787037576095i;
b(5:8)=(b(1:4))*;
c(5:8)=-(c(1:4))*,
 
where * denotes complex conjugate. The above approximation is valid for the upper plane. For <math>z</math> weakly close to the real axis, i.e., <math>Im(z)</math> not far from the real axis of the lower plane, the above approximation is also valid. For accurate calculation of
<math>Im(z)<0</math>, one can use
:<math>Z(z)=[Z(z^*)]^*+2i\sqrt{\pi}\exp[-z^2].</math>
 
A coding of the above J-pole approach and comparison with an accurate plasma dispersion function can be found.<ref>{{Citation |last=XIE |first=Hua-sheng |title=hsxie/gpdf |date=2024-04-14 |url=https://github.com/hsxie/gpdf |access-date=2024-04-15}}</ref> Comphensive coefficients to rapid computation of the plasma dispersion function with rational and multi-pole approximation are also available.<ref>{{Cite journal |last=Xie |first=Huasheng |date=2024-07-01 |title=Rapid computation of the plasma dispersion function: Rational and multi-pole approximation, and improved accuracy |url=https://pubs.aip.org/adv/article/14/7/075007/3300717/Rapid-computation-of-the-plasma-dispersion |journal=AIP Advances |language=en |volume=14 |issue=7 |doi=10.1063/5.0216433 |issn=2158-3226|arxiv=2404.18719 }}</ref>
 
==See also==