def NoxEq(NO, NO2, D):
    """ Returns the NO and NO2 concentrations in photoequilibrium according to
    a given state, concerving N quantity.
    """
    alpha = D * NO2 / NO
    NO2eq = alpha * (NO2 + NO) / (1 + alpha)
    NOeq = NO2 + NO - NO2eq
    return NOeq, NO2eq
