def fun_total_capacity(x, tot_cap):
    """Function defining the equality constraint on total capacity.

    :param x: State vector.
    :param tot_cap: Total capacity.
    :type x: :py:class:`numpy.array`
    :type tot_cap: float

    :returns: Value of left-hand side of constraint.
    :rtype: float
    """
    return tot_cap - x.sum()
