narupatools.imd.interactions¶
Shorthand methods for creating various IMD interactions.
Functions
Interaction that applies a constant force to a set of particles. |
|
Interaction that applies a gaussian force to a set of particles. |
|
Interaction that applies a spring force to a set of particles. |
-
narupatools.imd.interactions.constant_interaction(*, force: Union[numpy.typing._array_like._SupportsArray[numpy.dtype], numpy.typing._nested_sequence._NestedSequence[numpy.typing._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy.typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]], particles: Union[numpy.typing._array_like._SupportsArray[numpy.dtype], numpy.typing._nested_sequence._NestedSequence[numpy.typing._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy.typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]], scale: float = 1.0, **kwargs: Any) → narupa.imd.particle_interaction.ParticleInteraction¶ Interaction that applies a constant force to a set of particles.
This applies a force \(F_C\) on the center of mass equal to:
\[F_C = k F\]where \(F\) is the force to apply to the center of mass and \(k\) is a scaling factor.
The force \(F_i\) experienced by each particle is given by a mass weighting of this force:
\[F_i = \frac{m_i}{M} F_C\]where \(m_i\) is the mass of the i-th particle and \(M\) is the total mass of the set of particles the interaction is applied to.
- Parameters
force – Force \(F\) to apply to the set of particles, in kilojoules per mole per nanometer.
particles – Set of particles to apply the interaction to.
scale – Dimensionless scaling factor \(k\) to scale the energy and force applied.
kwargs – Arbitrary values to add to the interaction.
- Returns
A particle interaction that represents the given interactive force.
-
narupatools.imd.interactions.gaussian_interaction(*, particles: Union[numpy.typing._array_like._SupportsArray[numpy.dtype], numpy.typing._nested_sequence._NestedSequence[numpy.typing._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy.typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]], scale: float = 1.0, position: Union[numpy.typing._array_like._SupportsArray[numpy.dtype], numpy.typing._nested_sequence._NestedSequence[numpy.typing._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy.typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]], **kwargs: Any) → narupa.imd.particle_interaction.ParticleInteraction¶ Interaction that applies a gaussian force to a set of particles.
This applies a force \(F_C\) on the center of mass equal to:
\[F_C = - k (r_C - r_0) \exp(-\frac{(r_C - r_0)^2}{2}))\]where \(r_C\) is the center of mass of the particles, r_0 is the position of the interaction and \(k\) is a scaling factor.
The force \(F_i\) experienced by each particle is given by a mass weighting of this force:
\[F_i = \frac{m_i}{M} F_C\]where \(m_i\) is the mass of the i-th particle and \(M\) is the total mass of the set of particles the interaction is applied to.
- Parameters
position – Position that the gaussian well is centered, in nanometers.
particles – Set of particles to apply the interaction to.
scale – Dimensionless scaling factor \(k\) to scale the energy and force applied.
kwargs – Arbitrary arguments for the interaction.
- Returns
A particle interaction that represents the given interactive force.
-
narupatools.imd.interactions.spring_interaction(*, particles: Union[numpy.typing._array_like._SupportsArray[numpy.dtype], numpy.typing._nested_sequence._NestedSequence[numpy.typing._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy.typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]], scale: float = 1.0, position: Union[numpy.typing._array_like._SupportsArray[numpy.dtype], numpy.typing._nested_sequence._NestedSequence[numpy.typing._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy.typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]], **kwargs: Any) → narupa.imd.particle_interaction.ParticleInteraction¶ Interaction that applies a spring force to a set of particles.
This applies a force \(F_C\) on the center of mass equal to:
\[F_C = - k (r_C - r_0)\]where \(r_C\) is the center of mass of the particles, r_0 is the position of the interaction and \(k\) is a scaling factor.
The force \(F_i\) experienced by each particle is given by a mass weighting of this force:
\[F_i = \frac{m_i}{M} F_C\]where \(m_i\) is the mass of the i-th particle and \(M\) is the total mass of the set of particles the interaction is applied to.
- Parameters
position – Position that the spring is anchored to, in nanometers.
particles – Set of particles to apply the interaction to.
scale – Dimensionless scaling factor \(k\) to scale the energy and force applied.
kwargs – Arbitrary arguments for the interaction.
- Returns
A particle interaction that represents the given interactive force.