def _compile_dC_dt(self, V0, Qin, Cin, C, fill, aer):
    isa = isinstance
    processes = _add_aeration_to_growth_model(aer, self._model)
    if fill:
        t = symbols('t')
        mass_balance_terms = list(zip(Cin, C, processes.production_rates.rate_of_production))
        C_dot_eqs = [(((cin - c) / (t + (V0 / Qin))) + r) for (cin, c, r) in mass_balance_terms]
        if isa(aer, (float, int)):
            C_dot_eqs[self.components.index(self._DO_ID)] = 0

        def dC_dt(t, y):
            C_dot = lambdify(([t] + C), C_dot_eqs)
            return C_dot(t, *y)
        J = Matrix(dC_dt(t, C)).jacobian(C)
    else:
        C_dot_eqs = processes.production_rates.rate_of_production
        if isa(aer, (float, int)):
            C_dot_eqs[self.components.index(self._DO_ID)] = 0

        def dC_dt(t, y):
            C_dot = lambdify(C, C_dot_eqs)
            return C_dot(*y)
        J = Matrix(dC_dt(None, C)).jacobian(C)

    def J_func(t, y):
        J_func = lambdify(C, J)
        return J_func(*y)
    return (dC_dt, J_func)
def _compile_dC_dt(self, V0, Qin, Cin, C, fill, aer):
    isa = isinstance
    processes = _add_aeration_to_growth_model(aer, self._model)
    if fill:
        t = symbols('t')
        mass_balance_terms = list(zip(Cin, C, processes.production_rates.rate_of_production))
        C_dot_eqs = [(((cin - c) / (t + (V0 / Qin))) + r) for (cin, c, r) in mass_balance_terms]
        if isa(aer, (float, int)):
            C_dot_eqs[self.components.index(self._DO_ID)] = 0

        def dC_dt(t, y):
            C_dot = lambdify(([t] + C), C_dot_eqs)
            return C_dot(t, *y)
        J = Matrix(dC_dt(t, C)).jacobian(C)
    else:
        C_dot_eqs = processes.production_rates.rate_of_production
        if isa(aer, (float, int)):
            C_dot_eqs[self.components.index(self._DO_ID)] = 0

        def dC_dt(t, y):
            C_dot = lambdify(C, C_dot_eqs)
            return C_dot(*y)
        J = Matrix(dC_dt(None, C)).jacobian(C)

    def J_func(t, y):
        J_func = lambdify(C, J)
        return J_func(*y)
    return (dC_dt, J_func)