Example #1
0
File: utils.py Project: cisert/a2md
def integrate_from_dict(fun_dict):
    """
    integrate from dict
    ---
    this function allows to integrate a function without having to declare it as a support function,
    directly from the ppp.

    Important: it does not multiply by the coefficient!!

    :param fun_dict: contains all the function parameters
    :return: float
    """
    try:
        a = fun_dict['params']['A']
        b = fun_dict['params']['B']
    except KeyError:
        raise IOError("could not find the parameters of the radial part")
    try:
        p = fun_dict['params']['P']
    except KeyError:
        if fun_dict['bond'] is None:
            p = 0
        else:
            p = 1
    if fun_dict['bond'] is None:
        return 4 * np.pi * mathfunctions.generalized_exponential_integral(a, b, p)
    else:
        alpha = fun_dict['params']['alpha']
        return 2 * np.pi * mathfunctions.generalized_exponential_integral(
            a, b, p) * mathfunctions.angular_gaussian_integral(alpha)
Example #2
0
File: utils.py Project: cisert/a2md
def integrate_from_old_dict(fun):
    """

    :return:
    """
    if fun['support_type'] in ['ORCV', 'OR', 'ORV', 'ORC']:
        a = fun['params']['A3']
        b = fun['params']['B3']
        return mathfunctions.generalized_exponential_integral(a, b, 0) * 4 * math.pi
    elif fun['support_type'] == 'AG':
        g = fun['params']['G']
        u = fun['params']['U']
        alpha = fun['params']['Alpha']
        v = mathfunctions.angular_gaussian_integral(alpha)
        v *= mathfunctions.generalized_exponential_integral(u, g, P=1)
        v *= 2 * math.pi
        return v
Example #3
0
 def __integral_outer(self):
     return generalized_exponential_integral(self.__A, self.__B) * 4 * np.pi
Example #4
0
 def __integral_trigo(self):
     return generalized_exponential_integral(
         self.__A, self.__B, self.__P
     ) * angular_gaussian_integral(self.__alpha) * 2 * np.pi
Example #5
0
 def __integrate(self):
     return generalized_exponential_integral(
         A=self.__A, B=self.__B, P=self.__P
     ) * 4 * np.pi