Skip to content

Commit

Permalink
Merge pull request #100 from GOMC-WSU/fix_eqn_simplify
Browse files Browse the repository at this point in the history
'symengine.sympify' changed to  'sympy.nsimplify' to solve for non-integers
  • Loading branch information
bc118 authored Jul 17, 2024
2 parents 59a454e + 8cff93a commit 5f6f678
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mosdef_gomc/utils/gmso_equation_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
import sympy
import unyt as u

# Although,'symengine.sympify' from 'import symengine ' is faster, it was changed to 'sympy.nsimplify' for some
# less simple equations with the 0.5 decimals in it (example OPLS dihedral). This was the only was to improve
# or actually solve for the scalers in the equations when using non-integers in the forms like the OPLS dihedral.


# compare Lennard-Jones (LJ) non-bonded equations
def evaluate_nonbonded_lj_format_with_scaler(new_lj_form, base_lj_form):
Expand Down Expand Up @@ -509,8 +513,8 @@ def evaluate_OPLS_torsion_format_with_scaler(
values = sympy.nonlinsolve(
[
eqn_ratio
- symengine.sympify(new_torsion_form)
/ symengine.sympify(base_torsion_form),
- sympy.nsimplify(new_torsion_form)
/ sympy.nsimplify(base_torsion_form),
],
[eqn_ratio],
)
Expand Down

0 comments on commit 5f6f678

Please sign in to comment.