def multi_cdf(m, bound, capacity, f):
    """
    This function computes the value of the cdf of the multivariate random
    variable (X1+X2+...Xn). For a given distribution it gives back the
    probability, if the sum of the random variables is lower or equal to a
    specific bound. Therefore it uses the feasible_mesh, so it includes
    the capacity for each dimension for computation.

    Args:
        m (mesh): The initial mesh.
        bound (float): The bound for the sum of the random variables.
        capacity (float): The capacity of the power generation for each hour
            of interest.
        f (pdf): The distribution of the random variable (X1+...+Xn), which
           has to be a pdf.
    Returns:
        integral (float): The probability, if the sum of the random variable
            (X1+...+Xn) is lower or equal than the bound.
    """
    integral=0
    fsbmesh = m.feasible_mesh(bound, capacity)
    integral += fsbmesh.integrate_with(f)
    return integral