# Are these two expressions for $\mathrm{d}E/\mathrm{d}t$ compatible?

This is purely recreational, but I'm eager to know the answer. I was playing around with Hamiltonian systems whose Hamiltonian is not equal to their mechanical energy $$E$$.

If we split the kinetic energy $$K$$ and the potential energy $$V$$ in homogeneous polynomials on $$\dot{q}^k$$, the time-derivative of the generalised coordinates. For instance, $$K = \sum_{n=1}^N\frac{1}{2}m_n\dot{\vec{r}}_n^2 = \underbrace{\sum_{n=1}^N\frac{m_n}{2}\frac{\partial\vec{r}_n}{\partial t}\cdot\frac{\partial\vec{r}_n}{\partial t}}_{K_0} + \underbrace{\dot{q}^k\sum_{n=1}^Nm_n\frac{\partial\vec{r}_n}{\partial q^k}\cdot\frac{\partial\vec{r}_n}{\partial t}}_{K_1} + \underbrace{\dot{q}^k\dot{q}^\ell\sum_{n=1}^N\frac{m_n}{2}\frac{\partial\vec{r}_n}{\partial q^k}\cdot\frac{\partial\vec{r}_n}{\partial q^\ell}}_{K_2};$$ with $$N$$ the number of particles, $$m_n$$ the mass of the $$n$$th particle and $$\vec{r}_n$$ its position. We will assume $$V$$ is a conservative (so, non-generalised) potential, so it does not depend on these $$\dot{q}$$s and, thus, $$V=V_0$$.

It's easy to see, from the definition of $$H$$ as a Legendre transform of $$L$$, that $$H = K + V - (2K_0 + K_1),$$ hence, we can write $$\frac{\mathrm{d}E}{\mathrm{d}t} = \frac{\mathrm{d}}{\mathrm{d}t}(E-H)+\frac{\mathrm{d}H}{\mathrm{d}t} = \frac{\mathrm{d}}{\mathrm{d}t}(2K_0 + K_1)-\frac{\partial L}{\partial t}$$ using Hamilton's equations, and using $$L = K-V$$ we finally arrive at $$\frac{\mathrm{d}E}{\mathrm{d}t} = \frac{\mathrm{d}}{\mathrm{d}t}(2K_0 + K_1)-\frac{\partial K}{\partial t}+\frac{\partial V}{\partial t}\tag{1}.$$

We can also compute this total time-derivative of mechanical energy in a more Newtonian framework, and we find \begin{aligned}\frac{\mathrm{d}E}{\mathrm{d}t} & = \frac{\mathrm{d}}{\mathrm{d}t}\left(\frac{1}{2} m\vec{v}^2 + V\right) = m\vec{v}\cdot\vec{a} + \vec{v}\cdot\vec\nabla V + \frac{\partial V}{\partial t} \\ & = \vec{v}\cdot(\underbrace{\vec{F}^\text{consrv} + \vec{F}^\text{constr} + \vec{F}^\text{ncon}}_\text{total force \vec{F}}) + \vec{v}\cdot(-\vec{F}^\text{consrv}) + \frac{\partial}{\partial t}V = \dot{W}^\text{ncon} + \frac{\partial V}{\partial t} \end{aligned}\tag{2} assuming only one particle, and defining $$\vec{v} = \dot{\vec{r}}$$, $$\vec{a} = \ddot{\vec{r}}$$, because these equations look pretty ugly already without summations and subindices.

The time-dependences of $$K$$ should come either from external forces that aren't been taking into account or from being in a non-inertial frame of reference, which would give rise to ficticial forces. In any case, comparing Eq. (1) and Eq. (2), I expect the time-derivative of the work done by these forces, $$\dot{W}$$, to equal $$\frac{\mathrm{d}}{\mathrm{d}t}(2K_0 + K_1)-\frac{\partial K}{\partial t},$$ but manipulating that into something that makes sense is quite difficult. I began by rewriting it as $$\ddot{q}^k\frac{\partial}{\partial\dot{q}^k}T_2 + \dot{q}^k\frac{\partial}{\partial q^k}(2T_0 + T_1) + \frac{\partial}{\partial t}(T_0-T_2),$$ but I get a mess that's difficult to simplify.

