# How to calculate "interaction energy" between two groups

Dear Lammps users,

I simulate one system contains solvent (group 1) and nanoparticle (group 2). I used “DPD pair_style”. The particle contains beads and fixed as rigid body.

I want to calculate the interaction energy between group 1 and group 2. So I am using:

``````c**ompute ID group-ID group/group group2-ID**

**I am confused:**

**1. This command yield "total energy". I think that it includes: potential energy, kinetic energy,interaction energy....? not only the interaction energy? right?**
**2.** Is total energy above equal the  summation of pairwise energy between groups 1 and 2?
3. Could you please suggest how to calculate the interaction between groups 1 and 2?

Best regards,

XC

``````

compute ID group-ID group/group group2-ID
1. This command yield "total energy". I think that it includes: potential
energy, kinetic energy,interaction energy....? not only the interaction
energy? right?

According to the documentation, this command does not include any
bonded interaction between the two groups. In other words:
"This compute does not calculate any bond or angle or dihedral or
improper interactions between atoms in the two groups."

(It does not make sense to include kinetic energy, or contributions
from kinetic energy.)

2. Is total energy above equal the summation of pairwise energy between
groups 1 and 2?
3. Could you please suggest how to calculate the interaction between groups
1 and 2?

This command calculates the sum of all "pair" contributions to the
potential energy between the two groups EXCEPT long-range
electrostatic energies. (These can be included too by adding the
"kspace yes" keyword. This is a new feature.)
(It calculates the forces too.)

Cheers
documentation here:
http://lammps.sandia.gov/doc/compute_group_group.html

long-range electrostatics are discussed here:
http://lammps.sandia.gov/doc/kspace_style.html
If you do not have any charges in your system represented