Numerical solution of Hamiltonian systems

In summary, the conversation discusses the use of numerical methods, specifically the Newton-Rhapson iteration, to solve a set of differential equations involving the Hamiltonian function. There is a question about how to effectively implement this in code and whether or not discretizing the derivative of the Hamiltonian is necessary. Some argue that it is not necessary as symplectic methods are based on analytical derivatives, while others argue that taking the analytic derivative and then discretizing does not ensure that the Hamiltonian is preserved. It is mentioned that symplectic methods only preserve the Hamiltonian to a high precision and are more difficult to formulate for general cases.
  • #1
fabsilfab
The question is very general and could belong to another topic, but here it is.
Suppose one wants to solve the set of differential equations $$ \frac{\partial x}{\partial t}=\frac{\partial H(x,p)}{\partial p},$$ $$\frac{\partial p}{\partial t}=-\frac{\partial H(x,p)}{\partial x},$$ with some numerical method, e.g. a Newton-Rhapson iteration. Let us discretise the above system in the most straightforward way, $$ \frac{x^{n+1}-x^n}{\Delta t}=\frac{H(x,p^{n+1})-H(x,p^n)}{p^{n+1}-p^n}, $$ $$ \frac{p^{n+1}-p^n}{\Delta t}=\frac{H(x^{n+1},p)-H(x^n,p)}{x^{n+1}-x^n}.$$ From the numerical point of view, this system is clearly ill-defined when either ##x## or ##p## do not change over a finite time step ##\Delta t##. Looking carefully at the equations, it is clear that the terms on the RHS represent an incremental ratio. In the limit of ##\Delta x \rightarrow 0## or ##\Delta p\rightarrow 0##, such ratios reduce to the exact (analytic) derivative. This must hold, otherwise we would encounter non-physical situations. For example, suppose the velocity is constant, thus the position is changing: if the RHS in the position equation did not reduce to the analytic derivative, the position update would be undefined (the denominator being zero would make the equation blow up; or, the numerator being zero would mean no position change).

Now the question: from the point of view of implementing the numerical solution of such system in a code, there must be some sort of switch. When the difference between position or momentum becomes zero, the RHS of the corresponding equation must reduce to the analytic derivative of the Hamiltonian ##H##. What I don't get is how to effectively due this, considering that in the most general case, these equations are implicit.

Any thoughts?
 
Physics news on Phys.org
  • #2
I don't see why you want to discretize the derivative of the Hamiltonian. What is usually done is that you calculate analytically the derivative of the Hamiltonian to get the equations of motion, and it is these equations of motion that you discretize.
 
  • #3
DrClaude said:
I don't see why you want to discretize the derivative of the Hamiltonian. What is usually done is that you calculate analytically the derivative of the Hamiltonian to get the equations of motion, and it is these equations of motion that you discretize.

Good point, but Hamiltonian-preserving numerical schemes are based on the direct discretisation of the Hamiltonian. Taking the analytic derivative and then discretising does not ensure that the Hamiltonian is preserved.
 
  • #4
fabsilfab said:
Good point, but Hamiltonian-preserving numerical schemes are based on the direct discretisation of the Hamiltonian.
Really? I'm surprised. Do you have examples of such methods? It is hard for me to see why doing the derivative numerically would give any sort of advantage.

fabsilfab said:
Taking the analytic derivative and then discretising does not ensure that the Hamiltonian is preserved.
That's not correct. All the symplectic methods I know are based on analytical ##H_p## and ##H_q##.

For more information, you can check out the book Geometric Numerical Integration.
 
  • #5
DrClaude said:
Really? I'm surprised. Do you have examples of such methods? It is hard for me to see why doing the derivative numerically would give any sort of advantage.That's not correct. All the symplectic methods I know are based on analytical ##H_p## and ##H_q##.

For more information, you can check out the book Geometric Numerical Integration.

True. But symplectic methods do not necessarily preserve the Hamiltonian (e.g., energy). They do, however, preserve it to some high precision. But not exactly. Also, you are probably referring to the special case of separable Hamiltonians. For more general case, it is even more difficult to formulate symplectic methods.
 

1. What is a Hamiltonian system?

A Hamiltonian system is a type of dynamical system that describes the motion of a system in terms of its position and momentum. It is based on the principle of conservation of energy and is commonly used in physics and engineering to model systems such as particles, planets, and oscillating systems.

2. Why is numerical solution important for Hamiltonian systems?

Numerical solution of Hamiltonian systems is important because analytical solutions are often difficult or impossible to obtain. Numerical methods allow for approximations of the solutions, making it possible to study and analyze complex systems that would not be possible otherwise.

3. What are some commonly used numerical methods for solving Hamiltonian systems?

Some commonly used numerical methods for solving Hamiltonian systems include the Euler method, Runge-Kutta methods, and symplectic integration methods. These methods are designed to preserve the energy and other important properties of Hamiltonian systems.

4. How accurate are numerical solutions for Hamiltonian systems?

The accuracy of numerical solutions for Hamiltonian systems depends on the method used and the step size chosen. Generally, symplectic methods are more accurate than non-symplectic methods. The accuracy can also be improved by decreasing the step size, but this comes at the cost of increased computational time.

5. What are some applications of numerical solution of Hamiltonian systems?

Numerical solution of Hamiltonian systems has a wide range of applications, including celestial mechanics, molecular dynamics, and fluid dynamics. It is also used in engineering applications such as control systems, robotics, and simulations of physical systems.

Similar threads

  • Advanced Physics Homework Help
Replies
6
Views
315
Replies
3
Views
744
  • Differential Equations
Replies
3
Views
405
  • Differential Equations
Replies
3
Views
1K
  • Advanced Physics Homework Help
Replies
10
Views
590
  • Calculus and Beyond Homework Help
Replies
5
Views
626
Replies
7
Views
1K
Replies
5
Views
1K
  • Differential Equations
Replies
1
Views
897
Replies
2
Views
4K
Back
Top