\section{Introduction}
The virial theorem, introduced by Rudolf Clausius \cite{vt1} has found applications in astrophysics, cosmology, molecular physics, quantum mechanics and statistical mechanics (see for instance \cite{vt2,vt3,vt4,vt5,hv}). In the context of classical mechanics, the virial theorem relates the time-averaged kinetic energy \(\langle K \rangle\) with the time-average of the \(\mathbf{r} \cdot \mathbf{F}\), where \(\mathbf{r}\) is the position vector while \(\mathbf{F}\) is the force vector. In his original paper \cite{vt1}, Clausius introduced the `virial' for a one-particle system, defined as \(G = m \mathbf{r}\cdot \mathbf{v}\) and showed that if the motion is periodic in time \(T\) or at least if \(G\) remains bounded in its time evolution, then
\begin{equation}\label{1st}
\langle K \rangle = -\frac{1}{2} \langle \mathbf{r} \cdot \mathbf{F} \rangle
\end{equation}
where angled brackets \(\langle \cdot \rangle\) denote `time-averaging'. In particular, if the force is conservative, one can write \(\mathbf{F} = -\nabla V\) and therefore
\begin{equation}
\langle K \rangle = \frac{1}{2} \langle \mathbf{r} \cdot \nabla V \rangle.
\end{equation}
This result can be straightforwardly extended for quantum mechanical systems \cite{vt5,hv} and the tensor virial equations \cite{vt2} which indicate that the kinetic and potential energies must be in `balance' in each separate direction. A generalized version of the virial theorem which has been termed the `hypervirial' theorem was studied in \cite{hv} and certain hypervirial relations have been recently obtained in \cite{hvr}. The formulation of the hypervirial theorem or simply the generalized virial theorem was studied in \cite{virial1,virial2} using methods of symplectic geometry, wherein various mechanical examples including position-dependent mass systems were discussed. The purpose of this note is to study the generalized virial theorem for contact Hamiltonian systems which describe some simple dissipative systems in mechanics. \\

Contact geometry is like an odd-dimensional cousin of symplectic geometry \cite{goldsteincm,arnoldcm} with several common features, such as the existence of Hamiltonian dynamics \cite{arnoldcm,Geiges,Arnold} as well as invariants analogous to Gromov-Witten invariants \cite{El}. However, unlike their symplectic counterparts, Hamiltonian dynamics on a contact manifold is neither volume preserving, nor does it conserve the corresponding Hamiltonian function along the evolution. Consequently, contact Hamiltonian dynamics has found applications in describing dissipative mechanical systems \cite{CM1,CM2,CM3,CM4}, as well as thermostat problems where the system interacts with an environment \cite{thermo}. It has also found applications in reversible \cite{hermann,RT1,RT2,RT3,RT4,RT5,RT6,RT7,RT8,Peter79} as well as irreversible thermodynamics \cite{generic1,generic2,generic4}. Given these features, it appears interesting to explore the generalized virial theorem for a contact Hamiltonian system which may describe a dissipative system such as that experiencing linear or quadratic drag forces where the kinetic and potential energies are not conserved. Furthermore, we also obtain a generalized virial theorem in the contact Lagrangian framework where the dynamics coincides with that described by the Herglotz variation problem, originally presented more than 90 years back \cite{Herglotz} (see also \cite{CM4} for a nice review). Various examples are discussed throughout the paper. \\

With the above background, we present the organization of this paper as follows. In the next section [section-(\ref{IntroSec})], we will introduce the reader to some basic contact geometry and will fix our notation. The role of antisymmetric brackets is emphasized upon. Following this, in section-(\ref{VirSec}), we present a generalized virial theorem for contact Hamiltonian systems and show that the earlier result \cite{virial1,virial2} arises only as a special case. Some examples are discussed. Then, in section-(\ref{LagSec}), we will derive another generalized virial theorem from the framework of contact Lagrangian dynamics. Finally, we conclude the paper in section-(\ref{DisSec}).

\section{Contact geometry}\label{IntroSec}
In this section, we provide a minimal background of Hamiltonian dynamics on contact manifolds. We begin by describing symplectic manifolds first.

\subsection{Symplectic manifolds}
Let us recall that a symplectic manifold is a pair \((\mathcal{M}_s,\omega)\) where \(\mathcal{M}_s\) is a smooth manifold of real dimension \(2n\) and \(\omega\) is a closed and non-degenerate two form, i.e. it satisfies
\begin{equation}
  d\omega = 0, \hspace{4mm} \omega^n \neq 0.
\end{equation} Here \(\omega^n\) is the volume form on \(\mathcal{M}_s\). Then, for any function \(H \in C^\infty(\mathcal{M}_s,\Re)\), one has the vector bundle map between \(T\mathcal{M}_s\) and \(T^*\mathcal{M}_s\):
\begin{equation}\label{symplecticHamiltonian}
  \iota_{X_H} \omega = dH
\end{equation} where \(X_H\) is a vector field determined by the above condition. Note that since \(\omega\) is non-degenerate, this map is an isomorphism. The vector field \(X_H\) is known as the Hamiltonian vector field corresponding to the Hamiltonian function \(H\). These vector fields are volume preserving which can be seen by constructing the Lie derivative of \(\omega\) with respect to \(X_H\):
\begin{equation}
  \pounds_{X_H} \omega = d (\iota_{X_H} \omega) + \iota_{X_H} (d\omega) = 0
