def setUp(self): p = np.zeros(10) q = np.zeros(10) p[0:-1] = 0.5 q[1:] = 0.5 p[4] = 0.01 q[6] = 0.1 self.A = [0, 1] self.B = [8, 9] self.a = 1 self.b = 8 self.bdc = BirthDeathChain(q, p) T_dense = self.bdc.transition_matrix() T_sparse = csr_matrix(T_dense) self.T = T_sparse self.mu = self.bdc.stationary_distribution() self.qminus = self.bdc.committor_backward(self.a, self.b) self.qplus = self.bdc.committor_forward(self.a, self.b) # present results self.fluxn = flux.flux_matrix(self.T, self.mu, self.qminus, self.qplus, netflux=False) self.netfluxn = flux.flux_matrix(self.T, self.mu, self.qminus, self.qplus, netflux=True) self.totalfluxn = flux.total_flux(self.netfluxn, self.A) self.raten = flux.rate(self.totalfluxn, self.mu, self.qminus)
def set_model_params(self, A, B, flux, mu, qminus=None, qplus=None, gross_flux=None, dt_model='1 step'): # set data self._A = A self._B = B self._flux = flux self._mu = mu self._qminus = qminus self._qplus = qplus self._gross_flux = gross_flux self.dt_model = dt_model # compute derived quantities: self._totalflux = tptapi.total_flux(flux, A) self._kAB = tptapi.rate(self._totalflux, mu, qminus)
def __init__(self, A, B, flux, mu=None, qminus=None, qplus=None, gross_flux=None, physical_time='1 step'): r""" Constructs a new reactive flux model instance. Parameters ---------- A : array_like List of integer state labels for set A B : array_like List of integer state labels for set B flux : (n,n) ndarray or scipy sparse matrix effective or net flux of A->B pathways mu : (n,) ndarray (optional) Stationary vector qminus : (n,) ndarray (optional) Backward committor for A->B reaction qplus : (n,) ndarray (optional) Forward committor for A-> B reaction gross_flux : (n,n) ndarray or scipy sparse matrix gross flux of A->B pathways, if available physical_time : Quantity or None, optional when the originating model has a lag time, output units will be scaled by it. """ # set data super().__init__() self._A = A self._B = B self._flux = flux self._mu = mu self._qminus = qminus self._qplus = qplus self._gross_flux = gross_flux self._dt_model = Q_(physical_time) # compute derived quantities: self._totalflux = tptapi.total_flux(flux, A) self._kAB = tptapi.rate(self._totalflux, mu, qminus)
def __init__(self, A, B, flux, mu=None, qminus=None, qplus=None, gross_flux=None): # set data self._A = A self._B = B self._flux = flux self._mu = mu self._qminus = qminus self._qplus = qplus self._gross_flux = gross_flux # compute derived quantities: self._totalflux = tptapi.total_flux(flux, A) self._kAB = tptapi.rate(self._totalflux, mu, qminus)
def __init__(self, A, B, flux, mu=None, qminus=None, qplus=None, gross_flux=None, dt_model='1 step'): # set data self._A = A self._B = B self._flux = flux self._mu = mu self._qminus = qminus self._qplus = qplus self._gross_flux = gross_flux from pyemma.util.units import TimeUnit self.dt_model = dt_model self._timeunit_model = TimeUnit(self.dt_model) # compute derived quantities: self._totalflux = tptapi.total_flux(flux, A) self._kAB = tptapi.rate(self._totalflux, mu, qminus)