def annuity_per_period(capex, n, wacc, t, p):
    """ Calculate per given period

    Parameters
    ----------
    capex : float
        Capital expenditure (NPV of investment)
    n : int
        Number of years that the investment is used (economic lifetime)
    wacc : float
        Weighted average cost of capital
    t : int
        Timesteps in hours
    p : float
        interest rate

    """
    return capex * (wacc * (1 + wacc) ** n) / ((1 + wacc) ** n - 1)
