I have the following set of differential equations $$\dot{x} = p_x$$ $$\dot{y} = p_y$$ $$\dot{p_x} = -\frac{\partial H}{\partial x}$$ $$\dot{p_y} = -\frac{\partial H}{\partial y}$$ For context, these are Hamilton's equations of motion so $H$ is the time independent Hamiltonian which is a function of $x$ and $y$. The unknowns are $x, y, p_x, p_y$ which are all functions of $t$. What numerical algorithm should I use and how do I implement this algorithm?
Asked
Active
Viewed 48 times
1
-
2A non-garbage answer to your Question requires more information about the Hamiltonian you are using. Is it time independent or time dependent or is your Hamiltonian describing a system that is very different from those examples? – Eric Towers Dec 24 '21 at 18:02
-
2Principally this is a first-order system, so that all general solvers are applicable. Symplectic integrators do exist, but having adaptive step-size control is more difficult for them. See https://scicomp.stackexchange.com/questions/29149/what-does-symplectic-mean-in-reference-to-numerical-integrators – Lutz Lehmann Dec 24 '21 at 19:27
-
Thanks for the response. Also I had a quick question: Can I just substitute for the $p_x$ and $p_y$ to convert the four equations into two so that I do not need to deal with the conjugate momenta? – Dan Dec 29 '21 at 20:27