FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit d96c7086 authored by M.D. Driver's avatar M.D. Driver
Browse files

create method to calculate matrix.

parent fc8ef0ec
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,16 @@ pairwise manner. As detailed in DOI: http://dx.doi.org/10.1039/c3sc22124e.
"""
EVDW = -5.6
def calcluate_association_energy_matrix(epsilon_i_list, epsilon_j_list, temperature, theta, polynomial_coefficients):
"""This iterates through and fills an array with all the solvation energies.
"""
association_matrix = np.zeros((len(epsilon_i_list), len(epsilon_j_list)))
for i in range(len(epsilon_i_list)):
for j in range(len(epsilon_j_list)):
association_energy = calculate_association_energy(epsilon_i_list[i], epsilon_j_list[j], temperature, theta, polynomial_coefficients)
association_matrix[i][j] = association_energy
return association_matrix
def calculate_association_energy(epsilon_i, epsilon_j, temperature, theta, polynomial_coefficients):
"""This calculates the energy described above
"""
......
......@@ -24,6 +24,12 @@ class SolvationCalculatorTestCase(unittest.TestCase):
def tearDown(self):
"""tear down after tests.
"""
def test_calcluate_association_energy_matrix(self):
"""Test to see if expected matrix is produced.
"""
expected_array = np.array([[-1.2500649680700651]])
actual_array = solvationcalculator.calcluate_association_energy_matrix([1.0],[1.0], 298.0, 1.0, np.array([0.5, 1.0]))
np.testing.assert_array_almost_equal(expected_array, actual_array)
def test_calculate_association_energy(self):
"""Test to see if expected_value is returned.
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment