def _compile_ODE(self):
    isa = isinstance
    C = list(symbols(self.components.IDs))
    m = len(C)
    if (self._model is None):
        warn(f'{self.ID} was initialized without a suspended growth model, and thus run as a non-reactive unit')
        r = (lambda *args: np.zeros(m))
    else:
        processes = _add_aeration_to_growth_model(self._aeration, self._model)
        r_eqs = list(processes.production_rates.rate_of_production)
        r = lambdify(C, r_eqs, 'numpy')
    _dstate = self._dstate
    _update_dstate = self._update_dstate
    V_arr = np.full(m, self._V_max)
    Q_e_arr = np.zeros(m)
    if isa(self._aeration, (float, int)):
        i = self.components.index(self._DO_ID)
        fixed_DO = self._aeration

        def dy_dt(t, QC_ins, QC, dQC_ins):
            Cs = QC[:(- 1)]
            Cs[i] = fixed_DO
            dydt_cstr_no_rxn_controlled_aer(QC_ins, dQC_ins, V_arr, Q_e_arr, _dstate, Cs)
            _dstate[:(- 1)] += r(*Cs)
            _dstate[i] = 0
            _update_dstate()
    else:

        def dy_dt(t, QC_ins, QC, dQC_ins):
            Cs = QC[:(- 1)]
            dydt_cstr_no_rxn_fixed_aer(QC_ins, dQC_ins, V_arr, Q_e_arr, _dstate, Cs)
            _dstate[:(- 1)] += r(*Cs)
            _update_dstate()
    self._ODE = dy_dt
def _compile_ODE(self):
    isa = isinstance
    C = list(symbols(self.components.IDs))
    m = len(C)
    if (self._model is None):
        warn(f'{self.ID} was initialized without a suspended growth model, and thus run as a non-reactive unit')
        r = (lambda *args: np.zeros(m))
    else:
        processes = _add_aeration_to_growth_model(self._aeration, self._model)
        r_eqs = list(processes.production_rates.rate_of_production)
        r = lambdify(C, r_eqs, 'numpy')
    _dstate = self._dstate
    _update_dstate = self._update_dstate
    V_arr = np.full(m, self._V_max)
    Q_e_arr = np.zeros(m)
    if isa(self._aeration, (float, int)):
        i = self.components.index(self._DO_ID)
        fixed_DO = self._aeration

        def dy_dt(t, QC_ins, QC, dQC_ins):
            Cs = QC[:(- 1)]
            Cs[i] = fixed_DO
            dydt_cstr_no_rxn_controlled_aer(QC_ins, dQC_ins, V_arr, Q_e_arr, _dstate, Cs)
            _dstate[:(- 1)] += r(*Cs)
            _dstate[i] = 0
            _update_dstate()
    else:

        def dy_dt(t, QC_ins, QC, dQC_ins):
            Cs = QC[:(- 1)]
            dydt_cstr_no_rxn_fixed_aer(QC_ins, dQC_ins, V_arr, Q_e_arr, _dstate, Cs)
            _dstate[:(- 1)] += r(*Cs)
            _update_dstate()
    self._ODE = dy_dt