TransWikia.com

Hamiltonian mechanics really useful for numerical integration? Lagrange equations can become 1st-order by introducing extra variables

Physics Asked by akai on July 23, 2021

(I’m talking about the classical mechanics.)

Many texts say that Lagrange equations are difficult to treat numerically because they are second-order ODEs, ${f_i(boldsymbol{q, dot{q}, ddot{q}}}) = 0$, and Hamilton equations are (at least computationally) great because they are first-order, or their forms are essentially ${dot{p_i}=g_i(boldsymbol{p, q})}$ and $dot{q_i}=h_i(boldsymbol{p, q})$.

I wonder if this statement is really valid? We can easily convert the Lagrange equations to first-order by, as a common technique, defining the new independent variables $v_i:=dot{q_i}$.

Right, then we have to first solve the Lagrange equations for $ddot{q_i}$ algebraically so that the equation can become $dot{q_i}=v_i$ and $dot{v_i}=(solved as ddot{q_i})$. People say this is difficult and thus Hamilton’s formalism is awesome.

However, in the process of Legendre transformation from Lagrangian $L$ to Hamiltonian $H$, we have to determine $dot{q}$ as $dot{q}(boldsymbol{p, q})$ by algebraically solving the definitions
$$
p_i=frac{partial L}{partial dot{q_i}}
$$

which is a system of equations.

So, in the both cases, we have to solve a set of algebraic equations anyway.

Is the latter solving process actually easier than the former in general? If there is, please give me an example where we can’t use the former (Lagrange) but can use the latter (Hamilton) to make it first-order.

2 Answers

Comments to the question (v8) concerning numerical integration:

  1. On one hand, to solve a Hamiltonian system numerically, there exist the numerical integration schemes of symplectic integrators (SI), where each (finite) numerical iteration step is a canonical transformation/symplectomorphism, which preserves certain properties, such as, e.g., energy, and which makes SIs suitable to solve long-term evolution problems numerically.

  2. On the other hand, transforming a 2nd-order coupled ODE system $$ddot{q}^i~=~f^i(q,dot{q},t)tag{1}$$ into a 1st-order coupled ODE system $$dot{v}^i~=~f^i(q,v,t), qquad dot{q}^i~=~v^i,tag{2}$$ does not necessarily bring it on Hamiltonian form$^1$.

--

$^1$ If the Lagrangian is of the form $L(q,v,t)=frac{1}{2}mv^2-V(q,t)$ so that momentum $p=mv$ is proportional to velocity, then the 1st-order system (2) is on Hamiltonian form. See also e.g. this Wikipedia page.

Correct answer by Qmechanic on July 23, 2021

So, the nice thing about Lagrangian mechanics is generalized coordinates. The crummy thing about it is that you at least in principle need to know about variational calculus to understand why it works and how to get the equations of motion. Finally, Emmy Noether's theorem gives you a really generic sense for conservation laws.

The nice thing about Hamiltonian mechanics is that Hamilton's equations just are the equations of motion, and the whole thing has a very Newtonian look and feel to it. In addition, you get a tighter coupling to plain quantum mechanics and very simple proofs of some basic conservation laws, if you know what you're looking for.

It is true that if you are starting from generalized coordinates and you only know the Lagrangian then you have to do a lot of work to turn that into a Hamiltonian, derive momentums, etc. But that's not the "core" of Hamiltonian mechanics. Just like Lagrangian mechanics assumes that you have the Lagrangian, Hamiltonian mechanics just assumes that you have the Hamiltonian in terms of the positions and momenta of the particles.

Answered by CR Drost on July 23, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP