exojax.special package
Submodules
exojax.special.erfcx module
- exojax.special.erfcx.erfcx(float) based on Shepherd and Laframboise (1981)
Scaled complementary error function exp(-x*x) erfc(x)
Args: x: should be larger than -9.3
- Returns:
erfcx(x)
- Return type:
jnp.array
Note
We acknowledge the post in stack overflow (https://stackoverflow.com/questions/39777360/accurate-computation-of-scaled-complementary-error-function-erfcx).
exojax.special.expn module
- exojax.special.expn.E1(x)
Abramowitz Stegun (1970) approximation of the exponential integral of the first order, E1.
- Parameters:
x – input
- Returns:
The exponential integral of the first order, E1(x)
exojax.special.faddeeva module
Faddeeva (wofz= w of z) functions (real and imag parts), an asymptotic form of wofz.
Note
We adopt ncut=27 as the summation of n in Algorithm 916. For Sigma1, we use ncut=8 because higher order than 9 does not affect the results.
- exojax.special.faddeeva.asymptotic_wofz(x, y)
Asymptotic representation of wofz (Faddeeva) function 1 for |z|**2 > 112 (for e = 10e-6)
See Zaghloul (2018) arxiv:1806.01656
- Parameters:
x – real x
y – real y
- Returns:
wofz(x+iy)
- Return type:
jnp.array (complex)
- exojax.special.faddeeva.faddeeva_sigma1(exx, y2)
- exojax.special.faddeeva.h_bwd(res, g)
backward.
Note
V=Real(wofz), L=Imag(wofz)
- Parameters:
res – res from h_fwd
g – g
- Returns:
g* partial_x h(x,y), g* partial_y h(x,y)
- Return type:
jnp.array, jnp.array
- exojax.special.faddeeva.h_fwd(x, y)
- exojax.special.faddeeva.imwofz(x, y)
Imaginary part of wofz (Faddeeva) function based on Algorithm 916.
We apply a=0.5 for Algorithm 916.
- Parameters:
x – x < ncut/2
y –
- Returns:
Imag(wofz(x+iy))
- Return type:
jnp.array
- exojax.special.faddeeva.rewofz(x, y)
Real part of wofz (Faddeeva) function based on Algorithm 916.
We apply a=0.5 for Algorithm 916.
- Parameters:
x – x < ncut/2
y –
- Returns:
Real(wofz(x+iy))
- Return type:
jnp.array
exojax.special.j0 module
- exojax.special.j0.j0(x)
Bessel function of the 1st kind, order=0.
- Parameters:
x – x
- Returns:
J0
exojax.special.lognormal module
lognormal distribution relationals
- exojax.special.lognormal.cubeweighted_mean(rg, sigmag)
mean of the cube weighted lognormal distribution
- Parameters:
rg (float)) – rg parameter
sigmag (float) – sigmag parameter must be > 1.
- Returns:
mean of the cube weighted lognormal distribution
- Return type:
float
- exojax.special.lognormal.cubeweighted_pdf(r, rg, sigmag)
cube weighted lognormal distribution
- Parameters:
r (float, array) – variable
rg (float)) – rg parameter
sigmag (float) – sigmag parameter must be > 1.
Note
The cube-weighted lognormal distribution is proporitnal to x**3 p(x), where p(x) is the lognormal distribution. The normalization is given by 1/<x**3>, where <x**N> is the N-th moment of the lognormal distribution.
- Returns:
cube-weighted lognormal PDF
- Return type:
float, array
- exojax.special.lognormal.cubeweighted_std(rg, sigmag)
variance of the cube weighted lognormal distribution
- Parameters:
rg (float)) – rg parameter
sigmag (float) – sigmag parameter must be > 1.
- Returns:
variance of the cube weighted lognormal distribution
- Return type:
float
- exojax.special.lognormal.moment(rg, sigmag, k)
k-th order moment of the lognormal distribution <r^k>
- Parameters:
rg (float)) – rg parameter
sigmag (float) – sigmag parameter must be > 1.
k (int) – the order of the moment
- Returns:
k-th order moment
- Return type:
float
- exojax.special.lognormal.pdf(r, rg, sigmag)
probability density function (PDF) of lognormal distribution
- Parameters:
r (float, array) – variable
rg (float)) – rg parameter
sigmag (float) – sigmag parameter must be > 1.
- Returns:
lognormal PDF
- Return type:
float, array