def max_power_rule(mod, g, tmp):
    """
    **Constraint Name**: GenAlwaysOn_Max_Power_Constraint
    **Enforced Over**: GEN_ALWAYS_ON_OPR_TMPS

    Power plus upward services cannot exceed capacity.
    """
    return (
        mod.GenAlwaysOn_Gross_Power_MW[g, tmp]
        + mod.GenAlwaysOn_Upwards_Reserves_MW[g, tmp]
        <= mod.Capacity_MW[g, mod.period[tmp]] * mod.Availability_Derate[g, tmp]
    )