In [1]:
import escape as esc

esc.require("0.9.8")
import numpy as np
Loading material database from /home/dkor/Data/Development/workspace_escape/escape-core/python/src/escape/scattering/../data/mdb/materials.db

Gamma Functors¶

True gamma¶

The true gamma is defined as $\Gamma(z)=\int_0^\infty t^{z-1}\exp(-t)dt$ When calculated out of allowed domains the NaN values are returned.

In [2]:
X = esc.var("X")
tg = esc.tgamma(X)
coords = np.linspace(-6, 6, 1000)
tg.show(coordinates=coords).config(xlabel="X", ylabel="Y", title="True Gamma")
Out[2]:

Incomplete gamma functions¶

There are four incomplete gamma functions: two are known as regularized incomplete gamma functions, i.e. normalized, that return values in the range $[0, 1]$, and other two are non-normalised and return values in the range $[0, \Gamma(a)]$.

The first type is defined as following:

$P(z, a)=\frac{1}{\Gamma(a)}\int_0^z t^{a-1}\exp(-t)dt$

In [3]:
a = esc.par("a", 1)
gp = esc.gamma_p(a, X, normalized=True)
# if you don't need normalization, set the *normaliazed* argument to False.
coords = np.linspace(0, 6, 1000)
gp.show(coordinates=coords).config(xlabel="X", ylabel="Y", title="P(X, a)")
Out[3]:

The second type is defined as following:

$Q(z, a)=\frac{1}{\Gamma(a)}\int_z^\infty t^{a-1}\exp(-t)dt$

In [4]:
gq = esc.gamma_q(a, X, normalized=True)
# if you don't need normalization, set the *normalized* argument to False.
coords = np.linspace(0, 6, 1000)
gq.show(coordinates=coords).config(xlabel="X", ylabel="Y", title="Q(X, a)")
Out[4]:
In [ ]:
 
In [ ]:
 
In [ ]: