Class LeapFrogging


  • public class LeapFrogging
    extends Object
    The leap-frogging algorithm is a method for simulating Molecular Dynamics, which is time-reversible.
    • Constructor Detail

      • LeapFrogging

        public LeapFrogging​(RealVectorFunction dU,
                            Vector m,
                            Vector x,
                            Vector p,
                            double dt)
        Constructs a new instance with the given parameters.
        Parameters:
        dU - the derivative of the potential energy of the system, w.r.t. the position of its components
        m - the mass of the components
        x - the initial position
        p - the initial momentum
        dt - the size of each time step
    • Method Detail

      • steps

        public void steps​(int n)
        Performs n steps of the leap-frogging algorithm.
        Parameters:
        n - the number of steps to perform
      • step

        public void step()
        Performs one step of the leap-frogging algorithm.
      • x

        public Vector x()
        Gets the current position.
        Returns:
        the current position
      • p

        public Vector p()
        Gets the current momentum.
        Returns:
        the current momentum
        See Also:
        "just below eq. 9.9"
      • state

        public LeapFrogging.DynamicsState state()
        Gets the current system configuration.
        Returns:
        the current system configuration