\end{equation} thereby leading to the familiar Liouville's theorem used in statistical mechanics. There is a theorem due to Darboux stating that on a symplectic manifold, near any point there local coordinates \((q^i,p_i)\) such that the two form \(\omega\) reads
\begin{equation}\label{symplecticDarboux}
  \omega = dq^i \wedge dp_i.
\end{equation}
It can be easily checked that the local expression of \(X_H\) consistent with eqns (\ref{symplecticHamiltonian}) and (\ref{symplecticDarboux}) is
\begin{equation}
  X_H = \frac{\partial H}{\partial p_i} \frac{\partial }{\partial q_i} - \frac{\partial H}{\partial q^i} \frac{\partial}{\partial p_i}   .
\end{equation}
Then clearly, the integral curves of \(X_H\) satisfy the Hamilton's equations of motion. The function \(H\) is conserved under the flow generated by \(X_H\), i.e. \(X_H (H) = 0\). For simple mechanical systems where \(H\) is the energy, this leads to conservation of energy.

\subsection{Contact manifolds}
A contact manifold is a pair \((\mathcal{M}_c,\eta)\) where \(\mathcal{M}_c\) is a smooth manifold of real dimension \(2n+1\) and \(\eta\) is a one form satisfying
\begin{equation}\label{nonintegrability}
  \eta \wedge (d\eta)^n \neq 0
\end{equation} which is known as the condition of maximal non-integrability. Note that \(\eta \wedge (d\eta)^n\) is the standard volume form on \(\mathcal{M}_c\). In the context of Frobenius integrability, eqn (\ref{nonintegrability}) means that the hyperplane distribution defined as \({\rm ker}(\eta)\) is maximally non-integrable in the sense that the resulting hyper-planes are overly twisted. We refer the reader to \cite{arnoldcm,Geiges} for more details.\\

On any contact manifold \((\mathcal{M}_c,\eta)\), there exists a global vector field \(\xi\) known as the Reeb vector field defined uniquely through the relations
\begin{equation}
  \eta(\xi) = 1, \hspace{4mm} \iota_\xi d\eta = 0.
\end{equation} In other words, \(\xi\) appears as a dual vector to \(\eta\). There is an analogous Darboux's theorem for contact manifolds which says that near any point, it is possible to define local (Darboux) coordinates \((s,q^i,p_i)\) such that
\begin{equation}
  \eta = ds - p_i dq^i
\end{equation} and thus \(\xi = \partial/\partial s\) in local coordinates. Let us note that since locally \(d\eta = dq^i \wedge dp_i\), one may think of a contact manifold to be locally of the form \(\mathcal{M}_c = \mathcal{M}_s \times \Re\) where \(\mathcal{M}_s\) is a symplectic submanifold (codimension one) of \(\mathcal{M}_c\) where \(\theta = \Phi^* \eta\) defines the symplectic potential such that \(\omega = d\theta\) and \(\Phi:\mathcal{M}_s \mapsto \mathcal{M}_c\) is the inclusion map.

\subsection{Contact Hamiltonian dynamics}\label{chd}
With the basic understanding of contact manifolds as introduced above, let us describe Hamiltonian dynamics analogous to the symplectic case. For a function \(h \in C^\infty(\mathcal{M}_c,\Re)\), there is an associated vector field \(X_h\) defined by the combined conditions
\begin{equation}
  \eta(X_h) = -h, \hspace{4mm} \iota_{X_h} d\eta = dh - \xi(h) \eta
\end{equation} where it may be shown that this too is a vector bundle isomorphism between \(T\mathcal{M}_c\) and \(T^*\mathcal{M}_c\). The vector field \(X_h\) is known as the contact Hamiltonian vector field associated with the function \(h\) and in local coordinates, it takes the following form:
\begin{equation}
  X_h = \bigg(p_i \frac{\partial h}{\partial p_i} - h \bigg) \frac{\partial }{\partial s} + \bigg(\frac{\partial h}{\partial p_i}\bigg)\frac{\partial }{\partial q^i} - \bigg( \frac{\partial h}{\partial q_i} + p_i \frac{\partial h}{\partial s} \bigg) \frac{\partial}{\partial p_i}.
\end{equation}
Clearly, this vector field does not conserve \(h\) along its flow, i.e.
\begin{equation}
  X_h = - h \frac{\partial h}{\partial s} \neq 0.
\end{equation}
Furthermore, the flow is not volume preserving as can be checked from its divergence, i.e.
\begin{equation}
  {\rm div}.X_h = -(n+1) \frac{\partial h}{\partial s} = -(n+1) \xi(h)
\end{equation} Thus, some of the nice properties of (symplectic) Hamiltonian vector fields are not present in their contact geometric counterparts. However, it is very easy to see that if \(h\) becomes independent of \(s\), then the contact vector field acquires all the properties of a symplectic vector field because \(\xi(h) = 0\). In that case, \(s\) is simply the action but we would for obvious reasons, not be interested in such situations.

