I am trying to understand how Hamiltonian gradient works.(adsbygoogle = window.adsbygoogle || []).push({});

[itex]H(q,p)=U(q)+K(p)[/itex]

U(q): potential energy

K(p): kinetic energy

q: position vector

p: momentum vector

both p and q are functions of time

H(q,p): total energy

[itex]\frac{d{{q}_{i}}}{dt}=\frac{\partial H}{\partial {{p}_{i}}}[/itex]Now, I am trying to solve this (the technical name is called leapfrog method)

[itex]\frac{d{{p}_{i}}}{dt}=-\frac{\partial H}{\partial {{q}_{i}}}[/itex]

[itex]{p}_{i}(t+\varepsilon /2)={p}_{i}(t)-(\varepsilon /2)\frac{\partial U}{\partial {q}_{i}}(q(t))[/itex]

[itex]{q}_{i}(t+\varepsilon )={q}_{i}(t)+\varepsilon \frac{{p}_{i}(t+\varepsilon /2)}{m}[/itex]

[itex]{p}_{i}(t+\varepsilon )={p}_{i}(t+\varepsilon /2)-(\varepsilon /2)\frac{\partial U}{\partial {q}_{i}}(q(t+\varepsilon ))[/itex]

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# How to solve for Hamiltonian gradient?

**Physics Forums | Science Articles, Homework Help, Discussion**