get energy of part of the system

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
Daniel Konstantinovsky
Posts: 77
Joined: Tue Jun 11, 2019 12:21 pm

get energy of part of the system

Post by Daniel Konstantinovsky » Fri Aug 26, 2022 10:38 am

Hi OpenMM,

I want to analyze the potential energies due to some atoms in the system but not the rest. As in, if atom A is in the included group, all its interactions are counted toward the energy, including those with atoms B which may not be in the included group. Is there a way to do this without having to go into the internals of OpenMM?

I know there is a way to break down the energy into bonded, angles, etc. is there a way to do what I'm asking? It might involve breaking down the energy by individual bonds, angles, and dihedrals then building up the included group from those. Is there a way to do this?

Thank you!
Dan

User avatar
Peter Eastman
Posts: 2544
Joined: Thu Aug 09, 2007 1:25 pm

Re: get energy of part of the system

Post by Peter Eastman » Fri Aug 26, 2022 11:06 am

It depends on exactly what you want to do.

- Which energy terms do you want to compute?
- What do you want to do with energy terms that involve more than two atoms, such as angles and dihedrals? (If you use implicit solvent or a polarizable force field, even nonbonded terms are multibody.)
- Is there just a single division of atoms you can define in advance, or will you want to compute energies for many different sets of atoms?
- How frequently do you want to compute the energy of the isolated group? There are methods that would be very slow if you need to compute it every step, but fine if you only do it infrequently.
- How many atoms are in the group, and how many in the complete system?

User avatar
Daniel Konstantinovsky
Posts: 77
Joined: Tue Jun 11, 2019 12:21 pm

Re: get energy of part of the system

Post by Daniel Konstantinovsky » Fri Aug 26, 2022 11:18 am

I want to compute the potential energy due to a subset of water molecules in the system, maybe a couple hundred of them. I wouldn't need to do it at every MD step, just occasionally (this is to calculate thermo quantities so I just need good enough sampling). For one of the things I want to do I can define the group beforehand (just "all the water molecules"). For another type of calculation I would need to redefine the group every time because stuff moves around. The whole system has 1400 water molecules and a small protein.

With bonds and angles, if the atom in the group is in the bond or angle, that energy should be counted I think, although it's just a matter of convention (how I define "the group"). I use a nonpolarizable force field (Amber ff14sb and tip4p-ew).

User avatar
Peter Eastman
Posts: 2544
Joined: Thu Aug 09, 2007 1:25 pm

Re: get energy of part of the system

Post by Peter Eastman » Mon Aug 29, 2022 1:05 pm

A very similar question came up recently on github: https://github.com/openmm/openmm/issues/3746. Would the approach described there work for you?

User avatar
Daniel Konstantinovsky
Posts: 77
Joined: Tue Jun 11, 2019 12:21 pm

Re: get energy of part of the system

Post by Daniel Konstantinovsky » Tue Aug 30, 2022 9:21 am

yes, I think so. Thank you!

POST REPLY