\subsection{Lagrange (Jacobi) brackets}
Contact manifolds fall into the broader category of Jacobi manifolds \cite{deLeon} which are equipped with a local Lie bracket structure \(\{\cdot,\cdot\}:C^\infty(\mathcal{M}_c,\Re) \times C^\infty(\mathcal{M}_c,\Re) \rightarrow C^\infty(\mathcal{M}_c,\Re)\) which has been called a Lagrange bracket \cite{Raj,contactBH}. On any Jacobi manifold, the Lie bracket is defined as
\begin{equation}
\{ f , g \} = \Lambda (df,dg) + f E (g) - E(f) g
\end{equation} where \(\Lambda\) is an appropriate bi-vector field (analogous to the Poisson bi-vector on Poisson manifolds) and \(E\) is a vector field on the Jacobi manifold such that
\begin{equation}
[\Lambda, \Lambda] = 2 E \wedge \Lambda, \hspace{5mm} [\Lambda, E] = 0.
\end{equation} In the above equations, \([\cdot, \cdot]\) is the  Schouten-Nijenhuis bracket \cite{SN}. On a contact manifold, we identify \(E = \xi\) (Reeb vector field) and \(\Lambda = (d\eta)^{-1}\) or equivalently, \(\Lambda (df,dg) = d\eta(X_f,X_g)\) which gives in Darboux coordinates the following expression:
\begin{eqnarray}
  \{f,g\} &=& f \frac{\partial g}{\partial s} - \frac{\partial f}{\partial s} g + p_i \bigg( \frac{\partial f}{\partial s} \frac{\partial g}{\partial p_i} - \frac{\partial f}{\partial p_i} \frac{\partial g}{\partial s}\bigg) \nonumber \\
   &+& \frac{\partial f}{\partial q^i} \frac{\partial g}{\partial p_i} - \frac{\partial f}{\partial p_i} \frac{\partial g}{\partial q^i}
\end{eqnarray} for any \(f , g \in C^\infty(\mathcal{M}_c,\Re)\). It follows that the Lagrange bracket of a constant with a function may not in general be zero, i.e. \(\{1,f\} = \xi(f)\) for any \(f  \in C^\infty(\mathcal{M}_c,\Re)\),  unlike the case with Poisson brackets wherein the bracket vanishes identically. Further, it is easy to check that if the functions \(f\) and \(g\) are independent of \(s\), the Lagrange bracket reduces to the Poisson bracket, as is anticipated. It can be easily shown that a contact vector field has the following form in terms of the Lagrange bracket:
\begin{equation}
  X_h(\cdot) = \{\cdot,h\} - (\cdot) \xi (h)
\end{equation} meaning that \(X_h\) of a constant function is zero consistently.

\section{Virial theorem for a contact Hamiltonian system}\label{VirSec}
In this section, we will derive a geometric version of the virial theorem suited for contact Hamiltonian systems following the earlier works \cite{virial1,virial2} in a symplectic setup. We can now state the following result.

\begin{theorem}
Consider a contact Hamiltonian system \((\mathcal{M}_c,\eta,h)\) where \((\mathcal{M}_c,\eta)\) is a contact manifold and \(h \in C^\infty(\mathcal{M}_c,\Re)\) is a contact Hamiltonian function. Then, if \(\phi_t\) be the flow generated by the corresponding Hamiltonian vector field \(X_h\) where \(t\) is an affine parameter called `time', then for an arbitrary observable \(f \in C^\infty(\mathcal{M}_c,\Re)\) which remains bounded in its evolution along \(X_h\), one has
\begin{equation}\label{vir1}
  \langle \{f,h\} -f \xi (h) \rangle = 0
\end{equation}
where \(\{\cdot,\cdot\}\) is the Lagrange bracket on \((\mathcal{M}_c,\eta)\) and \(\langle \cdot \rangle\) denotes time-averaging.
\end{theorem}

\textit{Proof -} If \(\phi_t\) be the flow generated by \(X_h\) where \(t\) is an affine parameter, then clearly \(\phi_t\) commutes with \(X_h\). Consequently, one can write for any function \(f \in C^\infty(\mathcal{M}_c,\Re)\),
\begin{equation}
   \frac{d}{dt} (\phi^*_t f) = X_h (\phi^*_t f) = \phi^*_t (X_h (f)) = \phi^*_t (\{f,h\} - f \xi (h)).
\end{equation}
Integrating this equation between \(t = 0\) to \(t = T\) and dividing both sides by \(T\) gives
\begin{equation}
  \frac{1}{T} [f {\rm ~o~} \phi_T - f {\rm ~o~} \phi_0] = \frac{1}{T} \int_{0}^{T} dt (\{f,h\} - f \xi (h)) {\rm ~o~} \phi_t.
\end{equation}
We assume that upon taking the limit \(T \rightarrow \infty\), the right hand side does not blow up. This holds if the function \(f\) remains bounded along its time evolution. Then we get eqn (\ref{vir1}) upon taking \(T \rightarrow \infty\). \\

\begin{corollary}
If we choose \(f= q^i p_i := G\), i.e. the virial of a mechanical system, then eqn (\ref{vir1}) reduces to
\begin{equation}\label{Virialtheoremcontact}
  \langle \{G,h\}_{\rm PB} \rangle = \langle G \xi(h) \rangle.
\end{equation} where the subscript \({\rm PB}\) implies that \(\{\cdot,\cdot\}_{\rm PB}\) is a Poisson bracket.
\end{corollary}

\textit{Proof -} By direct calculation in local coordinates. \\

Eqn (\ref{Virialtheoremcontact}) matches with the geometric version of virial theorem derived in \cite{virial1,virial2} for a symplectic manifold if \(\xi(h) = 0\), i.e. if \(h\) is independent of \(s\). We discuss some examples below.

\subsection{Damped oscillator}\label{dampedsub}
Let us consider the example of a one dimensional damped harmonic oscillator with damping constant \(\gamma\). Its motion can be described by a contact Hamiltonian function of the form \cite{CM1,CM2,CM3}
\begin{equation}
  h = \frac{p^2}{2m} + \frac{m \omega^2 q^2}{2} + \gamma s
\end{equation} where \(\gamma > 0\). The contact equations of motion read
\begin{equation}
  \dot{q} = \frac{p}{m}, \hspace{3mm} \dot{p} = - m \omega^2 q - \gamma p, \hspace{3mm} \dot{s} = \frac{p^2}{2m} - \frac{m \omega^2 q^2}{2} - \gamma s .
\end{equation} The first two equations give the equations of motion for a one-dimensional harmonic oscillator. In this case the virial is simply \(G = q p\) and therefore, eqn (\ref{Virialtheoremcontact}) gives
\begin{equation}\label{abc}
  \bigg\langle \frac{p^2}{2m} \bigg\rangle = \bigg\langle \frac{m \omega^2 q^2}{2} \bigg\rangle + \frac{1}{2} \langle \gamma p q \rangle
\end{equation}
This is exactly what one would have obtained using the Newton's second law: the term on the left-hand side is the mean kinetic energy, the first term on the right-hand side is the mean `spring' potential energy while the second term on the right-hand side is of the form \(qF\) [eqn (\ref{1st})] where \(F = -\gamma p\) is the non-potential force of linear friction. The above setting can be extended to any number of particles moving in an arbitrary potential \(V(q^i)\) while experiencing a friction proportional to the momentum \(p_i\) with damping constant \(\gamma\). The result gives
\begin{equation}
 \sum_i \bigg\langle \frac{p_i^2}{2m} \bigg\rangle = \frac{1}{2} \sum_i \bigg\langle q^i \frac{\partial V(q^i)}{\partial q^i} \bigg\rangle + \frac{1}{2} \sum_i \langle \gamma q^i p_i \rangle.