I'm asking either for hints on how to simplify it or somehow manifest that those derivatives equal $$\dot{W}$$, or for someone to point out a flaw in my reasoning that makes all of this meaningless.

• "We would do the same for V" ?. V is not depending on the velocity and not explicit depending on the time. hence you can split it to $V_0+V_1+V_2$
– Eli
Commented Apr 11, 2021 at 14:35
• By $V$, @Eli, I meant a generalised potential, which can depend on the $\dot{q}$s. But, considering that's not relevant for my question, maybe I should've just assumed $V$ is a conservative potential $V(q,t)$ all along (it can still depend on $t$, tho). Commented Apr 11, 2021 at 17:05
• lets take pendulum that rotate ,the potential energy is $~V=-m\,g\,L\cos(\Omega\,t-\theta)~$ hence the time is not explicit you can't obtain $~V=V_0+V_1$ or what is your $V_0$ and $V_1$ in this case ?
– Eli
Commented Apr 11, 2021 at 17:17
• @Eli $V_0$ and $V_1$ are homogeneous polynomials of degree $0$ and $1$ on the generalised velocities. As a conservative $V$ only depends on $q^k,t$ and not in $\dot{q}^k$, it equals its own $V_0$, and $V_1 = 0$. Commented Apr 11, 2021 at 17:30
• the potential energy id not depending on the velocity i gave you example pendulum
– Eli
Commented Apr 11, 2021 at 17:37

## 2 Answers

Perhaps it is helpful to take a step back and review the definitions:

1. In this answer, we will assume that the Lagrangian $$L=T-U$$ is the difference between kinetic and (possibly velocity-dependent) potential energy.

2. Consider the (Lagrangian) energy function $$h(q,\dot{q},t)~=~\left(\sum_{j=1}^n\dot{q}^j\frac{\partial }{\partial \dot{q}^j}-1 \right)L(q,\dot{q},t), \tag{2.53}$$ which should not be confused with the Hamiltonian function $$H(q,p,t)$$. They are different functions, although their values agree.

3. The energy function $$h$$ is not necessarily the mechanical energy $$T+U$$.

4. Concerning the relationship between Hamiltonian and energy, see also e.g. this Phys.SE posts and links therein.

5. The time-derivative of the energy function is in general given by $$\frac{dh}{dt}~=~ \sum_{j=1}^n\dot{q}^j\left(Q_j-\frac{\partial{\cal F}}{\partial\dot{q}^j} \right)-\sum_{\ell=1}^m\lambda^{\ell} a_{\ell t}- \frac{\partial L}{\partial t} ,$$ where the notation is borrowed from my Phys.SE answer here.

References:

1. H. Goldstein, Classical Mechanics, 3rd edition; Chapter 2 + 8.

For mechanical system you can use this:

Euler Lagrange

\begin{align*} &\mathcal{L} =T-U\\ &\frac{d}{dt}\left(\frac{\partial \mathcal{L}}{\partial \dot{\boldsymbol{q}}}\right)- \frac{\partial \mathcal{L}}{\partial \boldsymbol{q}} =\left[\frac{\partial \boldsymbol{R}}{\partial \boldsymbol{q}}\right]^T\boldsymbol{f}_a\qquad\qquad (1) \end{align*} where:

• $$T$$ kinetic energy
• $$U$$ potential energy
• $$\boldsymbol{q}$$ generalized coordinates
• $$\boldsymbol{R}$$ Position vector
• $$\boldsymbol{f}_a$$ external forces

I put the velocity depending force components, friction forces and the time depending forces to the external forces.

transferring equation (1) you obtain:

