vp.special.plasma_z
The plasma dispersion function Z(zeta) = i sqrt(pi) w(zeta) and its derivative Z'(zeta) = -2 (1 + zeta Z(zeta)), anywhere in the plane.
Part of the distribution vipyr; it runs from a checkout of the
repository. Planned on PyPI as pip install vipyr.
Signature
vp.special.plasma_z(zeta) Parameters
- zeta : complex, required
Returns
A frozen PlasmaZResult. Iterating it gives the fields below in order; it also has
params, tests, log and check().
- Z : complex
- Zp : complex
Raises
- TypeError
- An argument of the wrong type, or an unknown keyword.
- vipyr.VivBuildError
- An ImportError: no C compiler, or the program's C does not build.
Examples
import vipyr as vp
r = vp.special.plasma_z(zeta=1.0 + 0.5j)
print(r.Z, r.Zp)
assert r.check() (-0.6077242989405138+0.6290444616787879j) (-0.15550694044018432-0.650364624417062j)Each example ran as written when these pages were generated, and the output shown is what it printed.
Checked against
- Reference
- Z = 1j*sqrt(pi)*scipy.special.wofz(zeta); Z' = -2*(1 + zeta*Z) from that Z
- Compared by
- relative error |a - b| / |b|, Z and Z' separately
- Domain
- -6 <= Re zeta <= 6, -1 <= Im zeta <= 4: the region lib/zfunc_ref.py measured
- Tolerance
- rel 2 × 10−14, rel_prime 10−12
- Why that tolerance
- w is 10−14 relative on the domain (lib/zfunc_ref.py); Z' = -2(1 + zeta Z) cancels where Z ~ -1/zeta, which multiplies Z's error by up to 2|zeta|^2 = 104 on the domain
Source
- Manifest: kernels/k1/k1.export.toml
- Viv: kernels/k1/special.viv
- Viv: lib/zfunc.viv
- The defs it reaches and the calls between them: map of the code