\end{equation}

\subsection{Parachute equation}\label{parachutesec}
Consider the case of vertical motion of a particle of mass \(m\) falling through a fluid under constant gravity. Such a dynamics can be described by a contact Hamiltonian vector field. Following the Lagrangian description presented in \cite{CM3}, we consider the following contact Hamiltonian function:
\begin{equation}
h = \frac{(p - 2 \lambda s)^2}{2m} + \frac{mg}{2 \lambda}(e^{2 \lambda q} - 1)
\end{equation} where \(q\) is mechanical coordinate of the falling particle, \(p\) is the generalized momentum, while \(\lambda > 0\) is a constant. It will be shown that the frictional force is proportional to the square of the velocity. The contact equations of motion are
\begin{eqnarray}
\dot{q} &=& \frac{p - 2 \lambda s}{m}, \label{pa}\\
\dot{p} &=&- mg e^{2 \lambda q} + \frac{2 \lambda p(p - 2\lambda s)}{m}, \label{pb} \\
\dot{s} &=& \frac{p(p-2 \lambda s)}{m} - \frac{(p - 2 \lambda s)^2}{2m} - \frac{mg}{2 \lambda}(e^{2 \lambda q} - 1). \label{pc}
\end{eqnarray}
Eqn (\ref{pa}) gives
\begin{equation}
m \ddot{q} = \dot{p} - 2 \lambda \dot{s}
\end{equation} which upon susbtituting eqns (\ref{pb}) and (\ref{pc}) reduces to
\begin{equation}\label{eompara}
 \ddot{q} = \lambda  \dot{q}^2  - g
\end{equation} matching with the second-order equation of motion obtained in \cite{CM3} obtained via the contact Lagrangian method. Notice that the drag has a quadratic dependence on velocity unlike the system discussed in the previous section where friction was linear in the velocity. The constant \(\lambda\) depends on the density of the air, the shape of the object, etc.\\

Now, for the present case of a particle falling under gravity while experiencing a quadratic drag, eqn (\ref{Virialtheoremcontact}) gives
\begin{equation}\label{virthpara}
\bigg\langle \frac{p(p - 2 \lambda s)}{m} \bigg\rangle = - 2 \lambda \bigg\langle \frac{pq ( p - 2 \lambda s)}{m} \bigg\rangle + mg \langle q e^{2 \lambda q} \rangle
\end{equation}
where one can immediately verify that for \(\lambda = 0\) (no dissipation), one has \(\langle p^2/m \rangle = \langle mg q \rangle\) which is the result one would expect from the classic virial theorem for a particle under gravity. One notices that for \(\lambda \neq 0\), the virial theorem [eqn (\ref{virthpara})] doesn't appear as if it presents a relationship between the time-averages of energies. This is because in this case \(p\) is not the mechanical momentum of the particle. On the other hand, if one were to use a Lagrangian framework as in subsection-(\ref{parlagsec}), the corresponding virial theorem would indeed relate the mean kinetic and potential energies.

\subsection{Forced oscillator}
In subsection-(\ref{dampedsub}), we considered the case of a particle acted upon by a damping force proportional to its velocity. It was shown that although the time-averaged kinetic and potential energies were found to be equal, they were identically zero making such an equality trivial. We will now consider the case of a forced oscillator where a periodic forcing continues to drive the motion as \(T \rightarrow \infty\). For this, we require a contact Hamiltonian function of the following form
\begin{equation}\label{tdf}
  h = \frac{p^2}{2m} + \frac{m \omega^2 q^2}{2} + \gamma s - q F(t)
