def max_losses_from_rule(mod, l, tmp):
    """
    **Constraint Name**: TxSimple_Max_Losses_From_Constraint
    **Enforced Over**: TX_SIMPLE_OPR_TMPS

    Losses cannot exceed the maximum transmission flow capacity times the
    loss factor in each operational timepoint. Provides upper bound on losses.
    """
    if mod.tx_simple_loss_factor[l] == 0:
        return mod.TxSimple_Losses_LZ_From_MW[l, tmp] == 0
    else:
        return (
            mod.TxSimple_Losses_LZ_From_MW[l, tmp]
            <= mod.Tx_Max_Capacity_MW[l, mod.period[tmp]]
            * mod.Tx_Availability_Derate[l, tmp]
            * mod.tx_simple_loss_factor[l]
        )