def losses_lz_to_rule(mod, l, tmp):
    """
    **Constraint Name**: TxSimple_Losses_LZ_To_Constraint
    **Enforced Over**: TX_SIMPLE_OPR_TMPS

    Losses for the 'to' load zone of this transmission line (non-negative
    variable) must be greater than or equal to the flow times the loss
    factor. When the flow on the line is positive, power is flowing to the
    'to' LZ, so losses are positive. When the flow on the line is negative
    (i.e. power flowing from the 'to' load zone), losses can be set to zero.
    If the tx_simple_loss_factor is 0, losses are set to 0.
    WARNING: since we have a greater than or equal constraint here, whenever
    tx_simple_loss_factor is not 0, the model can incur line losses that are
    not actually real.
    """
    if mod.tx_simple_loss_factor[l] == 0:
        return mod.TxSimple_Losses_LZ_To_MW[l, tmp] == 0
    else:
        return (
            mod.TxSimple_Losses_LZ_To_MW[l, tmp]
            >= mod.TxSimple_Transmit_Power_MW[l, tmp] * mod.tx_simple_loss_factor[l]
        )