Esempio n. 1
0
 def obs_function(trajchunk):
     r = md.compute_distances(trajchunk,pairs,periodic=periodic)
     Econtact = np.zeros(trajchunk.n_frames,float)
     for i in range(pairs.shape[0]):
         pair_Vi = get_pair_potential(pair_type[i])
         Econtact += eps[i]*pair_Vi(r[:,i],*contact_params[i])
     return Econtact
Esempio n. 2
0
 def map(self,traj):
     from model_builder.models.pairwise_potentials import get_pair_potential
     r = mdtraj.compute_distances(traj, self.pairs, periodic=self.periodic)
     Epair = np.zeros((traj.n_frames, self.dimension), float)
     for i in range(self.pairs.shape[0]):
         Vi = get_pair_potential(self.pair_type[i])
         Epair[:,0] += self.eps[i]*Vi(r[:,i],*self.pair_params[i])
     return Epair