This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

Notebooks · lib/zfunc

The Faddeeva function and the plasma dispersion function

The plasma dispersion function

continued analytically to the whole plane, is what a Maxwellian velocity distribution contributes to the response of a plasma to a wave with phase velocity in thermal units (Fried and Conte, 1961). It is a rescaled Faddeeva function, with , and its derivative is .

zf_w computes by J. A. C. Weideman's rational expansion ("Computation of the complex error function", SIAM J. Numer. Anal. 31, 1497-1518, 1994). With and , which maps the upper half plane onto the unit disc,

and the are Fourier coefficients of under the change of variable . Weideman gets them from one FFT; here they are the same sum written out as cosines, computed once when the module is loaded. With the result agrees with scipy.special.wofz to a relative error of on , (lib/zfunc_ref.py). The expansion is for ; below the axis zf_w uses , which loses relative accuracy as grows, so far below the axis () it is only as good as that cancellation allows.

Used with import zfunc. Names start with zf_ or ZF_.

Look inside this program

  • Atlas

    The program’s map: every function and which calls which.

  • There’s no recorded run of this program yet.

Shift+Enter in a cell runs it and moves to the next. Running a cell runs every cell above it too, as one program.

[1]lines 36–125