def max_headroom_power_rule(mod, s, tmp):
    """
    **Constraint Name**: Stor_Max_Headroom_Power_Constraint
    **Enforced Over**: STOR_OPR_TMPS

    The project's upward reserves cannot exceed the available headroom.
    Going from charging to non-charging also counts as headroom, doubling the
    the maximum amount of potential headroom.
    """
    return mod.Stor_Upward_Reserves_MW[s, tmp] \
        <= mod.Capacity_MW[s, mod.period[tmp]] \
        * mod.Availability_Derate[s, tmp] \
        - mod.Stor_Discharge_MW[s, tmp] \
        + mod.Stor_Charge_MW[s, tmp]