コード例 #1
0
 def GetEnergy(self):
     """Calculate bond energy (float) [kcal/mol]."""
     self.energy = energy.GetEBond(self.r_ij, self.r_eq, self.k_b)
コード例 #2
0
 def testShortBond(self):
     params = r_ij, r_eq, k_b = 1.5, 2.0, 5.0
     self.assertAlmostEqual(energy.GetEBond(*params), 1.25)
コード例 #3
0
 def testNoBondSpring(self):
     params = r_ij, r_eq, k_b = 2.0, 1.0, 0.0
     self.assertAlmostEqual(energy.GetEBond(*params), 0.0)
コード例 #4
0
 def testEquilibriumBond(self):
     params = r_ij, r_eq, k_b = 2.0, 2.0, 1.0
     self.assertAlmostEqual(energy.GetEBond(*params), 0.0)
コード例 #5
0
 def testNoBondSpring(self):
     """Asserts no bond energy for zero spring constant."""
     params = r_ij, r_eq, k_b = 2.0, 1.0, 0.0
     self.assertAlmostEqual(energy.GetEBond(*params), 0.0)
コード例 #6
0
 def testInfiniteBond(self):
     """Asserts infinite energy for infinite bond length."""
     params = r_ij, r_eq, k_b = float('inf'), 2.0, 1.0
     self.assertAlmostEqual(energy.GetEBond(*params), float('inf'))
コード例 #7
0
 def testShortBond(self):
     """Asserts exact value for smaller than equilibrium bond length."""
     params = r_ij, r_eq, k_b = 1.5, 2.0, 5.0
     self.assertAlmostEqual(energy.GetEBond(*params), 1.25)
コード例 #8
0
 def testEquilibriumBond(self):
     """Asserts no bond energy for equilibrium length bond."""
     params = r_ij, r_eq, k_b = 2.0, 2.0, 1.0
     self.assertAlmostEqual(energy.GetEBond(*params), 0.0)