hamiltonian_dynamics {rhmc}R Documentation

Hamiltonian Dynamics

Description

Approximates Hamiltonian dynamics for some potential function and a L2-norm kinectic funcion, assuming H(q,p) = U(q) + K(p).

Usage

hamiltonian_dynamics(U, q, p, L, eps, m)

Arguments

U

Potential function of the system.

q

Initial position vector.

p

Initial momentum vector.

L

Number of steps.

eps

Size of each step.

m

Mass vector.

Value

A list with the position 'q' and momentum 'p' at the end of the trajectory.

Examples

U = function(x) exp(-0.5 * x^2) / sqrt(2 * pi)
hamiltonian_dynamics(U, -2, 0.8, 100, 0.1, 1)
hamiltonian_dynamics(U, -2, 0.85, 100, 0.1, 1)


[Package rhmc version 1.0.0 Index]