예제 #1
0
    def get_selectivity_control(self, rxn_parameters):
        """
        return the list of degree of selectivity control for each rxn
        :param rxn_parameters: reaction parameters, see solver-base
        """
        kT = self._kB * self.temperature
        eps = self._mpfloat(self.perturbation_size)
        try:
            dSdG = numerical_jacobian(self.get_selectivity, rxn_parameters,
                                      self._matrix, eps)
        except ValueError(strerror):
            resid = str(strerror).rsplit('=', 1)[1]
            resid = resid.replace(')', '')
            resid.strip()
            self.log('jacobian_fail', resid=resid)
            dRdG = np.zeros(
                (len(self.gas_names),
                 len(self.adsorbate_names + self.transition_state_names)))

        s0 = self.get_selectivity(rxn_parameters)
        dSdG *= -kT
        dSdG = dSdG.tolist()
        DSC = []
        for si, Ji in zip(s0, dSdG):
            if si == 0:
                DSC.append([0.0] * len(Ji))
            else:
                DSC.append([float(Jj / si) for Jj in Ji])
        return DSC
예제 #2
0
    def get_rate_control(self, rxn_parameters):
        """
        return list of degree of rate control for each reaction
        Ref: Stegelmann et al., DOI: 10.1021/ja9000097
        :param rxn_parameters: reaction parameters, see solver-base
        """
        kT = self._kB * self.temperature
        eps = self._mpfloat(self.perturbation_size)
        try:
            diff_idxs = range(
                len(self.adsorbate_names + self.transition_state_names))
            dRdG = numerical_jacobian(self.get_turnover_frequency,
                                      rxn_parameters,
                                      self._matrix,
                                      eps,
                                      diff_idxs=diff_idxs)
        except ValueError(strerror):
            resid = str(strerror).rsplit('=', 1)[1]
            resid = resid.replace(')', '')
            resid.strip()
            self.log('jacobian_fail', resid=resid)
            dRdG = np.zeros(
                (len(self.gas_names),
                 len(self.adsorbate_names + self.transition_state_names)))

        t0 = self.get_turnover_frequency(rxn_parameters)
        dRdG *= -kT
        dRdG = dRdG.tolist()
        DRC = []
        for ti, Ji in zip(t0, dRdG):
            if ti == 0:
                DRC.append([0.0] * len(Ji))
            else:
                DRC.append([float(Jj / ti) for Jj in Ji])
        return DRC
예제 #3
0
 def get_selectivity_control(self,rxn_parameters):
     kT = self._kB*self.temperature
     eps = self._mpfloat(self.perturbation_size)
     try:
         dSdG = numerical_jacobian(self.get_selectivity,rxn_parameters,self._matrix,eps)
     except ValueError,strerror:
         resid = str(strerror).rsplit('=',1)[1]
         resid = resid.replace(')','')
         resid.strip()
         self.log('jacobian_fail',resid=resid)
         dRdG = np.zeros((len(self.gas_names),len(self.adsorbate_names+self.transition_state_names)))
예제 #4
0
 def get_selectivity_control(self,rxn_parameters):
     kT = self._kB*self.temperature
     eps = self._mpfloat(self.perturbation_size)
     try:
         dSdG = numerical_jacobian(self.get_selectivity,rxn_parameters,self._matrix,eps)
     except ValueError,strerror:
         resid = str(strerror).rsplit('=',1)[1]
         resid = resid.replace(')','')
         resid.strip()
         self.log('jacobian_fail',resid=resid)
         dRdG = np.zeros((len(self.gas_names),len(self.adsorbate_names+self.transition_state_names)))
예제 #5
0
 def get_rate_control(self,rxn_parameters):
     """
     return list of degree of rate control for each reaction
     Ref: Stegelmann et al., DOI: 10.1021/ja9000097
     :param rxn_parameters: reaction parameters, see solver-base
     """
     kT = self._kB*self.temperature
     eps = self._mpfloat(self.perturbation_size)
     try:
         diff_idxs = range(len(self.adsorbate_names+self.transition_state_names))
         dRdG = numerical_jacobian(self.get_turnover_frequency,rxn_parameters,self._matrix,eps,diff_idxs=diff_idxs)
     except ValueError, strerror:
         resid = str(strerror).rsplit('=',1)[1]
         resid = resid.replace(')','')
         resid.strip()
         self.log('jacobian_fail',resid=resid)
         dRdG = np.zeros((len(self.gas_names),len(self.adsorbate_names+self.transition_state_names)))
예제 #6
0
 def get_rate_control(self, rxn_parameters):
     """
     return list of degree of rate control for each reaction
     Ref: Stegelmann et al., DOI: 10.1021/ja9000097
     :param rxn_parameters: reaction parameters, see solver-base
     """
     kT = self._kB * self.temperature
     eps = self._mpfloat(self.perturbation_size)
     try:
         diff_idxs = range(
             len(self.adsorbate_names + self.transition_state_names))
         dRdG = numerical_jacobian(self.get_turnover_frequency,
                                   rxn_parameters,
                                   self._matrix,
                                   eps,
                                   diff_idxs=diff_idxs)
     except ValueError, strerror:
         resid = str(strerror).rsplit('=', 1)[1]
         resid = resid.replace(')', '')
         resid.strip()
         self.log('jacobian_fail', resid=resid)
         dRdG = np.zeros(
             (len(self.gas_names),
              len(self.adsorbate_names + self.transition_state_names)))
예제 #7
0
 def J(x):
     return numerical_jacobian(f, x, self._matrix)
예제 #8
0
 def J(x):
     return numerical_jacobian(f,x,self._matrix)