In [1]:
import escape as esc
esc.require('0.9.7')
from escape.utils.widgets import show
import numpy as np
Loading material database from /home/dkor/Data/Development/workspace_escape/escape/python/src/escape/scattering/../data/mdb/materials.db
In [2]:
X=esc.var("X")
tg = esc.tgamma(X)
coords=np.linspace(-6, 6, 1000)
show(tg, coordinates=coords, xlabel="X", ylabel="Y", title="True Gamma")
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)
show(gp, coordinates=coords, xlabel="X", ylabel="Y", title="P(X, a)")
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 *normaliazed* argument to False.
coords=np.linspace(0, 6, 1000)
show(gq, coordinates=coords, xlabel="X", ylabel="Y", title="Q(X, a)")
In [ ]: