Skip to content

Commit

Permalink
Changed rate coefficient test to use rtol
Browse files Browse the repository at this point in the history
kineticsSurfaceTest used atol for rate coefficient
tests previously. The atol was too strict for
double precision floating point. All other rate
coefficient tests used rtol.
  • Loading branch information
ssun30 committed Sep 25, 2024
1 parent 6e2d6f6 commit f3fca44
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/rmgpy/kinetics/kineticsSurfaceTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,9 +741,11 @@ def test_get_rate_coefficient(self):
Ea = Ea_ox - (alpha_ox * electrons_ox * constants.F * (V-V0_ox))
k_oxidation = A_ox * (T / T0_ox) ** n_ox * np.exp(-Ea / (constants.R * T))
Ea = Ea_red - (alpha_red * electrons_red * constants.F * (V-V0_red))
k_reduction = A_red * (T / T0_red) ** n_red * np.exp(-Ea / (constants.R * T))
assert round(abs(k_oxidation-self.surfchargerxn_oxidation.get_rate_coefficient(T,V)), 7) == 0
assert round(abs(k_reduction-self.surfchargerxn_reduction.get_rate_coefficient(T,V)), 7) == 0
k_reduction = A_red * (T / T0_red) ** n_red * np.exp(-Ea / (constants.R * T))
kox = self.surfchargerxn_oxidation.get_rate_coefficient(T,V)
kred = self.surfchargerxn_reduction.get_rate_coefficient(T,V)
assert abs(k_oxidation - kox) < 1e-6 * kox
assert abs(k_reduction - kred) < 1e-6 * kred

def test_change_v0(self):

Expand Down

0 comments on commit f3fca44

Please sign in to comment.