\begin{align*} &\frac{d}{dt}\left(\frac{\partial \mathcal{L}'}{\partial \dot{\boldsymbol{q}}}\right)- \frac{\partial \mathcal{L}'}{\partial \boldsymbol{q}}=0\qquad\qquad\qquad (2)\\\\ &\text{where}\\ &\mathcal{L}'=\mathcal{L}+\,\left(\left[\frac{\partial \boldsymbol{R}}{\partial \boldsymbol{q}}\right]^T\boldsymbol{f}_a\right)\,\cdot \boldsymbol q\qquad \text{and}~ \mathcal{L}=T(\boldsymbol{\dot{q}}~,\boldsymbol q~,t)-U(\boldsymbol q~,t) \end{align*} \begin{align*} &\textbf{Hamiltonian } \\ &\mathcal{H}=\boldsymbol p\cdot \dot{\boldsymbol{q}}- \mathcal{L}'\left(\dot{\boldsymbol{q}}~,\boldsymbol q~,t\right)\\ &\text{with}\\ &\boldsymbol p=\frac{\partial\mathcal{L}'}{\partial\dot{\boldsymbol{q}}}= \frac{\partial\mathcal{L}}{\partial\dot{\boldsymbol{q}}}\\ &\Rightarrow\\ \mathcal{H}&=\frac{\partial\mathcal{L}\left(\dot{\boldsymbol{q}}~,\boldsymbol q~,t\right)}{\partial\dot{\boldsymbol{q}}}\cdot \dot{\boldsymbol{q}}- \mathcal{L}\left(\dot{\boldsymbol{q}}~,\boldsymbol q~,t\right)- \left(\left[\frac{\partial \boldsymbol{R}}{\partial \boldsymbol{q}}\right]^T\boldsymbol{f}_a\right)\,\cdot \boldsymbol q\\ &=\underbrace{\frac{\partial (T-U)}{\partial\dot{\boldsymbol{q}}}\cdot \dot{\boldsymbol{q}}- (T-U)}_{E}- \left(\left[\frac{\partial \boldsymbol{R}}{\partial \boldsymbol{q}}\right]^T\boldsymbol{f}_a\right)\,\cdot \boldsymbol q\\ \end{align*}

\begin{align*} &\dot{\mathcal{H}}= \frac{\partial {E}}{\partial\boldsymbol{\dot{q}}}\cdot \boldsymbol{\ddot{q}}+ \frac{\partial {E}}{\partial\boldsymbol{{q}}}\cdot \boldsymbol{\dot{q}}+ \frac{\partial {E}}{\partial t}- \left(\left[\frac{\partial \boldsymbol{R}}{\partial \boldsymbol{q}}\right]^T\boldsymbol{f}_a\right)\,\cdot \boldsymbol{\dot{q}} \end{align*}

for conservative system is the energy $$~E~$$ constant and $$~\boldsymbol f_a=0~$$ hence $$~\dot H=0$$

Example: pendulum with spring and damper the pendulum is rotating about the z axes with angular velocity $$~\omega$$

Position Vector:

$$\boldsymbol R=L\,\left[ \begin {array}{c} \sin \left( \omega\,\tau+\varphi \right) \\ -\cos \left( \omega\,\tau+\varphi \right) \\ 0\end {array} \right]$$ external force

$$\boldsymbol f_a=-f_d\,\left[ \begin {array}{c} \,\cos \left( \omega\,\tau+\varphi \right) \\\,\sin \left( \omega\,\tau+ \varphi \right) \\ 0\end {array} \right]$$

where $$~f_d~$$ is the velocity depending force $$~f_d=d\,(\dot{\varphi}+\omega)$$

The kinetic and potential energy

$$T=\frac 12\,m{L}^{2} \left(\omega+\dot\varphi \right)^2 \\ U=\frac 12\,\varphi \, \left( \varphi +2\,\omega\,\tau \right) Lc-mgL\cos \left( \varphi +\omega\,\tau \right)$$ $$\Rightarrow$$

The Hamiltonian

$$H=\frac 12\,m{L}^{2}{\dot\varphi }^{2}-1/2\,m{L}^{2}{\omega}^{2}+1/2\,{\varphi } ^{2}L\,c+\varphi \,L\,c\,\omega\,\tau-m\,g\,L\cos \left( \varphi +\omega\,\tau \right) -\varphi \,L{\it f_d}$$

for $$~\omega=0~$$ and $$~f_d=0~$$ the Hamiltonian is equal to the energy $$E=T+U\bigg|_{\omega=0}$$ which is constant.

• Thank you so much for your answer! One question, though: how do you know the Legendre transform of $\mathcal{L}$ (not prime) equals $E$? Is it because you imposed all the non-conservative forces to be in the remaining term? Commented Apr 13, 2021 at 21:22
• yes that is correct
– Eli
Commented Apr 14, 2021 at 6:19