Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

big energy expression leads to wrong energies with hip #17

Open
gorgW opened this issue May 22, 2024 · 0 comments
Open

big energy expression leads to wrong energies with hip #17

gorgW opened this issue May 22, 2024 · 0 comments

Comments

@gorgW
Copy link

gorgW commented May 22, 2024

I am trying to use CustomCompoundBondForce or CustomCV force and the output for this force doesn't make sense and it exceeds the max that it should reach when the number of interactions is big, however it works fine with small number of interactions.

`for i, pair in enumerate(atom_pairs1):
index_p1_1 = merged_flat.index(pair[0]) +1
index_p1_2 = merged_flat.index(pair[1]) +1
energy_expression += f'( 0.5* {N1_normal} * {weights_7[i]} (1 / (1 + exp(10(distance(p{index_p1_1},p{index_p1_2}) - 1.3 * {native_dist1[i]} )))))'
if i != len(atom_pairs1) - 1:
energy_expression += '+'
energy_expression += '-'
#for i, pair in enumerate(atom_pairs2):
for i, pair in enumerate(atom_pairs2):

index_p2_1 = merged_flat.index(pair[0]) +1
index_p2_2 = merged_flat.index(pair[1]) +1

energy_expression += f'( 0.5* {N2_normal} * {weights_8[i]} (1 / (1 + exp(10(distance(p{index_p2_1},p{index_p2_2}) - 1.3 * {native_dist2[i]} )))))'

if i != len(atom_pairs2) - 1:
energy_expression += '-'
force = mm.CustomCompoundBondForce(num_particles_per_bond,energy_expression)

force.addBond(merged_flat)
system.addForce(force)

`
###or it can be used as collective variable in CV force but still same problem like that

##cvforce = mm.CustomCVForce('(cv)')
##cvforce.addCollectiveVariable("cv", force)
##system.addForce(cvforce)`

the final energy expression is composed of many terms that are added ( or other terms that are subtracted ) of total ~ 1000 term and it is normalized so the final term shouldn't exceed 1 "or go less than -1 ". However, some runs give number that makes sense and other runs produce something of order 10^36 or -10^24 and other random numbers.

this happens when using hip platform, when I use cpu, it produces the expected results.

So, is there a way that this can be fixed ?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant