Mathematical functions and numerical integration

escape.core.math.abs(obj)

Returns an absolute value wrapper of parameter or functor ‘obj’

escape.core.math.arg(obj)

Returns an arg of functor ‘obj’

escape.core.math.conj(cplx_functor_obj obj)

Returns a conjugate of functor ‘obj’

escape.core.math.cos(obj)

Returns a cosine wrapper of parameter or functor ‘obj’

escape.core.math.cosh(obj)

Returns a hyperbolic cosine wrapper of parameter or functor ‘obj’

escape.core.math.erf(obj)

Returns an error function wrapper of parameter or functor ‘obj’

escape.core.math.exp(obj)

Returns a exponential wrapper of parameter or functor ‘obj’

escape.core.math.gamma_p(a, z, bool normalized=True)

Method to create lower limit gamma functor or functional parameter.

Parameters
a: parameter_obj or float value

parameter a

z: object - functor, variable or parameter

z - value, can be functor or parameter

normalized - boolean

if True the values returned by the generated instance will always lay between [0, 1]

Returns

instance of functor_obj or parameter_obj depending on ‘z’ type

escape.core.math.gamma_q(a, z, bool normalized=True)

Method to create upper limit gamma functor or functional parameter.

Parameters
a: parameter_obj or float value

parameter a

z: object - functor, variable or parameter

z - value, can be functor or parameter

normalized - boolean

if True the values returned by the generated instance will always lay between [0, 1]

Returns

instance of functor_obj or parameter_obj depending on ‘z’ type

escape.core.math.imag(cplx_functor_obj obj)

Returns an imaginary part of functor ‘obj’

escape.core.math.integral(functor_obj fun, x, a, b, int storage_size=7, epsabs=None, epsrel=None, maxiter=None)

Returns functor which calculates a result of integral of type

\(I=\int_a^b f(x)dx\),

where \(x\) - is a variable or parameter,

The integration limits ‘a’ and ‘b’ are can be parameters.

Parameters
fun: functor_obj with variable or parameter ‘x’

integrated functor

x: variable or independent parameter

integration variable

a: parameter_obj or double value
  • lower integration limit

b: parameter_obj or double value
  • upper integration limit

storage_size - integer

number of points of Gauss-Kronrod quadratures method. Supported values are [7, 15, 21, 31, 51, 61]

epsabs: float value or None

absolute tolerance of integration result, used only for adaptive integration. If set to None, Default value of 1e-5 is used

epsrel: float value or None

relative tolerance of integration result, used only for adaptive integration. If set to None, Default value of 0 is used’

maxiter: positive integer value or None

maximum number of iterations of adaptive integration. If set to None or zero adaptive integration is not used.

Returns

object of type functor_obj (or parameter_obj if initial functor has only one variable)

escape.core.math.linterp(x, xp, yp)

One-dimensional linear interpolation functor.

New in version 0.9.1.

Returns the functor which is the one-dimensional piecewise linear interpolant to a function with given discrete data points (xp, yp), evaluated at values returned by x.

Parameters
x: functor_obj or variable_obj

interpolated functor

xp: numpy array

sorted array of abscissas

yp: numpy array
  • array of interpolated function values

Returns

object of type functor_obj

escape.core.math.log(obj)

Returns a logarithmic wrapper of parameter or functor ‘obj’

escape.core.math.log10(obj)

Returns a logarithmic with base 10 wrapper of parameter or functor ‘obj’

escape.core.math.max(par1, par2)

Returns a maximum function wrapper of parameter or functor ‘obj’

escape.core.math.min(par1, par2)

Returns a minimum function wrapper of parameter or functor objr’

escape.core.math.norm(obj)

Returns a norm of functor ‘obj’

escape.core.math.pow(par1, par2)
escape.core.math.real(cplx_functor_obj obj)

Returns a real part of functor ‘obj’

escape.core.math.sin(obj)

Returns a sine wrapper of parameter or functor ‘obj’

escape.core.math.sinh(obj)

Returns a hyperbolic sine wrapper of parameter or functor ‘obj’

escape.core.math.sqrt(obj)

Returns a square root wrapper of parameter or functor ‘obj’

escape.core.math.tan(obj)

Returns a tangent wrapper of parameter or functor ‘obj’

escape.core.math.tanh(obj)

Returns a hyperbolic tangent wrapper of parameter or functor ‘obj’

escape.core.math.tgamma(z)

Method to create a true gamma functor or functional parameter.

Parameters

z: object - functor, variable or parameter

Returns

instance of functor_obj or parameter_obj depending on ‘obj’ type