API Documentation

Distributions

Integration

Solver

Utilities

The MathFct contains some mathematically method, which are not supported by the Python lib.

class utils.math_fcts.CompositionFct(*fcts)[source]

Bases: object

class utils.math_fcts.FctWithCount(fct)[source]

Bases: object

utils.math_fcts.abs_sign(a, b)[source]

The absolute value of A with the sign of B.

utils.math_fcts.float_equal(x, y, tol=1e-13)[source]
utils.math_fcts.get_grid(start, end, nsteps=100)[source]

Generates a equal distanced list of float values with nsteps+1 values, begining start and ending with end.

Parameters:start – the start value of the generated list.

:type float

Parameters:end – the end value of the generated list.

:type float

Parameters:nsteps – optional the number of steps (default=100), i.e. the generated list contains nstep+1 values.

:type int

utils.math_fcts.interpolation_bilinear(x, y, x1, x2, y1, y2, z11, z21, z22, z12)[source]

The points (x_i, y_i) and values z_ij are connected as follows: Starting from lower left going in mathematically positive direction, i.e. counter clockwise. Therefore: (x1,y1,z11), (x2,y1,z21), (x2,y2,z22), (x1,y2,z12).

utils.math_fcts.interpolation_linear(x, x1, x2, y1, y2)[source]

Linear interpolation returns (y2 - y1) / (x2 - x1) * (x - x1) + y1

utils.math_fcts.prod(factors)[source]

The product of the given factors (iterable) :param factors: :return:

utils.math_fcts.sign(x)[source]

Returns the sign of the double number x. -1 if x < 0; 1 if x > 0 and 0 if x == 0

utils.mathconst.DOUBLE_TOL = 1e-13

PI

utils.mathconst.GOLD = 0.61803399

One minus GOLD

utils.mathconst.ONE_MINUS_GOLD = 0.38196601

One over GOLD

utils.mathconst.ONE_OVER_SQRT_OF_TWO_PI = 0.398942280401433

The factor $1/{2Pi}$.

utils.mathconst.ONE_OVER_TWO_PI = 0.15915494309189532

The golden ratio.

utils.mathconst.PI = 3.141592653589793

The factor $sqrt{2}$.

utils.mathconst.SQRT_OF_PI = 1.772453850905516

$sqrt{2*Pi}$.

Type:The factor
utils.mathconst.SQRT_OF_TWO = 1.414213562373095

$sqrt{Pi}$.

Type:The factor
utils.mathconst.SQRT_OF_TWO_PI = 2.506628274631

$1/sqrt{2Pi}$.

Type:The prefactor of the normal density
class utils.surface.Surface(xaxis, yaxis, values)[source]

Bases: object

A matrix with interpolation and extrapolation.

The values has to be a float matrix implementing the method get_item(i, j). @params xaxis: list of float values. @params yaxis: list of float values. @params values: some object implementing a get_item(i, j) method or nested list.

get_value(x, y)[source]