# Computing Entropy properly during Molecular Dynamics simulation

When simulating simple system to test out Stat Mech (ie. non-coupled), I was able to compute entropy by binning the particles and using the Shannon entropy formula.

For more complex systems, I realized that entropy isn't calculated by binning the particles, but for Gibb's entropy you need to bin the state of the system over multiple simulations. A large number of particles, this is highly dimensional due to the particles and binning will be very difficult.

How is entropy typically computed molecular dynamics and similar simulations?

• There's about a dozen different methods. A basic review can be found here, although there are plenty of other techniques. If you give more details about your system then I may be able to point you towards a particular method. Commented Oct 2, 2017 at 6:44
• @lemon. Thanks. So my immediate problem is trying to compute entropy to verify On the classical statistical mechanics of non-Hamiltonian systems which involve integrating the Gaussian isokinetic system ( see my python notebook). Eventually, I wanted to use this in Machine Learning to constrain things like entropy and "temperature" during training.
– user92177
Commented Oct 2, 2017 at 16:26

If you want to get the value of entropy as given by the Gibbs-Shannon expression $\sum_k -p_k\log p_k$, you are going to have to introduce some auxiliary discrete states that the system can be in (for example, system being in a phase space cell of some small dimensions), estimate their probabilities* and then evaluate the expression.
$$\int_i^f \frac{dQ}{T}.$$
* probability that the system is in state $k$ given the macroscopic state variable values.