def CMFR(t, C_initial, C_influent):
    """Calculate the effluent concentration of a conversative (non-reacting)
    material with continuous input to a completely mixed flow reactor.

    Note: time t=0 is the time at which the material starts to flow into the
    reactor.

    :param C_initial: The concentration in the CMFR at time t=0.
    :type C_initial: float
    :param C_influent: The concentration entering the CMFR.
    :type C_influent: float
    :param t: The time(s) at which to calculate the effluent concentration. Time can be made dimensionless by dividing by the residence time of the CMFR.
    :type t: float or numpy.array

    :return: Effluent concentration
    :rtype: float

    :Examples:

    >>> from aguaclara.research.environmental_processes_analysis import CMFR
    >>> from aguaclara.core.units import unit_registry as u
    >>> round(CMFR(0.1, 0*u.mg/u.L, 10*u.mg/u.L), 7)
    <Quantity(0.9516258, 'milligram / liter')>
    >>> round(CMFR(0.9, 5*u.mg/u.L, 10*u.mg/u.L), 7)
    <Quantity(7.9671517, 'milligram / liter')>
    """
    return C_influent * (1-np.exp(-t)) + C_initial*np.exp(-t)
Calculate the effluent concentration of a conversative (non-reacting)
    material with continuous input to a completely mixed flow reactor.

    Note: time t=0 is the time at which the material starts to flow into the
    reactor.

    :param C_initial: The concentration in the CMFR at time t=0.
    :type C_initial: float
    :param C_influent: The concentration entering the CMFR.
    :type C_influent: float
    :param t: The time(s) at which to calculate the effluent concentration. Time can be made dimensionless by dividing by the residence time of the CMFR.
    :type t: float or numpy.array

    :return: Effluent concentration
    :rtype: float

    :Examples:

    >>> from aguaclara.research.environmental_processes_analysis import CMFR
    >>> from aguaclara.core.units import unit_registry as u
    >>> round(CMFR(0.1, 0*u.mg/u.L, 10*u.mg/u.L), 7)
    <Quantity(0.9516258, 'milligram / liter')>
    >>> round(CMFR(0.9, 5*u.mg/u.L, 10*u.mg/u.L), 7)
    <Quantity(7.9671517, 'milligram / liter')>