Class LeapFrogging
- java.lang.Object
-
- dev.nm.stat.random.rng.multivariate.mcmc.hybrid.LeapFrogging
-
public class LeapFrogging extends Object
The leap-frogging algorithm is a method for simulating Molecular Dynamics, which is time-reversible.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLeapFrogging.DynamicsStateContains the entire state (both the position and the momentum) at a given point in time.
-
Constructor Summary
Constructors Constructor Description LeapFrogging(RealVectorFunction dU, Vector m, Vector x, Vector p, double dt)Constructs a new instance with the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vectorp()Gets the current momentum.LeapFrogging.DynamicsStatestate()Gets the current system configuration.voidstep()Performs one step of the leap-frogging algorithm.voidsteps(int n)Performs n steps of the leap-frogging algorithm.Vectorx()Gets the current position.
-
-
-
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 componentsm- the mass of the componentsx- the initial positionp- the initial momentumdt- 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
-
-