\end{equation} where \(\gamma > 0\) and \(F(t)\) is the external periodic force.\\

Let us notice that the contact Hamiltonian is now explicitly time-dependent. This means, one has to modify the definition of the evolution vector field to include time evolution. For that, consider an extended phase space \(M = \mathcal{M}_c \times \Re\) where \(\mathcal{M}_c\) is a contact manifold on which \((s,q,p)\) are local coordinates and \(t \in \Re\) (global coordinate) such that \(h \in C^\infty(M, \Re)\). Consider the one form \(\alpha = h dt + ds - p_i dq^i\) on \(M\), being defined as \(\eta = \Psi^* \alpha\) where \(\Psi: \mathcal{M}_c  \mapsto M\). Then, we define the time-dependent evolution vector field \(\Xi_h\) via the following conditions intrinsic conditions (see also \cite{CM2}):

\begin{equation}
\alpha(\Xi_h) = 0, \hspace{4mm} \iota_{\Xi_h} d\alpha = \zeta(h) dt - \xi(h) \alpha
\end{equation}
 where \(\zeta = \partial / \partial t\) is a global vector field on \(M\). Subsequently, in coordinates \((t,q,p,s)\) on \(M = \mathcal{M}_c \times \Re\), we have
 \begin{equation}
 \Xi_h =  \frac{\partial}{\partial t} + X_h.
 \end{equation}
 The resulting equations of motion are the same as that obtained in subsection-(\ref{chd}) along with \(\dot{t} = 1\). Now, following the previous treatment, and with the identification \(G = qp\), one can reproduce after time-averaging, eqn (\ref{Virialtheoremcontact}) describing the generalized virial theorem. \\

 Let us consider the case where \(F(t) = F_0 \cos (\Omega t)\) where \(F_0\) and \(\Omega\) are positive numbers. The equations of motion are
 \begin{eqnarray}
 \dot{t} &=& 1, \\
 \dot{q} &=& \frac{p}{m}, \\
 \dot{p} &=& - \gamma p - m \omega^2 q  +  F_0  \cos (\Omega t) ,\\
 \dot{s} &=& \frac{p^2}{2m} - \frac{m \omega^2 q^2}{2} - \gamma s + q F_0  \cos (\Omega t).
 \end{eqnarray}
 The second and the third equations above describe the damped and forced oscillator. Subsequently, eqn (\ref{Virialtheoremcontact}) gives
 \begin{equation}
\bigg\langle \frac{p^2}{2m} \bigg\rangle = \bigg\langle \frac{m \omega^2 q^2}{2} \bigg\rangle - \frac{1}{2}\big\langle q \big[-\gamma p + F_0 \cos (\Omega t)\big] \big\rangle
 \end{equation} where the right-hand side contains two terms: the first one is the usual potential energy contribution from the `spring', while the second one is due to the non-potential force and is of the type \(\langle \mathbf{r} \cdot \mathbf{F}\rangle\) as in eqn (\ref{1st}).

\subsection{Brownian oscillator}
We consider the case of Brownian motion wherein, a single particle of mass \(m\) is immersed in a fluid where it experiences both random collisions from the fluid particles and the viscous drag. Furthermore, there is a harmonic trap in which the particle moves. The random force \(\eta(t)\) is termed as `noise' which as the following statistical properties
\begin{equation}\label{noisestat}
\langle \eta(t) \rangle = 0 ,\hspace{4mm} \langle \eta(t) \eta(t') \rangle = 2 m \gamma k_B T \delta(t-t')
\end{equation} where \(T\) is the absolute temperature. In order to describe it in the framework of time-dependent contact Hamiltonian dynamics, we consider a contact Hamiltonian function of the form given in eqn (\ref{tdf}) with \(F(t) = \eta(t)\). The resulting equations of motion are
 \begin{eqnarray}
 \dot{t} &=& 1, \\
 \dot{q} &=& \frac{p}{m}, \label{lang1} \\
 \dot{p} &=& - \gamma p - m \omega^2 q  +  \eta(t), \label{lang2}  \\
 \dot{s} &=& \frac{p^2}{2m} - \frac{m \omega^2 q^2}{2} - \gamma s + q \eta(t).
 \end{eqnarray}
 Eqns (\ref{lang1}) and (\ref{lang2}) can be combined to give the famous Langevin equation
 \begin{equation}\label{langevin}
  \ddot{q} + \gamma \dot{q} + \omega^2 q = \eta(t) .
 \end{equation}
