Interactive Molecular Dynamics¶
Narupa’s main feature is that it enabled interactive molecular dynamics to be performed on simulations running in various packages.
By an interaction, we mean a force applied to one or more atoms in a simulations, normally for a short period of time. Interactions are applied to a group of atoms by ‘mass-weighting’. The group of atoms are treated as a single composite point particle, with total mass \(M\) and center of mass \(r_{\text{COM}}\):
The force \(F\) to apply to this ‘composite particle’ is calculated depending on the type of interaction. Then this force is distributed across each of the affected particles:
This weighting ensures that all the atoms experience the same acceleration, and hence move as one complete group.
There are three interaction available for dynamics run through narupatools:
Spring¶
The spring interaction is centered on a position \(p\), and has the following form:
Here, \(k\) is a scaling factor fixed as \(1 \text{kJ}/\text{mol}/\text{nm}^2\), and \(s\) is the dimensionless scaling factor of the interaction.
Gaussian¶
The gaussian interaction is centered on a position \(p\), and has the following form:
Here, \(k\) and \(\sigma\) are scaling factors fixed at \(1 \text{kJ}/\text{mol}\) and \(1 \text{nm}^2\) respectively, and \(s\) is the dimensionless scaling factor of the interaction.
Constant¶
narupatools also adds a constant interaction, which applies a constant force \(F_c\) to a set of particles:
The dimensionless scaling factor is not applied to this kind of interaction.
Calculating Work¶
The work done by an interaction is given by the integral:
where the integral C is along a given path.
Our trajectory is split into discrete steps, where we know both the force \(F\) and displacement \(s\) at different points in time.
The infinitesimal work here is given by:
For two adjacent timesteps with times \(t_0\) and \(t_1\), we have:
where we approximate the force as the average between the forces at the start and end of the step. Therefore:
This gives the work for a single step on a single particle. The total work for an interaction is therefore:
where the first sum is over all indices \(i\) affected by the interaction and the second sum is over all timesteps