def max_headroom_energy_rule(mod, s, tmp):
    """
    **Constraint Name**: Stor_Max_Headroom_Energy_Constraint
    **Enforced Over**: STOR_OPR_TMPS

    Can't provide more reserves (times sustained duration required) than
    available energy in storage in that timepoint. Said differently,
    must have enough energy available to be at the new set point (for
    the full duration of the timepoint).
    """
    return mod.Stor_Upward_Reserves_MW[s, tmp] \
        * mod.hrs_in_tmp[tmp] \
        / mod.stor_discharging_efficiency[s] \
        <= mod.Stor_Starting_Energy_in_Storage_MWh[s, tmp] \
        + mod.Stor_Charge_MW[s, tmp] \
        * mod.hrs_in_tmp[tmp] \
        * mod.stor_charging_efficiency[s] \
        - mod.Stor_Discharge_MW[s, tmp] \
        * mod.hrs_in_tmp[tmp] \
        / mod.stor_discharging_efficiency[s]