The Brownian particle follows a zig-zag trajectory (in one dimension, the particle can go only towards left or right but the `zig-zag' nature remains unchanged) such the the mean squared displacement grows with time linearly for large times, i.e. \((\sigma_q)^2 \sim t\). In this situation eqn (\ref{Virialtheoremcontact}) gives
 \begin{equation}
\bigg\langle \frac{p^2}{2m} \bigg\rangle = \bigg\langle \frac{m \omega^2 q^2}{2} \bigg\rangle -\frac{1}{2}\big\langle q \big[-\gamma p + \eta(t)\big] \big\rangle.
 \end{equation}
 If one solves the Langevin equation \cite{z,b}, then using the solution \((q(t),p(t))\), it can be shown that \(\langle q(-\gamma p + \eta(t)) \rangle = 0\) where one uses eqns (\ref{noisestat}) describing the statistical properties of noise. This gives the result that the time-averaged kinetic and potential energies of the Brownian oscillator are equal. Moreover, using the solution \((q(t),p(t))\) and eqns (\ref{noisestat}), one can show that they are equal to \(k_B T/2\), in accordance with the classical equipartition theorem.

 \subsection{Gierer–Meinhardt system}
 The dynamics of the autocatalytic Gierer–Meinhardt system \cite{GM} can be obtained via conformal as well as contact Hamiltonian dynamics \cite{virial2,PG}. To recall, on a symplectic manifold \((\mathcal{M}_s,\omega)\), a conformal vector field \(X_H^a\) associated with some Hamiltonian \(H \in C^\infty(\mathcal{M}_s,\Re)\) for some constant \(a \in \Re\) is one which gives \(\pounds_{X_H^a} \omega = a \omega\). The particular case \(a = 0\) gives a genuine Hamiltonian vector field \(X_H\) which is volume preserving while \(a=1\) gives the Liouville vector field \(Z\). In Darboux coordinates \((q^i,p_i)\), it is easy to verify that such a vector field \(X_H^a\) satisfies
 \begin{equation}
 \iota_{X_H^a} \omega = dH + a \theta
 \end{equation} where \(\theta\) is the symplectic potential, i.e. \(\omega = d\theta\). Since \(\pounds_{X_H} \omega = 0\) and \(\pounds_Z \omega = \omega\), one has \(\pounds_{X_H + aZ} = a \omega\) thereby indicating that one can write \(X_H^a = X_H + a Z\). \\

 The Gierer–Meinhardt system is associated with the dynamical equations
 \begin{equation}\label{GME}
 \dot{x} = \frac{A}{B + y} - Cx, \hspace{5mm} \dot{y} = Dx - Ky
 \end{equation} where \(A, B, C, D, K\) are constants. If one considers a two-dimensional symplectic phase space \(M_s = T^* \Re \approxeq \Re^2\) with \(\omega = dx \wedge dy\), then eqns (\ref{GME}) can arise as the equations whose solutions are the integral curves of the conformal vector field \(X^{-(C + K)}_H\) and the associated Hamiltonian function reads
 \begin{equation}
 H = A \ln (B + y) - \frac{Dx^2}{2} - Cxy.
 \end{equation} More explicitly, the equations of motion are obtained from \(H\) defined above as
 \begin{equation}
 \dot{x} = \frac{\partial H}{\partial y}, \hspace{5mm} \dot{y} = - \frac{\partial H}{\partial x} - (C + K) y.
 \end{equation}
 The dynamics of the Gierer–Meinhardt system can be equivalently described using contact Hamiltonian dynamics (see also \cite{PG}) if we consider an extended phase space \(M_c = T^*\Re \times \Re \approxeq \Re^3\) with a contact form \(\eta = dz - y dx\). The appropriate choice of contact Hamiltonian is
 \begin{equation}
 h = A \ln (B + y) - \frac{Dx^2}{2} + C(z - xy) + K z
 \end{equation} which implies that the contact equations give eqns (\ref{GME}) and additionally, the equation of motion for \(z\):
 \begin{equation}
 \dot{z} = A \Bigg[ \frac{y}{B+y} - \ln (B + y) \Bigg] + \frac{Dx^2}{2} - (C+K)z.
 \end{equation}
 Geometrically, one may say that the Gierer–Meinhardt dynamics on the two-dimensional phase space \(M_s = T^*\Re\) is a projection of \(X_h\) defined on the three-dimensional space \(M_c = T^*\Re \times \Re\). This is true in a more general setting: Consider a symplectic manifold \((\mathcal{M}_s,\omega)\) as a codimension one submanifold of a contact manifold \((\mathcal{M}_c,\eta)\) such that locally, \(\mathcal{M}_c = \mathcal{M}_s \times \Re\) wherein, for the inclusion map \(\Phi: \mathcal{M}_s \mapsto \mathcal{M}_c\), one has \(\theta = \Phi^* \eta\), where \(\theta\) is the symplectic potential on \(\mathcal{M}_s\). Then, any conformal vector field \(X_H^a\) in \((\mathcal{M},\omega)\) with \(H \in C^\infty(\mathcal{M}_s,\Re)\) can be obtained as a projection of a contact vector field \(X_h\) on \((\mathcal{M}_c, \eta)\) for \(h \in C^\infty(\mathcal{M}_c,\eta)\) where, \( h := H + as\) with \(s \in \Re\). \\

 Since the system being considered at present is not a mechanical system, there is no obvious identification of the virial \(G\). Nevertheless, putting \(G = xy\) in analogy with a mechanical system gives rise to the equality
  \begin{equation}\label{GMVir}
  \bigg\langle \bigg(1 + \frac{B}{y}\bigg)^{-1} \bigg\rangle + a \langle x^2 \rangle = b \langle xy \rangle
  \end{equation}
where \(a = \frac{D}{A}\) and \(b = \frac{C+K}{A}\). Eqn (\ref{GMVir}) can be termed as the virial theorem for the Gierer–Meinhardt system.

 \section{Contact Lagrangian framework}\label{LagSec}
 We will, for the sake of completeness, derive the generalized virial theorem in the contact Lagrangian framework \cite{CM3,CM4}. Consider the bundle \(\pi: TQ \times \Re \rightarrow Q\) and a Lagrangian function \(L: TQ \times \Re \rightarrow \Re\). On \(TQ\), one has the usual endomorphism \(S\) which can be naturally extended to \(TQ \times \Re\) and in some local coordinate chart \((q,\dot{q},s)\) one has
 \begin{equation}
 S = dq^i \otimes \frac{\partial}{\partial \dot{q}^i}.
 \end{equation}
 The local coordinates are such that \((q^i,\dot{q}^i)\) are the coordinates on \(TQ\): \(q^i\) are the coordinates on \(Q\) and \(\dot{q}^i\) are the fiber coordinates, whereas, \(s\) is a global coordinate in \(\Re\). One may now construct a one-form \(\theta_L\) as \(\theta_L := S^*(dL)\) so that
 \begin{equation}\label{etaL}
\eta_L = dz - \theta_L = dz- \frac{\partial L}{\partial \dot{q}^i} dq^i
 \end{equation} defines a contact form, i.e. \(\eta_L \wedge (d\eta_L)^n \neq 0\), provided \(L\) is regular, i.e. \(W_{ij}= \frac{\partial^2 L}{\partial \dot{q}^i \partial \dot{q}^j}\) is regular. The Reeb vector field \(\xi_L\) is defined via the conditions \(\eta_L(\xi_L)=1\) and \(\iota_{\xi_L}d\eta_L = 0\) taking the following form in local coordinates:
 \begin{equation}
  \xi_L = \frac{\partial}{\partial s} - W^{ij}  \frac{\partial^2 L}{\partial \dot{q}^j \partial s} \frac{\partial}{\partial \dot{q}^i}
 \end{equation} where \(W^{ij}\) is inverse of \(W_{ij}\) which exists due to the regularity of \(L\). Now, the energy function \(E_L\) is defined as \( E_L = \Delta(L) - L\), where \(\Delta\) is the Liouville vector field, i.e. \(\Delta = \dot{q}^i \frac{\partial}{\partial \dot{q}^i}\) on \(TQ\) extended in the usual way to \(TQ \times \Re\) which means
  \begin{equation}\label{EL}
E_L = \dot{q}^i \frac{\partial L}{\partial \dot{q}^i} - L.
 \end{equation} Now we have described all the ingredients required to describe contact Lagrangian dynamics on \(TQ \times \Re\). Corresponding to \(L\), we define a vector field \(X_L\) which satisfies
 \begin{equation}\label{XLCond}
 \eta_L (X_L) = - E_L, \hspace{4mm} \iota_{X_L} d\eta_L = dE_L - (\pounds_{\xi_L} E_L) \eta_L
 \end{equation} which means, one has the following local expression for \(X_L\):
 \begin{equation}\label{XLExp}
 X_L = L \frac{\partial}{\partial s} + \dot{q}^i \frac{\partial}{\partial q^i} + W^{ik} \bigg( \frac{\partial L}{\partial q^k} - \frac{\partial^2 L}{\partial q^j \partial \dot{q}^k} \dot{q}^j - L \frac{\partial^2 L}{\partial s \partial \dot{q}^k} + \frac{\partial L}{\partial s} \frac{\partial L}{\partial \dot{q}^k} \bigg) \frac{\partial}{\partial \dot{q}^j}
 \end{equation}
It follows that the integral curves of the vector field \(X_L\) satisfy the generalized Euler-Lagrange equations obtained by Herglotz in 1930 via a variational principle \cite{Herglotz} (see also \cite{CM4}). \\

We shall now discuss the generalized virial theorem in the Lagrangian setting. To summarize the above discussion, given any configuration space \(Q\), a regular Lagrangian \(L: TQ\times \Re\) induces a contact structure on \(TQ \times \Re\) with a contact form \(\eta_L\) defined in eqn (\ref{etaL}). The energy function is defined as in eqn (\ref{EL}) and corresponding to the Lagrangian \(L\) one may define a dynamical vector field \(X_L\) via the conditions given in eqns (\ref{XLCond}) whose local expression is eqn (\ref{XLExp}). The solutions of this contact Lagrangian problem solve the generalized Euler-Lagrange equations of Herglotz.\\

\begin{theorem}
Consider a contact Lagrangian system with some \(L:TQ	\times \Re \rightarrow \Re\) such that \(X_L\) is the dynamical vector field. Then, the following result holds:
\begin{equation}\label{virialLag}
 \langle X_L (G) \rangle = 0
\end{equation} where \(G\) is the virial and \(\langle \cdot \rangle\) denotes time-average.
\end{theorem}

\textit{Proof -} For a contact Lagrangian system, the dynamical vector field is \(X_L\) which means the evolution of any function \(f:TQ \times \Re \rightarrow \Re\) is \(X_L (f)\). If \(\phi^L_t\) be the flow generated by \(X_L\) where \(t\) is time, then \(\phi^L_t\) commutes with \(X_L\) and therefore
\begin{equation}
   \frac{d}{dt} (\phi^{L*}_t f) = X_L (\phi^{L*}_t f) = \phi^{L*}_t (X_L (f)).
\end{equation}
Taking time-average with \(T \rightarrow \infty\) therefore gives \( \langle X_L (f) \rangle = 0\) where we have assumed that \(f\) remains bounded in its time evolution. Thereafter, picking \(f = G\) (the virial) gives eqn (\ref{virialLag}) which can be interpreted as a generalized virial theorem in the contact Lagrangian framework. Below, we consider two examples.

\subsection{Damped oscillator}
Consider the one-dimensional damped oscillator whose Hamiltonian formalism was discussed in subsection-(\ref{dampedsub}). The associated contact Lagrangian is of the form
\begin{equation}
L = \frac{m \dot{q}^2}{2} - \frac{m \omega^2 q^2}{2} - \gamma s.
\end{equation}
Then, the dynamical vector field [eqn (\ref{XLExp})] becomes
\begin{equation}
X_L = L \frac{\partial}{\partial s} + \dot{q} \frac{\partial}{\partial q} - \big( \omega^2 q  + \gamma \dot{q}\big) \frac{\partial}{\partial \dot{q}}
\end{equation} which means the equations of motion are \(\dot{s} = L\) and,
\begin{equation}
\ddot{q} = - \big( \omega^2 q  + \gamma \dot{q}\big).
\end{equation}
If we identify \(G = m \dot{q} q \), then the generalized virial theorem [eqn (\ref{virialLag})] gives
\begin{equation}
\bigg\langle \frac{m\dot{q}^2}{2} \bigg\rangle = \bigg\langle \frac{m \omega^2 q^2}{2} \bigg\rangle + \frac{1}{2}\langle m \gamma q \dot{q} \rangle.
\end{equation}
Thus, the term on the left-hand side gives the kinetic energy while the first term on the right-hand side gives the spring potential energy. The second term on the right-hand side is of the form \(-\frac{\langle \mathbf{r} \cdot \mathbf{F}\rangle}{2}\) appearing in eqn (\ref{1st}) where \(F\) the non-potential frictional force \(F = - m \gamma \dot{q}\).

\subsection{Parachute equation}\label{parlagsec}
We will consider another example, namely the parachute equation whose Hamiltonian formalism was discussed in subsection-(\ref{parachutesec}). The following Lagrangian describes the dynamics \cite{CM3}:
\begin{equation}
L = \frac{m \dot{q}^2}{2} - \frac{mg}{2 \lambda} \big( e^{2 \lambda q} - 1 \big) + 2 \lambda \dot{q} s
\end{equation} for which simple manipulations show that the dynamical vector field is
\begin{equation}
X_L = L \frac{\partial}{\partial s} + \dot{q} \frac{\partial}{\partial q} + (\lambda \dot{q}^2 - g) \frac{\partial}{\partial \dot{q}}.
\end{equation}
The equations of motion give rise to eqn (\ref{eompara}) describing the acceleration of a particle of mass \(m\) which falls under gravity through a fluid leading to a drag force quadratic in velocity. For this case, identifying \(G = m \dot{q} q \), the generalized virial theorem [eqn (\ref{virialLag})] gives
\begin{equation}
\bigg\langle \frac{m\dot{q}^2}{2} \bigg\rangle = \frac{1}{2}\langle m g q \rangle - \frac{1}{2}\langle m \lambda q \dot{q}^2 \rangle
\end{equation} wherein the term on the left-hand side, and the first term on the right-hand side respectively describe the time-averaged kinetic and gravitational potential energies (with an overall 1/2 factor) while the second term on the right-hand side consistently gives \(-\frac{\langle \mathbf{r}\cdot \mathbf{F} \rangle}{2}\) for the non-potential quadratic drag force \(F = m \lambda \dot{q}^2\). \\

\section{Conclusions} \label{DisSec}
In this paper, we studied the generalized virial theorem for contact Hamiltonian dynamics and discussed various examples including mechanical systems with dissipation, a feature which was absent in the earlier treatments performed on symplectic manifolds \cite{virial1,virial2}. Although the result comes out to be distinct from that obtained earlier, it is found to give consistent results for mechanical systems. It also follows that if the contact Hamiltonian is independent of \(s\), i.e. \(\xi(h) = 0\), then the generalized virial theorem obtained here reduces to that for a symplectic Hamiltonian system, where the phase space is a codimension one symplectic submanifold of the contact manifold we started with. Subsequently, we studied the generalized virial theorem for a contact Lagrangian system where a regular Lagrangian \(L:TQ \times \Re \rightarrow \Re\) leads to a contact form on \(TQ \times \Re\). Two mechanical examples: particle moving under linear dissipation as well as under quadratic drag were discussed. \\

There are several avenues for future developments. It would be nice to develop an understanding of the generalized virial theorem in the context of thermodynamics, given that contact Hamiltonian systems describe thermodynamic transformations, both reversible (see for example \cite{contactBH} and references therein) and irreversible \cite{generic1,generic2,generic4}. Moreover, it would be interesting to study a quantum version of the generalized virial theorem specific to contact manifolds where dissipation is inbuilt. For instance, in \cite{CM2} the possibility of a `contact Schr\"odinger equation' was suggested which could describe certain dissipative quantum systems such as the Schr\"odinger-Langevin equation \cite{SL,SL1}. It would therefore be very interesting to generalize the results of this paper to quantum mechanical situations, particularly involving open systems. We hope such issues will be reported on, in the future.

\section*{Acknowledgements}
The author is supported by the Ministry of Education (MoE), Government of India in the form of a Prime Minister's Research Fellowship (ID: 1200454).

\clearpage