def GetEnergy(self): """Calculate bond energy (float) [kcal/mol].""" self.energy = energy.GetEBond(self.r_ij, self.r_eq, self.k_b)
def testShortBond(self): params = r_ij, r_eq, k_b = 1.5, 2.0, 5.0 self.assertAlmostEqual(energy.GetEBond(*params), 1.25)
def testNoBondSpring(self): params = r_ij, r_eq, k_b = 2.0, 1.0, 0.0 self.assertAlmostEqual(energy.GetEBond(*params), 0.0)
def testEquilibriumBond(self): params = r_ij, r_eq, k_b = 2.0, 2.0, 1.0 self.assertAlmostEqual(energy.GetEBond(*params), 0.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)
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'))
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)
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)