1 Introduction

In the last decades, the interest in the formalism and applications of differential geometric structures to the study of mathematical physics and dynamical systems has risen drastically [1, 3, 29, 39]. The natural geometric framework for autonomous conservative mechanical systems, both Hamiltonian and Lagrangian, is symplectic geometry and the variational approach is based on Hamilton’s variational principle. For non-autonomous systems [11, 21, 24, 38, 43] the same variational principle is valid, but the underlying geometry is cosymplectic geometry [2, 10, 13]. Time-dependent systems can also be geometrically formulated as the Reeb dynamics of a contact system. Both symplectic and cosymplectic structures are particular instances of Poisson geometry [22, 39, 50].

Recently, the application of contact geometry to the study of dynamical systems has grown significantly [4, 18, 26]. This is due to the fact that contact geometry is not only a way to geometrically model the time-dependency in mechanical systems [23], which can also be done by means of cosymplectic geometry, but it also allows us to describe mechanical systems with certain types of damping, quantum mechanics [14], circuit theory [31], control theory [45] and thermodynamics [5, 48], among many others [41]. In recent papers [7, 8], the authors consider time-dependent systems, although a rigorous geometric description of time-dependent contact mechanics is in order. These systems include mechanical systems with time-dependent external forces and, in particular, controlled systems whose controls can be used to compensate the damping.

Let us recall that the variational approach to contact systems is based on Herglotz’s principle [36] (see for instance [15,16,17]). This variational principle generalizes the Hamilton principle and it is appropriate to deal with action-dependent Lagrangians. From the geometric perspective, it is important to point out that contact structures are not Poisson, but Jacobi. This is due to the fact that the Leibniz rule is not fulfilled [18].

In the present paper, we develop a formalism in order to geometrically describe contact mechanical systems with explicit time-dependence. We begin by introducing a new geometric structure: cocontact manifolds. These manifolds extend the notion of both contact and cosymplectic structures. We study the properties of these manifolds, exhibit some examples, prove a Darboux-type theorem for these structures, and show that cocontact manifolds are Jacobi manifolds. In addition, we introduce the notion of cocontact orthogonal complement of a submanifold and define and characterize the coisotropic and Legendrian submanifolds of a cocontact manifold. This geometric framework is later used to develop both Hamiltonian and Lagrangian formulations of time-dependent mechanical systems with dissipation.

The introduction of time-dependence makes us consider systems subjected to constraints that can vary with time. Such systems can be described by introducing the constraints in the Lagrangian via Lagrange multipliers. These Lagrangians are obviously singular, since the velocity associated to the Lagrange multipliers do not appear in the expression of the Lagrangian. In order to study such systems, we introduce the notion of precocontact structure as a weakened version of a cocontact structure, and describe a suitable constraint algorithm.

The structure of the paper is as follows. In Sect. 2, we describe the geometrical setting that will be used throughout the paper. We present the notion of cocontact manifold and some examples. In particular, we see that cocontact manifolds are Jacobi manifolds, and thus all the theory about Jacobi structures is applicable to cocontact structures. Section 3 is devoted to develop a Hamiltonian formulation for dissipative time-dependent systems, while Sect. 4 dedicated to develop the Lagrangian formulation for cocontact systems and state the associated generalized Herglotz–Euler–Lagrange equations. In Sect. 5 we study the case of mechanical systems described by singular time-dependent contact Lagrangians and give a description of the constraint algorithm to obtain the dynamics in both the Hamiltonian and Lagrangian formulations. Section 6 is devoted to analyze the case of damped mechanical systems with holonomic constraints which can depend on time. Finally, in Sect. 7, three examples are presented and worked out: the damped forced harmonic oscillator, a system with time-dependent mass subjected to a central force with friction, and the damped pendulum with variable length. We also show and discuss some simulations of these systems.

Throughout the paper all the manifolds and mappings are assumed to be smooth and second-countable. Sum over crossed repeated indices is understood.

2 Geometrical setting

2.1 Cocontact manifolds

Definition 2.1

Let M be a manifold of dimension \(2n+2\). A cocontact structure on M is a couple \((\tau ,\eta )\) of 1-forms on M such that \(\tau \) is closed and such that \(\tau \wedge \eta \wedge (\mathrm {d}\eta )^{\wedge n}\) is a volume form on M. Under these hypotheses, \((M,\tau ,\eta )\) is called a cocontact manifold.

We can see from this definition that every cocontact manifold has two tangent distributions. The first one is generated by \(\ker \tau \), is integrable, and gives a foliation made of contact leaves. The other one is \(\ker \eta \) and it is not integrable. This structure will be very useful when proving the Darboux theorem.

Example 2.2

Let \((P,\eta _0)\) be a contact manifold and consider the product manifold \(M = {\mathbb {R}}\times P\). Denoting by \(\mathrm {d}t\) the pullback to M of the volume form in \({\mathbb {R}}\) and denoting by \(\eta \) the pullback of \(\eta _0\) to M, we have that \((\mathrm {d}t, \eta )\) is a cocontact structure on M.

Example 2.3

Let \((P,\tau ,-\mathrm {d}\theta )\) be an exact cosymplectic manifold and consider the product manifold \(M = P\times {\mathbb {R}}\). Denoting by s the coordinate in \({\mathbb {R}}\) we define the 1-form \(\eta = \mathrm {d}s - \theta \). Then, \((\tau , \eta )\) is a cocontact structure on \(M = P\times {\mathbb {R}}\).

Example 2.4

(Canonical cocontact manifold) Let Q be an n-dimensional smooth manifold with local coordinates \((q^i)\) and its cotangent bundle \(\mathrm {T}^*Q\) with induced natural coordinates \((q^i, p_i)\). Consider the product manifolds \({\mathbb {R}}\times \mathrm {T}^*Q\) with coordinates \((t, q^i, p_i)\), \(\mathrm {T}^*Q\times {\mathbb {R}}\) with coordinates \((q^i, p_i, s)\) and \({\mathbb {R}}\times \mathrm {T}^*Q\times {\mathbb {R}}\) with coordinates \((t, q^i, p_i, s)\) and the canonical projections

figure a

Let \(\theta _0\in \Omega ^1(\mathrm {T}^*Q)\) be the canonical 1-form of the cotangent bundle, which has local expression \(\theta _0 = p_i\mathrm {d}q^i\). Denoting by \(\theta _2 = \pi _2^*\theta \), we have that \((\mathrm {d}t, \theta _2)\) is a cosymplectic structure in \({\mathbb {R}}\times \mathrm {T}^*Q\).

On the other hand, denoting by \(\theta _1 = \pi _1^*\theta _0\), we have that \(\eta _1 = \mathrm {d}s - \theta _1\) is a contact form in \(\mathrm {T}^*Q\times {\mathbb {R}}\).

Finally, consider the 1-form \(\theta = \rho _1^*\theta _2 = \rho _2^*\theta _1 = \pi ^*\theta _0\in \Omega ^1({\mathbb {R}}\times \mathrm {T}^*Q\times {\mathbb {R}})\) and let \(\eta = \mathrm {d}s - \theta \). Then, \((\mathrm {d}t, \eta )\) is a cocontact structure in \({\mathbb {R}}\times \mathrm {T}^*Q\times {\mathbb {R}}\). The local expression of the 1-form \(\eta \) is

$$\begin{aligned} \eta = \mathrm {d}s - p_i\mathrm {d}q^i\,. \end{aligned}$$

Proposition 2.5

Let \((M,\tau ,\eta )\) be a cocontact manifold. We have the following isomorphism of vector bundles:

$$\begin{aligned} \begin{array}{rccl} \flat :&{} \mathrm {T}M &{} \longrightarrow &{} \mathrm {T}^*M \\ &{} v &{} \longmapsto &{} (i(v)\tau )\tau + i(v)\mathrm {d}\eta + \left( i(v)\eta \right) \eta \end{array} \end{aligned}$$

Proof

It is clear that \(\ker \flat = 0\), since M is a cocontact manifold. Hence, it follows that \(\flat \) has to be an isomorphism. \(\square \)

This isomorphism can be extended to an isomorphism of \({\mathscr {C}}^\infty (M)\)-modules:

$$\begin{aligned} \begin{array}{rccl} \flat :&{} {\mathfrak {X}}(M) &{} \longrightarrow &{} \Omega ^1(M) \\ &{} X &{} \longmapsto &{} (i(X)\tau )\tau + i(X)\mathrm {d}\eta + \left( i(X)\eta \right) \eta \end{array} \end{aligned}$$

Proposition 2.6

Given a cocontact manifold \((M,\tau ,\eta )\), there exist two vector fields \(R_t,R_s\in {\mathfrak {X}}(M)\), called Reeb vector fields, satisfying the conditions

$$\begin{aligned} \left\{ \begin{array}{ll} i(R_t)\tau = 1\,,\\ i(R_t)\eta = 0\,,\\ i(R_t)\mathrm {d}\eta = 0\,, \end{array}\right. \qquad \left\{ \begin{array}{ll} i(R_s)\tau = 0\,,\\ i(R_s)\eta = 1\,,\\ i(R_s)\mathrm {d}\eta = 0\,. \end{array}\right. \end{aligned}$$

\(R_t\) is the time Reeb vector field and \(R_s\) is the contact Reeb vector field.

Taking into account the isomorphism \(\flat \) introduced above, we can give an alternative definition of the Reeb vector fields:

$$\begin{aligned} R_t = \flat ^{-1}(\tau )\ ,\quad R_s = \flat ^{-1}(\eta )\,. \end{aligned}$$

Theorem 2.7

(Darboux theorem for cocontact manifolds) Let \((M,\tau ,\eta )\) be a cocontact manifold. Then, for every point \(p\in M\), there exists a local chart \((U; t, q^i, p_i, s)\) around p such that

These coordinates are called canonical or Darboux coordinates. Moreover, in Darboux coordinates, the Reeb vector fields are

Proof

The idea of the proof is the following: in every cocontact manifold there is a contact foliation made of leaves of the distribution generated by \(\ker \tau \) (which are \((2n+1)\)-submanifolds) and, on each of them, the restriction of \(\eta \) is a contact form. Now, we can take local coordinates adapted to the foliation and, on each leaf, use the Darboux theorem for contact manifolds. Hence, we have local coordinates \(({\tilde{t}}, q^i, p_i, s)\) such that \(\eta = \mathrm {d}s - p_i\mathrm {d}q^i\). Finally, we can write \(\tau \) as a combination of all these coordinates, \(\tau = f({\tilde{t}}, q^i, p_i, s)\mathrm {d}{\tilde{t}}\), where f is a non-vanishing function, and then we can redefine the coordinate t. \(\square \)

Remark 2.8

Consider a cocontact manifold \((M,\tau ,\eta )\) such that \(\tau = \mathrm {d}t\). Then, the two-form

$$\begin{aligned} \Omega = e^{-t}(\mathrm {d}\eta + \eta \wedge \tau ) \end{aligned}$$

is a symplectic form on M. Moreover, the two-form \(\Omega \) is exact, since

$$\begin{aligned} \Omega = \mathrm {d}(e^{-t}\eta )\,. \end{aligned}$$

2.2 Cocontact manifolds as Jacobi manifolds

It is known that symplectic, cosymplectic and contact manifolds are particular instances of a more general geometric structure: Jacobi manifolds. Then, it is reasonable to think that cocontact manifolds should also be Jacobi manifolds.

2.2.1 Jacobi manifolds

Definition 2.9

A Jacobi manifold is a triple \((M,\Lambda ,E)\), where \(\Lambda \) is a bivector field on M, i.e. a skew-symmetric 2-contravariant tensor field, and E is a vector field on M, such that

$$\begin{aligned} {}[\Lambda ,\Lambda ] = 2E\wedge \Lambda \ ,\qquad {\mathscr {L}}_E\Lambda = [E,\Lambda ] = 0\,, \end{aligned}$$

where \([\cdot ,\cdot ]\) denotes the Schouten–Nijenhuis bracket [44, 47].

Given a Jacobi manifold \((M,\Lambda ,E)\), we can define a bilinear map on the space of smooth functions on M, called the Jacobi bracket, given by

$$\begin{aligned} \{f,g\} = \Lambda (\mathrm {d}f,\mathrm {d}g) + fE(g) - gE(f)\,. \end{aligned}$$

The Jacobi bracket is bilinear, skew-symmetric, satisfies the Jacobi identity and fulfills the weak Leibniz rule

$$\begin{aligned} {{\,\mathrm{Supp}\,}}(\{f,g\}) \subseteq {{\,\mathrm{Supp}\,}}(f) \cap {{\,\mathrm{Supp}\,}}(g)\,. \end{aligned}$$
(1)

Hence, the set of smooth maps \({\mathscr {C}}^\infty (M)\) equipped with the Jacobi bracket \(\{\cdot ,\cdot \}\) is a local Lie algebra in the sense of Kirillov.

The converse is also true: given a local Lie algebra structure on \({\mathscr {C}}^\infty (M)\), one can define a Jacobi structure \((\Lambda ,E)\) on M such that its Jacobi bracket coincides with the bracket of the local Lie algebra bracket [37, 40].

Definition 2.10

Given a Jacobi manifold \((M,\Lambda ,E)\), we can define the morphism of vector bundles

$$\begin{aligned} {{\hat{\Lambda }}}:\mathrm {T}^*M\rightarrow \mathrm {T}M\,, \end{aligned}$$

given by \({{\hat{\Lambda }}}(\alpha ) = \Lambda (\alpha ,\cdot )\). This morphism of vector bundles induces a morphism of \({\mathscr {C}}^\infty (M)\)-modules \({{\hat{\Lambda }}}:\Omega ^1(M)\rightarrow {\mathfrak {X}}(M)\).

Given a smooth function \(f\in {\mathscr {C}}^\infty (M)\), we define the Hamiltonian vector field associated with f as

$$\begin{aligned} X_f = {{\hat{\Lambda }}}(\mathrm {d}f) + fE\,. \end{aligned}$$

The characteristic distribution \({\mathcal {C}}\) of \((M,\Lambda ,E)\) is spanned by these vector fields \(X_f\). It is integrable, and it can be defined in terms of the bivector \(\Lambda \) and the vector field E as

$$\begin{aligned} {\mathcal {C}}= {{\hat{\Lambda }}}(\mathrm {T}^*M) + \langle E \rangle \,. \end{aligned}$$

In general, the morphism \({{\hat{\Lambda }}}\) is not an isomorphism, as can be seen in the following example.

Example 2.11

(Contact manifolds) Consider a contact manifold \((M,\eta )\). We have the \({\mathscr {C}}^\infty (M)\)-module isomorphism \(\flat :{\mathfrak {X}}(M)\rightarrow \Omega ^1(M)\) given by

$$\begin{aligned} \flat (X) = i(X)\mathrm {d}\eta + (i(X)\eta )\eta \,, \end{aligned}$$

and we denote its inverse by \(\sharp = \flat ^{-1}\). The Reeb vector field is \(R = \sharp \eta \).

Then we can define a Jacobi structure \((\Lambda ,E)\) on M given by

$$\begin{aligned} \Lambda (\alpha ,\beta ) = -\mathrm {d}\eta (\sharp \alpha ,\sharp \beta )\ ,\quad E = -R\,. \end{aligned}$$

In this case, the morphism \({{\hat{\Lambda }}}\) is given by

$$\begin{aligned} {{\hat{\Lambda }}}(\alpha ) = \sharp (\alpha ) - \alpha (R)R\,, \end{aligned}$$

and it is clear that \({{\hat{\Lambda }}}\) is not an isomorphism, since \(\ker {{\hat{\Lambda }}} = \langle \eta \rangle \) and \({{\,\mathrm{Im}\,}}{{\hat{\Lambda }}} = \ker \eta \).

Example 2.12

(Poisson manifolds) A Poisson manifold is a smooth manifold M such that \({\mathscr {C}}^\infty (M)\) has a Lie bracket satisfying the Leibniz rule

$$\begin{aligned} \{fg,h\} = f\{g,h\} + \{f,h\}g\,. \end{aligned}$$

It can be seen that this implies the weak Leibniz rule (1), thus giving a local Lie algebra structure to the set of smooth functions on M. One can prove that the Jacobi bracket of a Jacobi manifold \((M,\Lambda ,E)\) is Poisson if and only if \(E=0\). Taking this into account, a Poisson manifold is a Jacobi manifold with \(E=0\). We can redefine the notion of Poisson manifold as a couple \((M,\Lambda )\), where \(\Lambda \) is a bivector such that \([\Lambda ,\Lambda ] = 0\).

We know that both symplectic and cosymplectic manifolds are Poisson. Hence, they are also Jacobi manifolds with

$$\begin{aligned} \Lambda (\alpha ,\beta ) = \omega (\sharp \alpha ,\sharp \beta )\ ,\quad E = 0\,, \end{aligned}$$

where \(\omega \) is the 2-form of the symplectic or cosymplectic manifold and \(\sharp \) is the inverse of the flat morphism \(\flat \) of the symplectic or cosymplectic manifold.

2.2.2 Jacobi structure of cocontact manifolds

Consider now a cocontact manifold \((M,\tau ,\eta )\). In Darboux coordinates, the flat isomorphism reads

$$\begin{aligned} \flat \left( \frac{\partial }{\partial t}\right)&= \mathrm {d}t = \tau \,,\\ \flat \left( \frac{\partial }{\partial q^i}\right)&= \mathrm {d}p_i - p_i\mathrm {d}s + p_i^2\mathrm {d}q^i\,,\\ \flat \left( \frac{\partial }{\partial p_i}\right)&= -\mathrm {d}q^i\,,\\ \flat \left( \frac{\partial }{\partial s}\right)&= \mathrm {d}s - p_i\mathrm {d}q^i = \eta \,. \end{aligned}$$

Its inverse is the isomorphism \(\sharp :\Omega ^1(M)\rightarrow {\mathfrak {X}}(M)\), which is given by

$$\begin{aligned} \sharp \mathrm {d}t&= \frac{\partial }{\partial t}\,,\\ \sharp \mathrm {d}q^i&= -\frac{\partial }{\partial p_i}\,,\\ \sharp \mathrm {d}p_i&= p_i\frac{\partial }{\partial s} + \frac{\partial }{\partial q^i}\,,\\ \sharp \mathrm {d}s&= \frac{\partial }{\partial s} - p_i\frac{\partial }{\partial p_i}\,. \end{aligned}$$

We can define a 2-contravariant skew-symmetric tensor \(\Lambda \):

$$\begin{aligned} \Lambda (\alpha ,\beta ) = -\mathrm {d}\eta (\sharp \alpha ,\sharp \beta )\,, \end{aligned}$$

which in Darboux coordinates reads

$$\begin{aligned} \Lambda = \frac{\partial }{\partial q^i}\wedge \frac{\partial }{\partial p_i} - p_i\frac{\partial }{\partial p_i}\wedge \frac{\partial }{\partial s}\,. \end{aligned}$$

Proposition 2.13

Let \((M,\tau ,\eta )\) be a cocontact manifold. Then, \((\Lambda ,E)\), where \(E = -R_s\), is a Jacobi structure on M.

The previous proposition can be proved using Darboux coordinates. Using Darboux coordinates, the Jacobi bracket reads

$$\begin{aligned} \{f,g\} = \frac{\partial f}{\partial q^i}\frac{\partial g}{\partial p_i} - \frac{\partial g}{\partial q^i}\frac{\partial f}{\partial p_i} - p_i\left( \frac{\partial f}{\partial p_i}\frac{\partial g}{\partial s} - \frac{\partial g}{\partial p_i}\frac{\partial f}{\partial s} \right) - f\frac{\partial g}{\partial s} + g\frac{\partial f}{\partial s}\,. \end{aligned}$$

In particular, one has

$$\begin{aligned} \{q^i,q^j\} = \{p_i, p_j\} = 0\,,\qquad \{q^i, p_j\} = \delta _j^i\,,\qquad \{q^i, s\} = -q^i\,,\qquad \{p_i,s\} = -2p_i\,. \end{aligned}$$

2.2.3 Legendrian submanifolds

In the previous section we have seen that every cocontact manifold \((M,\tau ,\eta )\) is a Jacobi manifold taking \(\Lambda (\alpha ,\beta ) = -\mathrm {d}\eta (\sharp \alpha ,\sharp \beta )\) and \(E = -R_s\). We will study a special kind of submanifolds associated to this structure.

In first place, we find a new expression for the morphism \({{\hat{\Lambda }}}\) which is easier to manipulate. We have

$$\begin{aligned} \alpha = \flat \sharp \alpha = i_{\sharp \alpha }\mathrm {d}\eta + (i_{\sharp \alpha }\eta )\eta + (i_{\sharp \alpha }\tau )\tau \,, \end{aligned}$$

and contracting with the Reeb vector fields \(R_s,R_t\), we get

$$\begin{aligned} \alpha (R_t) = i_{\sharp \alpha }\tau \,,\qquad \alpha (R_s) = i_{\sharp \alpha }\eta \,. \end{aligned}$$

Now,

$$\begin{aligned} \beta ({{\hat{\Lambda }}}(\alpha ))&= -i_{\sharp \beta }i_{\sharp \alpha }\mathrm {d}\eta \\&= i_{\sharp \alpha }i_{\sharp \beta }\mathrm {d}\eta \\&= i_{\sharp \alpha }\left( \beta - (i_{\sharp \beta }\eta )\eta - (i_{\sharp \beta }\tau )\tau \right) \\&= \beta (\sharp \alpha ) - \beta (R_s)\alpha (R_s) - \beta (R_t)\alpha (R_t)\\&= \beta \left( \sharp \alpha - \alpha (R_s)R_s - \alpha (R_t)R_t \right) \,, \end{aligned}$$

and thus

$$\begin{aligned} {{\hat{\Lambda }}}(\alpha ) = \sharp \alpha - \alpha (R_s)R_s - \alpha (R_t)R_t\,. \end{aligned}$$

It is clear that \(\tau ,\eta \in \ker {{\hat{\Lambda }}}\). Consider \(\beta \in \ker {{\hat{\Lambda }}}\). Then, \(\sharp \beta = \beta (R_s)R_s + \beta (R_t)R_t\). Using the morphism \(\flat \), we have that

$$\begin{aligned} \beta = \beta (R_s)\eta + \beta (R_t)\tau \,. \end{aligned}$$

Hence, we have that \(\ker {{\hat{\Lambda }}} = \langle \tau ,\eta \rangle \).

Definition 2.14

Let \((M,\tau ,\eta )\) be a cocontact manifold and consider a submanifold \(N\subset M\). We define the cocontact orthogonal complement of N as

$$\begin{aligned} \mathrm {T}_pN^\perp = {{\hat{\Lambda }}}\left( (T_pN)^\circ \right) \,. \end{aligned}$$

Notice that \(v\in \mathrm {T}_pN^\perp \) if, and only if, there exists \(\alpha \in \mathrm {T}^*_pN\) such that \({{\hat{\Lambda }}}(\alpha ) = v\) and \(\alpha (u) = 0\) for every \(u\in \mathrm {T}_pN\).

Definition 2.15

Let \((M,\tau ,\eta )\) be a cocontact manifold and consider a submanifold \(N\hookrightarrow M\).

  1. (i)

    N is said to be coisotropic if \(\mathrm {T}N^\perp \subset \mathrm {T}N\).

  2. (ii)

    N is said to be isotropic if \(\mathrm {T}N \subset \mathrm {T}N^\perp \).

  3. (iii)

    N is said to be Legendrian if \(\mathrm {T}N = \mathrm {T}N^\perp \).

The following theorem characterizes isotropic and Legendrian submanifolds.

Theorem 2.16

Consider a cocontact manifold \((M,\tau ,\eta )\) with \(\dim M = 2n+2\) and a submanifold \(j:N\hookrightarrow M\). Then,

  1. (i)

    N is isotropic if and only if \(j^*\eta = 0\) and \(j^*\tau = 0\).

  2. (ii)

    N is Legendrian if and only if \(j^*\eta = 0\), \(j^*\tau = 0\) and \(\dim N = n\).

Proof

  1. (i)

    Suppose \(\mathrm {T}N \subset \mathrm {T}N^\perp \). Let \(v\in \mathrm {T}_p N\), then \(v\in \mathrm {T}_pN^\perp \) and hence there exists some \(\alpha \in \mathrm {T}^*_pN\) such that \({{\hat{\Lambda }}}(\alpha ) = v\) and \(\alpha (u) = 0\) for every \(u\in \mathrm {T}_pN\). Then,

    $$\begin{aligned} \eta (v) = \eta ({{\hat{\Lambda }}}(\alpha )) = \eta (\sharp \alpha ) - \alpha (R_s)R_s - 0 = 0\,. \end{aligned}$$

    Since \(\eta _p(v) = 0\) for every \(p\in N\) and every \(v\in \mathrm {T}_pN\), we have \(j^*\eta = 0\). Analogously, \(j^*\tau = 0\).

    Conversely, suppose \(j^*\eta = 0\) and \(j^*\tau = 0\). Let \(v\in \mathrm {T}_pN\). We want to check that \(v\in \mathrm {T}_pN^\perp \). Consider

    $$\begin{aligned} \alpha = i_v\mathrm {d}\eta \,. \end{aligned}$$

    Since \(j^*\eta = 0\), we have \(j^*\mathrm {d}\eta = \mathrm {d}j^*\eta = 0\) and thus \(i_ui_v\mathrm {d}\eta = \alpha (u) = 0\) for every \(u\in \mathrm {T}_pN\). Now, we want to check that

    $$\begin{aligned} v = {{\hat{\Lambda }}}(\alpha ) = \sharp \alpha - \alpha (R_s)R_s - \alpha (R_t)R_t = \sharp \alpha \,. \end{aligned}$$

    Since \(\flat \) is an isomorphism, this is the same as checking that \(\flat (v) = \alpha \), which is obvious taking into account that \(j^*\eta = 0\) and \(j^*\tau = 0\). Finally, we have already proved that \(\alpha (\mathrm {T}_pN) = 0\).

  2. (ii)

    Suppose that \(\mathrm {T}N = \mathrm {T}N^\perp \) and let \(k = \dim N\). Thus, at any point \(p\subset N\),

    $$\begin{aligned} \dim \mathrm {T}_pN^\circ = 2n+2 - \dim \mathrm {T}_pN = 2n+2-k\,. \end{aligned}$$

    Since \(\mathrm {T}N\subset \mathrm {T}N^\perp \), we have that \(\tau _p,\eta _p\in \mathrm {T}_pN^\circ \) and then \(\ker {{\hat{\Lambda }}}_p\subset \mathrm {T}_pN^\circ \). Now, since \(T_pN = T_pN^\perp = {{\hat{\Lambda }}}_p(\mathrm {T}_pN^\circ )\),

    $$\begin{aligned} \underbrace{\dim \mathrm {T}_pN^\circ }_{2n+2-k} = \underbrace{\dim {{\hat{\Lambda }}}_p(\mathrm {T}_pN^\circ )}_{k} + \underbrace{\dim \ker {{\hat{\Lambda }}}_p}_{2}\,, \end{aligned}$$

    which implies that \(k = n\). Conversely, we have that \(2n+2-n = \dim \mathrm {T}_pN^\perp + 2\) and thus \(\dim \mathrm {T}_pN^\perp = n = \dim \mathrm {T}_pN\). Since \(\mathrm {T}_pN\subset \mathrm {T}_pN^\perp \), it is clear that \(\mathrm {T}_pN = \mathrm {T}_pN^\perp \).

\(\square \)

3 Cocontact Hamiltonian systems

We can use the cocontact geometric framework developed in the previous section to deal with Hamiltonian systems with dissipation and with explicit time dependence.

Definition 3.1

A cocontact Hamiltonian system is a tuple \((M,\tau ,\eta ,H)\) where \((M,\tau ,\eta )\) is a cocontact manifold and \(H\in {\mathscr {C}}^\infty (M)\) is a Hamiltonian function.

The cocontact Hamilton equations for a curve \(\psi :I\subset {\mathbb {R}}\rightarrow M\) are

$$\begin{aligned} \left\{ \begin{array}{ll} i(\psi ')\mathrm {d}\eta = \mathrm {d}H-({\mathscr {L}}_{R_s}H)\eta -({\mathscr {L}}_{R_t}H)\tau \,, \\ i(\psi ')\eta = -H\,, \\ i(\psi ')\tau = 1\,, \end{array}\right. \end{aligned}$$
(2)

where \(\psi ':I\subset {\mathbb {R}}\rightarrow \mathrm {T}M\) is the canonical lift of the curve \(\psi \) to the tangent bundle \(\mathrm {T}M\).

Let us express these equations using Darboux coordinates (see Theorem 2.7). Consider the curve \(\psi (r)=(f(r),q^i(r),p_i(r),s(r))\). The third equation in (2) imposes that \(f(r)=r\), thus we will denote \(r\equiv t\). The other equations become:

$$\begin{aligned} \left\{ \begin{array}{ll} \dot{q}^i =\frac{\partial H}{\partial p_i}\,, \\ \dot{p}_i =-\left( \frac{\partial H}{\partial q^i}+p_i\frac{\partial H}{\partial s}\right) \,, \\ \dot{s} =p_ i\frac{\partial H}{\partial p_i}-H\,. \end{array}\right. \end{aligned}$$

We can give another interpretation of these equations using vector fields.

Definition 3.2

Let \((M,\tau ,\eta ,H)\) be a cocontact Hamiltonian system. The cocontact Hamiltonian equations for a vector field \(X\in {\mathfrak {X}}(M)\) are:

$$\begin{aligned} \left\{ \begin{array}{ll} i(X)\mathrm {d}\eta = \mathrm {d}H-({\mathscr {L}}_{R_s}H)\eta -({\mathscr {L}}_{R_t}H)\tau \,, \\ i(X)\eta = -H\,, \\ i(X)\tau = 1\,. \end{array}\right. \end{aligned}$$
(3)

Equations (3) can be rewritten using the isomorphism \(\flat \) as

$$\begin{aligned} \flat (X)=\mathrm {d}H-\left( {\mathscr {L}}_{R_s}H+H\right) \eta +\left( 1-{\mathscr {L}}_{R_t}H\right) \tau \,. \end{aligned}$$

Therefore, it is clear that the cocontact Hamilton equations (3) have a unique solution. The solution to this equations is called the cocontact Hamiltonian vector field, and will be denoted by \(X_H\). Its local expression is

$$\begin{aligned} X_H = \frac{\partial }{\partial t} + \frac{\partial H}{\partial p_i}\frac{\partial }{\partial q^i} - \left( \frac{\partial H}{\partial q^i} + p_i\frac{\partial H}{\partial s}\right) \frac{\partial }{\partial p_i} + \left( p_i\frac{\partial H}{\partial p_i} - H\right) \frac{\partial }{\partial s}\,. \end{aligned}$$

Remark 3.3

It can be seen that the vector field \(X_H - R_t\) coincides with the one for the associated Jacobi manifold given in the preceding section.

Proposition 3.4

Let X be a vector field in M. Then every integral curve \(\psi :U\subset {\mathbb {R}}\rightarrow M\) of X satisfies the cocontact equations (2) if, and only if, X is a solution to (3).

Proof

This is a direct consequence of equations (2) and (3), and the fact that any point of M is in the image of an integral curve of X. \(\square \)

4 Cocontact Lagrangian systems

4.1 Lagrangian phase space and geometric structures

Let Q be a smooth n-dimensional manifold. Consider the product manifold \({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\) endowed with natural coordinates \((t, q^i, v^i, s)\). We have the canonical projections

$$\begin{aligned} \tau _1&:{\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\rightarrow {\mathbb {R}}\ ,&\tau _1(t, v_q, s) = t\,,\\ \tau _2&:{\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\rightarrow \mathrm {T}Q\ ,&\tau _2(t, v_q, s) = v_q\,,\\ \tau _3&:{\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\rightarrow {\mathbb {R}}\ ,&\tau _3(t, v_q, s) = s\,,\\ \tau _0&:{\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\rightarrow {\mathbb {R}}\times Q\times {\mathbb {R}}\ ,&\tau _0(t, v_q, s) = (t, q, s)\,. \end{aligned}$$

Notice that \(\tau _2\) and \(\tau _0\) are the projection maps of two vector bundle structures. Usually, we will have in mind the projection \(\tau _0\). In fact, the vector bundle \({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\overset{\tau _0}{\longrightarrow }{\mathbb {R}}\times Q\times {\mathbb {R}}\) is the pull-back of the tangent bundle with respect to the map \({\mathbb {R}}\times Q\times {\mathbb {R}}\rightarrow Q\).

Our goal is to develop a time-dependent contact Lagrangian formalism on the manifold \({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\). The usual geometric structures of the tangent bundle can be naturally extended to the cocontact Lagrangian phase space \({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\). In particular, the vertical endomorphism of \(\mathrm {T}(\mathrm {T}Q)\) yields a \(\tau _0\)-vertical endomorphism \({\mathcal {J}}:\mathrm {T}({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}})\rightarrow \mathrm {T}({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}})\). In the same way, the Liouville vector field on the fibre bundle \(\mathrm {T}Q\) gives a Liouville vector field \(\Delta \in {\mathfrak {X}}({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}})\). Actually, this Liouville vector field coincides with the Liouville vector field of the vector bundle \(\tau _0\). The local expressions of these objects in Darboux coordinates are

$$\begin{aligned} \mathcal{J} = \frac{\partial }{\partial v^i} \otimes \mathrm {d}q^i \,,\quad \Delta = v^i\, \frac{\partial }{\partial v^i} \,. \end{aligned}$$

Definition 4.1

Let \(\mathbf{c} :{\mathbb {R}}\rightarrow {\mathbb {R}}\times Q\times {\mathbb {R}}\) be a path, with \(\mathbf{c} = ({\mathbf {c}}_1,{\mathbf {c}}_2,{\mathbf {c}}_3)\). The prolongation of \(\mathbf{c}\) to \({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\) is the path

$$\begin{aligned} {{\tilde{\mathbf{c}}}} = ({\mathbf {c}}_1,{\mathbf {c}}_2',{\mathbf {c}}_3) :{\mathbb {R}}\longrightarrow {\mathbb {R}}\times \mathrm {T}Q \times {\mathbb {R}}\,, \end{aligned}$$

where \({\mathbf {c}}_2'\) is the velocity curve of \({\mathbf {c}}_2\). Every path \({ {\tilde{\mathbf{c}}}}\) which is the prolongation of a path \(\mathbf{c} :{\mathbb {R}}\rightarrow {\mathbb {R}}\times Q\times {\mathbb {R}}\) is said to be holonomic. A vector field \(\Gamma \in {\mathfrak {X}}({\mathbb {R}}\times \mathrm {T}Q \times {\mathbb {R}})\) is said to satisfy the second-order condition (for short: it is a sode) when all of its integral curves are holonomic.

This definition can be equivalently expressed in terms of the canonical structures defined above:

Proposition 4.2

A vector field \(\Gamma \in {\mathfrak {X}}({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}})\) is a sode if, and only if, \(\mathcal{J} \circ \Gamma = \Delta \).

In natural coordinates, if \(\mathbf{c}(r)=(t(r), c^i(r), s(r))\), then

$$\begin{aligned} {{\tilde{\mathbf{c}}}}(r) = \left( t(r), c^i(r),\frac{\mathrm {d}c^i}{\mathrm {d}r}(r), s(r) \right) \,. \end{aligned}$$

The local expression of a sode is

$$\begin{aligned} \Gamma = f\frac{\partial }{\partial t} + v^i \frac{\partial }{\partial q^i} + G^i \frac{\partial }{\partial v^i} + g\,\frac{\partial }{\partial s}\,. \end{aligned}$$
(4)

So, in coordinates a sode defines a system of differential equations of the form

$$\begin{aligned} \frac{\mathrm {d}t}{\mathrm {d}r} = f(t, q, \dot{q}, s)\,,\quad \frac{\mathrm {d}^2 q^i}{\mathrm {d}r^2} = G^i(t, q,\dot{q},s) \,, \quad \frac{\mathrm {d}s}{\mathrm {d}r} = g(t, q,\dot{q},s) \,. \end{aligned}$$

4.2 Cocontact Lagrangian systems

Definition 4.3

A Lagrangian function is a function \({\mathcal {L}}:{\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\rightarrow {\mathbb {R}}\). The Lagrangian energy associated to \({\mathcal {L}}\) is the function \(E_{\mathcal {L}}:= \Delta ({\mathcal {L}})-{\mathcal {L}}\in {\mathscr {C}}^\infty ({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}})\). The Cartan forms associated to \({\mathcal {L}}\) are defined as

(5)

The contact Lagrangian form is

$$\begin{aligned} \eta _{\mathcal {L}}=\mathrm {d}s-\theta _{\mathcal {L}}\in \Omega ^1({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}})\,. \end{aligned}$$

Notice that \(\mathrm {d}\eta _{\mathcal {L}}=\omega _{\mathcal {L}}\). The couple \(({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}},{\mathcal {L}})\) is a cocontact Lagrangian system.

Taking natural coordinates \((t, q^i, v^i, s)\) in \({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\), the form \(\eta _{\mathcal {L}}\) is written as

$$\begin{aligned} \eta _{\mathcal {L}}= \mathrm {d}s - \frac{\partial {\mathcal {L}}}{\partial v^i} \,\mathrm {d}q^i \,, \end{aligned}$$
(6)

and consequently

$$\begin{aligned} \mathrm {d}\eta _{\mathcal {L}}= -\frac{\partial ^2 {\mathcal {L}}}{\partial t\partial v^i}\mathrm {d}t\wedge \mathrm {d}q^i -\frac{\partial ^2 {\mathcal {L}}}{\partial q^j\partial v^i}\mathrm {d}q^j\wedge \mathrm {d}q^i -\frac{\partial ^2 {\mathcal {L}}}{\partial v^j\partial v^i}\mathrm {d}v^j\wedge \mathrm {d}q^i -\frac{\partial ^2 {\mathcal {L}}}{\partial s\partial v^i}\mathrm {d}s\wedge \mathrm {d}q^i \ . \end{aligned}$$

Notice that, in general, given a cocontact Lagrangian system \(({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}},{\mathcal {L}})\), the family \(({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}},\tau =\mathrm {d}t,\eta _{\mathcal {L}}, E_{\mathcal {L}})\) is not a cocontact Hamiltonian system because condition \(\tau \wedge \eta \wedge (\mathrm {d}\eta _{\mathcal {L}})^n\ne 0\) is not fulfilled. The Legendre map characterizes which Lagrangian functions will give cocontact Hamiltonian systems.

Definition 4.4

Given a Lagrangian \({\mathcal {L}}:{\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\rightarrow {\mathbb {R}}\), its Legendre map is the fibre derivative of \({\mathcal {L}}\), considered as a function on the vector bundle \(\tau _0 :{\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\rightarrow {\mathbb {R}}\times Q \times {\mathbb {R}}\); that is, the map \({\mathcal {F}}{\mathcal {L}}:{\mathbb {R}}\times \mathrm {T}Q \times {\mathbb {R}}\rightarrow {\mathbb {R}}\times \mathrm {T}^*Q \times {\mathbb {R}}\) given by

$$\begin{aligned} {\mathcal {F}}{\mathcal {L}}(t,v_q,s) = \left( t,{\mathcal {F}}{\mathcal {L}}(t,\cdot ,s) (v_q),s \right) \,, \end{aligned}$$

where \({\mathcal {F}}{\mathcal {L}}(t,\cdot ,s)\) is the usual Legendre map associated to the Lagrangian \({\mathcal {L}}(t,\cdot ,s):\mathrm {T}Q\rightarrow {\mathbb {R}}\) with t and s freezed.

Notice that the Cartan forms can also be defined as

$$\begin{aligned} \theta _{\mathcal {L}}=\mathcal{FL}\mathcal{}^{\;*}(\pi ^*\theta _0)\,,\quad \omega _{\mathcal {L}}=\mathcal{FL}\mathcal{}^{\;*}(\pi ^*\omega _0)\,, \end{aligned}$$

where \(\theta _0\) and \(\omega _0 = -\mathrm {d}\theta _0\) are the canonical 1- and 2-forms of the cotangent bundle and \(\pi \) is the natural projection \(\pi :{\mathbb {R}}\times \mathrm {T}^*Q\times {\mathbb {R}}\rightarrow \mathrm {T}^*Q\) (see Example 2.4).

Proposition 4.5

For a Lagrangian function \({\mathcal {L}}\) the following conditions are equivalent:

  1. (i)

    The Legendre map \({\mathcal {F}}{\mathcal {L}}\) is a local diffeomorphism.

  2. (ii)

    The fibre Hessian \({\mathcal {F}}^2{\mathcal {L}}:{\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\longrightarrow ({\mathbb {R}}\times \mathrm {T}^*Q\times {\mathbb {R}})\otimes ({\mathbb {R}}\times \mathrm {T}^*Q\times {\mathbb {R}})\) of \({\mathcal {L}}\) is everywhere nondegenerate (the tensor product is of vector bundles over \({\mathbb {R}}\times Q \times {\mathbb {R}}\)).

  3. (iii)

    \(({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}},\mathrm {d}t, \eta _{\mathcal {L}})\) is a cocontact manifold.

The proof of this result can be easily done using natural coordinates, where

$$\begin{aligned} {\mathcal {F}}{\mathcal {L}}:(t,q^i,v^i, s) \longrightarrow \left( t,q^i,\frac{\partial L}{\partial v^i}, s\right) \,, \end{aligned}$$

and

$$\begin{aligned} {\mathcal {F}}^2 {\mathcal {L}}(t,q^i,v^i,s) = (t,q^i,W_{ij},s)\,,\quad \text{ with } \ W_{ij} = \left( \frac{\partial ^2 {\mathcal {L}}}{\partial v^i\partial v^j}\right) \,. \end{aligned}$$

And the three conditions in the above proposition are equivalent to say that the matrix \(W= (W_{ij})\) is everywhere regular, hence they are equivalent.

Definition 4.6

A Lagrangian function \({\mathcal {L}}\) is said to be regular if the equivalent conditions in Proposition 4.5 hold. Otherwise \({\mathcal {L}}\) is called a singular Lagrangian. In particular, \({\mathcal {L}}\) is said to be hyperregular if \({\mathcal {F}}{\mathcal {L}}\) is a global diffeomorphism.

Remark 4.7

As a result of the preceding definitions and results, every regular cocontact Lagrangian system has associated the cocontact Hamiltonian system \(({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}},\mathrm {d}t, \eta _{\mathcal {L}}, E_{\mathcal {L}})\).

Given a regular cocontact Lagrangian system \(({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}},{\mathcal {L}})\), from Proposition 2.6 we have that the Reeb vector fields \(R_t^{\mathcal {L}},R_s^{\mathcal {L}}\in {\mathfrak {X}}({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}})\) for this system are uniquely determined by the relations

$$\begin{aligned} \left\{ \begin{array}{ll} i(R_t^{\mathcal {L}})\mathrm {d}t = 1\,,\\ i(R_t^{\mathcal {L}})\eta _{\mathcal {L}}= 0\,,\\ i(R_t^{\mathcal {L}})\mathrm {d}\eta _{\mathcal {L}}= 0\,, \end{array}\right. \qquad \left\{ \begin{array}{ll} i(R_s^{\mathcal {L}})\mathrm {d}t = 0\,,\\ i(R_s^{\mathcal {L}})\eta _{\mathcal {L}}= 1\,,\\ i(R_s^{\mathcal {L}})\mathrm {d}\eta _{\mathcal {L}}= 0\,. \end{array}\right. \end{aligned}$$

Their local expressions are

$$\begin{aligned} R_t^{\mathcal {L}}&= \frac{\partial }{\partial t} - W^{ij}\frac{\partial ^2 {\mathcal {L}}}{\partial t\partial v^j}\frac{\partial }{\partial v^i}\,,\\ R_s^{\mathcal {L}}&= \frac{\partial }{\partial s} - W^{ij}\frac{\partial ^2 {\mathcal {L}}}{\partial s\partial v^j}\frac{\partial }{\partial v^i}\,, \end{aligned}$$

where \(W^{ij}\) is the inverse of the Hessian matrix of the Lagrangian \({\mathcal {L}}\), namely \(W^{ij}W_{jk}=\delta ^i_k\).

Notice that if the Lagrangian function \({\mathcal {L}}\) is singular, the Reeb vector fields are not uniquely determined. This will be discussed in Sect. 5.

4.3 The Herglotz–Euler–Lagrange equations

Definition 4.8

Let \(({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}},{\mathcal {L}})\) be a regular contact Lagrangian system.

The Herglotz–Euler–Lagrange equations for a holonomic curve \({{\tilde{\mathbf{c}}}}:I\subset {\mathbb {R}}\rightarrow {\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\) are

$$\begin{aligned} \left\{ \begin{array}{ll} i({{\tilde{\mathbf{c}}}}')\mathrm {d}\eta _{\mathcal {L}}= \left( \mathrm {d}E_{\mathcal {L}}- ({\mathscr {L}}_{R_t^{\mathcal {L}}}E_{\mathcal {L}})\mathrm {d}t - ({\mathscr {L}}_{R_s^{\mathcal {L}}}E_{\mathcal {L}})\eta _{\mathcal {L}}\right) \circ {{\tilde{\mathbf{c}}}}\,,\\ i({{\tilde{\mathbf{c}}}}')\eta _{\mathcal {L}}= - E_{\mathcal {L}}\circ {{\tilde{\mathbf{c}}}}\,,\\ i({{\tilde{\mathbf{c}}}}')\mathrm {d}t = 1\,, \end{array}\right. \end{aligned}$$
(7)

where \({{\tilde{\mathbf{c}}}}':I\subset {\mathbb {R}}\rightarrow \mathrm {T}({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}})\) denotes the canonical lifting of \({{\tilde{\mathbf{c}}}}\) to \(\mathrm {T}({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}})\).

The cocontact Lagrangian equations for a vector field \(X_{\mathcal {L}}\in {\mathfrak {X}}({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}})\) are

$$\begin{aligned} \left\{ \begin{array}{ll} i(X_{\mathcal {L}})\mathrm {d}\eta _{\mathcal {L}}= \mathrm {d}E_{\mathcal {L}}-({\mathscr {L}}_{R_t^{\mathcal {L}}}E_{\mathcal {L}})\mathrm {d}t-({\mathscr {L}}_{R_s^{\mathcal {L}}}E_{\mathcal {L}})\eta _{\mathcal {L}}\,,\\ i(X_{\mathcal {L}})\eta _{\mathcal {L}}= -E_{\mathcal {L}}\,,\\ i(X_{\mathcal {L}})\mathrm {d}t = 1\,. \end{array}\right. \end{aligned}$$
(8)

The vector field which is the only solution to these equations is called the cocontact Lagrangian vector field.

Notice that a cocontact Lagrangian vector field is a cocontact Hamiltonian vector field for the function \(E_{\mathcal {L}}\) (and the cocontact structure \((\mathrm {d}t,\eta _{\mathcal {L}})\)).

In natural coordinates, for a holonomic curve \({{\tilde{\mathbf{c}}}}(r)=(t(r), q^i(r),\dot{q}^i(r),s(r))\), equations (7) are

$$\begin{aligned}&\dot{t} = 1\,, \end{aligned}$$
(9)
$$\begin{aligned}&\dot{s} = {\mathcal {L}}\,, \end{aligned}$$
(10)
$$\begin{aligned}&\dot{t}\frac{\partial ^2 {\mathcal {L}}}{\partial t\partial v^i} + \dot{q}^j\frac{\partial ^2 {\mathcal {L}}}{\partial q^j\partial v^i} + \ddot{q}^j\frac{\partial ^2 {\mathcal {L}}}{\partial v^j\partial v^i} + \dot{s}\frac{\partial ^2 {\mathcal {L}}}{\partial s\partial v^i} - \frac{\partial {\mathcal {L}}}{\partial q^i} = \frac{\mathrm {d}}{\mathrm {d}r}\left( \frac{\partial {\mathcal {L}}}{\partial v^i}\right) - \frac{\partial {\mathcal {L}}}{\partial q^i} = \frac{\partial {\mathcal {L}}}{\partial s}\frac{\partial {\mathcal {L}}}{\partial v^i}\,. \end{aligned}$$
(11)

Condition (9) implies that \(t(r) = r + k\). This justifies the usual identification \(t = r\). Meanwhile, for a vector field \(X_{\mathcal {L}}= f\dfrac{\partial }{\partial t} + F^i\dfrac{\partial }{\partial q^i} + G^i\dfrac{\partial }{\partial v^i} + g\dfrac{\partial }{\partial s}\), equations (8) read

$$\begin{aligned}&(F^j - v^j)\frac{\partial ^2 {\mathcal {L}}}{\partial t\partial v^j} = 0\,, \end{aligned}$$
(12)
$$\begin{aligned}&f\frac{\partial ^2 {\mathcal {L}}}{\partial t\partial v^i} + F^j\frac{\partial ^2 {\mathcal {L}}}{\partial q^j\partial v^i} + G^j\frac{\partial ^2 {\mathcal {L}}}{\partial v^j\partial v^i} + g\frac{\partial ^2 {\mathcal {L}}}{\partial s\partial v^i} - \frac{\partial {\mathcal {L}}}{\partial q^i} - (F^j - v^j)\frac{\partial ^2 {\mathcal {L}}}{\partial q^i\partial v^j} = \frac{\partial {\mathcal {L}}}{\partial s}\frac{\partial {\mathcal {L}}}{\partial v^i}\,, \end{aligned}$$
(13)
$$\begin{aligned}&(F^j - v^j)\frac{\partial ^2 {\mathcal {L}}}{\partial v^i\partial v^j} = 0\,, \end{aligned}$$
(14)
$$\begin{aligned}&(F^j - v^j)\frac{\partial ^2 {\mathcal {L}}}{\partial s\partial v^j} = 0\,, \end{aligned}$$
(15)
$$\begin{aligned}&{\mathcal {L}}+ \frac{\partial {\mathcal {L}}}{\partial v^j}(F^j-v^j) - g = 0\,, \end{aligned}$$
(16)
$$\begin{aligned}&f = 1\,, \end{aligned}$$
(17)

where we have used the relations

$$\begin{aligned} {\mathscr {L}}_{R_t^{\mathcal {L}}} E_{\mathcal {L}}= - \frac{\partial {\mathcal {L}}}{\partial t}\ ,\quad {\mathscr {L}}_{R_s^{\mathcal {L}}} E_{\mathcal {L}}= - \frac{\partial {\mathcal {L}}}{\partial s}\,, \end{aligned}$$

which can be easily proved taking coordinates.

Theorem 4.9

If \({\mathcal {L}}\) is a regular Lagrangian, then \(X_{\mathcal {L}}\) is a sode and equations (12)–(17) become

$$\begin{aligned}&f = 1\,, \end{aligned}$$
(18)
$$\begin{aligned}&g = {\mathcal {L}}\,, \end{aligned}$$
(19)
$$\begin{aligned}&\frac{\partial ^2 {\mathcal {L}}}{\partial t\partial v^i} + v^j\frac{\partial ^2 {\mathcal {L}}}{\partial q^j\partial v^i} + G^j\frac{\partial ^2 {\mathcal {L}}}{\partial v^j\partial v^i} + {\mathcal {L}}\frac{\partial ^2 {\mathcal {L}}}{\partial s\partial v^i} - \frac{\partial {\mathcal {L}}}{\partial q^i} = \frac{\partial {\mathcal {L}}}{\partial s}\frac{\partial {\mathcal {L}}}{\partial v^i}\,, \end{aligned}$$
(20)

which, for the integral curves of \(X_{\mathcal {L}}\), are the Herglotz–Euler–Lagrange equations (9), (10) and (11).

This sode \(X_{\mathcal {L}}\equiv \Gamma _{\mathcal {L}}\) is called the Herglotz–Euler–Lagrange vector field associated to the Lagrangian function \({\mathcal {L}}\).

Proof

This results follows from the coordinate expressions. If \({\mathcal {L}}\) is a regular Lagrangian, equations (14) lead to \(F^i=v^i\), which are the sode condition for the vector field \(X_{\mathcal {L}}\). Then, (12) and (15) hold identically, and (13), (16) and (17) give the equations (18), (19) and (20) or, equivalently, for the integral curves of \(X_{\mathcal {L}}\), the Herglotz–Euler–Lagrange equations (9), (10) and (11). \(\square \)

Hence, the local expression of the Herlgotz–Euler–Lagrange vector field is

$$\begin{aligned} \Gamma _{\mathcal {L}}= \frac{\partial }{\partial t} + v^i\frac{\partial }{\partial q^i} + W^{ji}\left( \frac{\partial {\mathcal {L}}}{\partial q^j} - \frac{\partial ^2 {\mathcal {L}}}{\partial t\partial v^j} - v^k\frac{\partial ^2 {\mathcal {L}}}{\partial q^k\partial v^j} - {\mathcal {L}}\frac{\partial ^2 {\mathcal {L}}}{\partial s\partial v^j} + \frac{\partial {\mathcal {L}}}{\partial s}\frac{\partial {\mathcal {L}}}{\partial v^j} \right) \frac{\partial }{\partial v^i} + {\mathcal {L}}\frac{\partial }{\partial s}\,. \end{aligned}$$

An integral curve of this vector field satisfies the classical Euler-Lagrange equations for dissipative systems, as can be easily verified:

$$\begin{aligned} \frac{\mathrm {d}}{\mathrm {d}t}\left( \frac{\partial {\mathcal {L}}}{\partial v^i}\right) - \frac{\partial {\mathcal {L}}}{\partial q^i} =\frac{\partial {\mathcal {L}}}{\partial s}\frac{\partial {\mathcal {L}}}{\partial v^i}\,,\qquad \dot{s} = {\mathcal {L}}\,. \end{aligned}$$

Remark 4.10

It is interesting to point out how, in the Lagrangian formalism of dissipative systems, the expression in coordinates (10) of the second Lagrangian equation (7) relates the variation of the “dissipation coordinate” s to the Lagrangian function and, from here, we can identify this coordinate with the Lagrangian action, \( s=\int {\mathcal {L}}\,\mathrm {d}t\).

Remark 4.11

Equations (10) (11) coincide with those derived from the Herglotz variational principle [28, 35, 36].

5 The singular case

If the Hessian of the Lagrangian is not regular (in other words, the Lagrangians is singular), the construction of Sect. 4.2 does not lead to a cocontact structure, as shown in 4.5. In order to describe the dynamics of singular Lagrangians we require some minimal regularity conditions. Inspired by previous works on the singular case for contact systems [19] and cosymplectic systems [13] we will define precocontact structures.

5.1 Precocontact structures

Definition 5.1

Let M be a smooth manifold and consider two one-forms \(\tau ,\eta \in \Omega ^1(M)\). We define the characteristic distribution of \((\tau ,\eta )\) as

$$\begin{aligned} {\mathcal {C}}= \ker \tau \cap \ker \eta \cap \ker \mathrm {d}\eta \,. \end{aligned}$$

If \({\mathcal {C}}\) has constant rank, we say that the couple \((\tau ,\eta )\) is of class \(\mathfrak {cl}(\tau ,\eta ) = \dim M - {{\,\mathrm{rank}\,}}{\mathcal {C}}\).

Definition 5.2

Consider a smooth manifold M. The couple \((\tau ,\eta )\), where \(\tau ,\eta \in \Omega ^1(M)\), is a precocontact structure on M if \(\mathrm {d}\tau = 0\), the characteristic distribution of the couple \((\tau ,\eta )\) has constant rank and \(\mathfrak {cl}(\tau ,\eta ) = 2r+2\ge 2\). The triple \((M,\tau ,\eta )\) will be called a precocontact manifold.

Theorem 5.3

(Darboux theorem) Let \((M,\tau ,\eta )\) be a precocontact manifold with \(\dim M = m\). Then, around every point \(p\in M\), there is a local chart \((U; t, q^i, p_i, s, u^j)\), where \(1\le i \le r\), \(1\le j\le c\), \(2r+2+c=m\), such that

Proof

Since the one-form \(\tau \) is closed, we have that locally \(\tau = \mathrm {d}t\). Moreover, \(\ker \tau \) is an integrable distribution and thus induces a foliation \({\mathcal {F}}\) of M. Consider the leaf \({\mathcal {F}}_0\) corresponding to \(t = t_0\). We want to see that the class of is odd (the definition of class of a one-form can be found in Definition VI.1.1 in [30]). It is clear that, on a point \(p\in {\mathcal {F}}_0\), . Hence,

and since \(\mathfrak {cl}(\tau ,\eta )\ge 2\) is even, we have that is odd. Now, using Theorem VI.4.1 in [30] we obtain the desired result. \(\square \)

Remark 5.4

If \(\mathfrak {cl}(\tau ,\eta )=m\) then m must be even and we recover the cocontact structure introduced in Definition 2.1.

Given a precocontact manifold \((M,\tau ,\eta )\), the morphism \(\flat \) can be defined in the same way as in the regular case:

$$\begin{aligned} \begin{array}{rccl} \flat :&{} \mathrm {T}M &{} \longrightarrow &{} \mathrm {T}^*M \\ &{} v &{} \longmapsto &{} (i(v)\tau )\tau + i(v)\mathrm {d}\eta + \left( i(v)\eta \right) \eta \,. \end{array} \end{aligned}$$

However, in this case it is not an isomorphism (see Proposition 5.6).

Definition 5.5

A vector field \(R_s\in {\mathfrak {X}}(M)\) is a contact Reeb vector field if

$$\begin{aligned} \flat (R_s)=\eta \,. \end{aligned}$$

A vector field \(R_t\in {\mathfrak {X}}(M)\) is a time Reeb vector field if

$$\begin{aligned} \flat (R_t)=\tau \,. \end{aligned}$$

Both kinds of vector fields always exist thanks to the theorem 5.3, and global ones can be constructed using partitions of the unity. Crucially, in the precocontact case the Reeb vector fields are not unique.

Proposition 5.6

Let \((M,\tau ,\eta )\) be a precocontact structure on M. Then

$$\begin{aligned} {\mathcal {C}}= \ker \tau \cap \ker \eta \cap \ker \mathrm {d}\eta = \ker \flat = ({{\,\mathrm{Im}\,}}\flat )^\circ \,. \end{aligned}$$

Proof

We will begin by proving that \(\ker \tau \cap \ker \eta \cap \ker \mathrm {d}\eta \supseteq \ker \flat \). Let \(X\in \ker \flat \), then

$$\begin{aligned} \flat (X) = 0\,. \end{aligned}$$
(21)

Let \(R_s,R_t\) be a contact and time Reeb vector fields respectively. Contracting both sides of equation (21) with \(R_s\), we have

$$\begin{aligned} 0&= i(R_s)i(X)\mathrm {d}\eta + i(R_s)((i(X)\eta )\eta ) + i(R_s)((i(X)\tau )\tau )\\&= -i(X)(i(R_s)\mathrm {d}\eta )) + (i(X)\eta )(i(R_s)\eta ) + (i(X)\tau )(i(R_s)\tau )\\&= i(X)\eta \,. \end{aligned}$$

On the other hand, contracting with \(R_t\), we obtain

$$\begin{aligned} 0&= i(R_t)i(X)\mathrm {d}\eta + i(R_t)((i(X)\eta )\eta ) + i(R_t)((i(X)\tau )\tau )\\&= -i(X)(i(R_t)\mathrm {d}\eta )) + (i(X)\eta )(i(R_t)\eta ) + (i(X)\tau )(i(R_t)\tau )\\&= i(X)\tau \,. \end{aligned}$$

Hence, we also have that \(i(X)\mathrm {d}\eta = 0\) and then \(X\in \ker \tau \cap \ker \eta \cap \ker \mathrm {d}\eta \). The other inclusion is trivial.

Now we will show that \(\ker \flat = ({{\,\mathrm{Im}\,}}\flat )^\circ \). Let \(X\in \ker \flat \). By the first equality, \(i(X)\tau = 0\), \(i(X)\eta = 0\) and \(i(X)\mathrm {d}\eta = 0\). Then, for every vector field Y,

$$\begin{aligned} i(X)\flat (Y) = i(X)(i(Y)\tau )\tau + i(X)i(Y)\mathrm {d}\eta + i(X)(i(Y)\eta )\eta = -i(Y)i(X)\mathrm {d}\eta = 0\,, \end{aligned}$$

and hence \(\ker \flat \subset ({{\,\mathrm{Im}\,}}\flat )^\circ \). Now, as it is clear that both subspaces of \(\mathrm {T}_p M\) have the same dimension, we have that \(\ker \flat =({{\,\mathrm{Im}\,}}\flat )^\circ \). \(\square \)

Notice that if \(R_1\) and \(R_2\) are two contact (or two time) Reeb vector fields, then, \(R_1-R_2\in {\mathcal {C}}\). Conversely, if R is a contact (time) Reeb vector field, then \(R+V\) is a contact (or time) Reeb vector field for any \(V\in {\mathcal {C}}\).

Definition 5.7

A precocontact Hamiltonian system is a family \((M,\tau ,\eta ,H)\) where \((M,\tau ,\eta )\) is a precocontact manifold and \(H\in {\mathscr {C}}^\infty (M)\) is the Hamiltonian function on M.

Definition 5.8

Let \((M,\tau ,\eta ,H)\) be a precocontact Hamiltonian system and \(R_s\) and \(R_t\) two contact and time Reeb vector fields respectively. The precocontact Hamiltonian equation for a vector field X is:

$$\begin{aligned} \flat (X)=\gamma _H\,, \end{aligned}$$
(22)

where \(\gamma _H = \mathrm {d}H-\left( {\mathscr {L}}_{R_s}H+H\right) \eta +\left( 1-{\mathscr {L}}_{R_t}H\right) \tau \).

Equation (22) has two problems in the singular case: \(\gamma _H\) depends (a priori) on the Reeb vector fields we have chosen and there may not exist a solution to the equations. Both problems are solved by applying a suitable constraint algorithm.

5.2 Constraint algorithm

The aim of the constraint algorithm is to find a submanifold \(M_f\subset M\) such that there exists a solution to the equation (22) which is tangent to the submanifold \(M_f\). The algorithm has two steps: the consistency condition, where we look for the submanifold where the equation has solution, and the tangency condition, where we analyse where the solution is tangent to the submanifold. These steps are applied iteratively, but the first step is specially relevant because it will solve the multiplicity of Reeb vector fields.

Consider a \(\gamma _H\) with particular Reeb vector fields \(R_s\) and \(R_t\). \(M_1\) is defined as the subset of the points of M where solutions exist:

$$\begin{aligned} M_1=\{p\in M \mid (\gamma _H)_p\in \flat (T_pM)\}\,. \end{aligned}$$

Theorem 5.9

Let \({\bar{M}}_1 = \{p\in M\mid ({\mathscr {L}}_Y H)_p = 0\,,\ \forall Y\in {\mathcal {C}}\}\). Then \(M_1 = {\bar{M}}_1\).

Proof

Let \(p\in M_1\). Then \((\gamma _H)_p \in \flat (\mathrm {T}_pM) = (\ker \flat )_p^\circ = {\mathcal {C}}^\circ _p\). For any \(Y\in {\mathcal {C}}\) we have that

$$\begin{aligned} 0 = (i_Y\gamma _H)_p = \big (i_Y(\mathrm {d}H-\left( {\mathscr {L}}_{R_s}H+H\right) \eta +\left( 1-{\mathscr {L}}_{R_t}H\right) \tau )\big )_p = ({\mathscr {L}}_Y H)_p\,, \end{aligned}$$

because \(i_Y\tau = i_Y\eta = 0\). Hence, \(p\in {\bar{M}}_1\).

Conversely, consider \(p\in {\bar{M}}_1\) and \(Y\in {\mathcal {C}}\). Then, \((i_Y\mathrm {d}H)_p = 0\), which implies \((i_Y\gamma _H)_p = 0\). Thus \((\gamma _H)_p\in ({\mathcal {C}})^\circ _p = \flat (\mathrm {T}_pM)\). Since Y is arbitrary, we have that \(p\in M_1\). \(\square \)

Corollary 5.10

Over \(M_1\), the one-form \(\gamma _H\) does not depend on the choice of the Reeb vector fields.

Proof

Let \(\gamma _H\) as above and \({{\bar{\gamma }}}_H\) for \({\bar{R}}_t,{\bar{R}}_s\). Then, \(\gamma _H - {{\bar{\gamma }}}_H = ({\mathscr {L}}_{({\bar{R}}_t - R_t)}H)\tau + ({\mathscr {L}}_{({\bar{R}}_s - R_s)}H)\eta \). Since \({\bar{R}}_t - R_t, {\bar{R}}_s- R_s\in {\mathcal {C}}\), we have that \(\gamma _H = {{\bar{\gamma }}}_H\) on \(M_1\). \(\square \)

Notice that on \(M_1\), the precocontact Hamiltonian equation for the precocontact system \((M,\tau ,\eta ,H)\) does not depend on the choice of the Reeb vector fields \(R_t,R_s\).

In \(M_1\) (which we assume to be a submanifold) there exists a solution \(X_H\) of (22), but it may not be tangent to \(M_1\). Therefore, we define

$$\begin{aligned} M_2=\{p\in M_1 \mid (X_H)_p\in (T_pM_1)\}\,, \end{aligned}$$

which we also assume to be a submanifold. Iterating this procedure we can obtain a sequence of constraint submanifolds

$$\begin{aligned} \cdots \hookrightarrow M_f\hookrightarrow \cdots \hookrightarrow M_2\hookrightarrow M_1\hookrightarrow M\,. \end{aligned}$$

If this procedure stabilizes, that is, there exists a natural number \(f\in {\mathbb {N}}\) such that \(M_{f+1}=M_f\), and \(\dim M_f>0\) we say that \(M_f\) is the final constraint submanifold. In \(M_f\) we can find solutions to equations (22) which are tangent to \(M_f\). Notice that, in the Lagrangian case, we need to impose the sode condition.

In general, the Reeb vector fields are not tangent to the submanifolds provided by this constraint algorithm. One can continue the algorithm by demanding the tangency of the Reeb vector fields, as shown in [19]. This is important if we want a Dirac–Jacobi bracket on the resulting constraint submanifold, which requires a Reeb vector field.

5.3 Precocontact Lagrangian systems

Consider a Lagrangian function \({\mathcal {L}}:{\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\rightarrow {\mathbb {R}}\), and the associated objects \(\eta _{\mathcal {L}}\) and \(E_{\mathcal {L}}\) as defined in Sect. 4.2.

Definition 5.11

A Lagrangian function \({\mathcal {L}}:{\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\rightarrow {\mathbb {R}}\) is admissible if the Hessian of \({\mathcal {L}}\) has constant rank and \(({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}},\mathrm {d}t,\eta _{\mathcal {L}})\) is a precocontact manifold.

Remark 5.12

Not every Lagrangian whose Hessian has constant rank leads to a precocontact structure. Consider the manifold \({\mathbb {R}}\times \mathrm {T}{\mathbb {R}}\times {\mathbb {R}}\), with coordinates (tqvs), and the Lagrangian \({\mathcal {L}}=vs\). The Hessian of \({\mathcal {L}}\) has constant rank equal to 0, and the 1-forms are \(\tau =\mathrm {d}t\) and \(\eta _{\mathcal {L}}=\mathrm {d}s-s\mathrm {d}q\). We have that \(\mathrm {d}\eta _{\mathcal {L}}=-\mathrm {d}s\wedge \mathrm {d}q\), thus \(\mathfrak {cl}(\tau ,\eta _{\mathcal {L}}) = 4 - 1=3\), which is odd (in a set where \(s\ne 0\)) . The main problem of this structure is that there are no Reeb vector fields as defined in 5.5.

Remark 5.13

The condition of being admissible is stronger than the condition proposed in [19], which is just for the Hessian to have constant rank. In light of the previous example, which can also be considered in the precontact setting, we believe it is necessary to require that the Lagrangian is admissible. Non-admissible Lagrangians will be studied in a future work.

The precocontact Herglotz–Euler–Lagrange equations are defined as in Definition 4.8, but there is no result about the solutions like Theorem 4.9. First of all, since we are dealing with a precocontact system, a constraint algorithm is required in order to find solutions. In particular, on the final constraint submanifold, the Herglotz–Euler–Lagrange equations do not depend on the choice of the Reeb vector fields, as proved in Corollary 5.10. Moreover, the holonomy condition is not always recovered and it has to be imposed, leading to new constraints which have to be considered during the constraint algorithm.

5.4 The canonical Hamiltonian formalism

In the (hyper)regular case, the Legendre transform gives a diffeomorphism between \(({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}, \mathrm {d}t, \eta _{\mathcal {L}})\) and \(({\mathbb {R}}\times \mathrm {T}^*Q\times {\mathbb {R}}, \tau = \mathrm {d}t, \eta )\) such that \({\mathcal {F}}{\mathcal {L}}^*\eta = \eta _{\mathcal {L}}\). For the singular case, the Legendre transform can be defined but, in general, \({\mathcal {P}}:= {{\,\mathrm{Im}\,}}({\mathcal {F}}{\mathcal {L}})={\mathcal {F}}{\mathcal {L}}({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}})\varsubsetneq {\mathbb {R}}\times \mathrm {T}^*Q\times {\mathbb {R}}\). Some regularity conditions are required to assure that a Hamiltonian precocontact system can be realised on \({\mathcal {P}}\).

Definition 5.14

A singular Lagrangian \({\mathcal {L}}\) is almost-regular if

  • \({\mathcal {L}}\) is admissible,

  • \({\mathcal {P}}:= {{\,\mathrm{Im}\,}}({\mathcal {F}}{\mathcal {L}})={\mathcal {F}}{\mathcal {L}}({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}})\) is a closed submanifold of \({\mathbb {R}}\times \mathrm {T}^*Q\times {\mathbb {R}}\),

  • the Legendre map \({\mathcal {F}}{\mathcal {L}}\) is a submersion onto its image,

  • the fibers \({\mathcal {F}}{\mathcal {L}}^{-1}({\mathcal {F}}{\mathcal {L}}(t,v_q,s))\subset {\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\) are connected submanifolds for every \((t,v_q,s)\in {\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\).

In the almost-regular case we can construct the triple \(({\mathcal {P}}, \tau , \eta _{\mathcal {P}})\), where \(\eta _{\mathcal {P}}= j_{\mathcal {P}}^*{\mathcal {F}}{\mathcal {L}}^*\eta \in \Omega ^1({\mathcal {P}})\), \(\tau ={\mathcal {F}}{\mathcal {L}}^*\mathrm {d}t\) and \(j_{\mathcal {P}}:{\mathcal {P}}\hookrightarrow {\mathbb {R}}\times \mathrm {T}^*Q\times {\mathbb {R}}\) is the natural embedding. Furthermore, the Lagrangian energy \(E_{\mathcal {L}}\) is \({\mathcal {F}}{\mathcal {L}}\)-projectable, that is, there is a unique \(H_{\mathcal {P}}\in {\mathscr {C}}^\infty ({\mathcal {P}})\) such that \(E_{\mathcal {L}}= (j_{\mathcal {P}}\circ {\mathcal {F}}{\mathcal {L}})^*H_{\mathcal {P}}\). Then, \(({\mathcal {P}},\tau , \eta _{\mathcal {P}},H_{\mathcal {P}}) \) is a precocontact Hamiltonian system.

The contact Hamiltonian equations for \(X_{\mathcal {P}}\in {\mathfrak {X}}({\mathcal {P}})\) are (3) adapted to this situation. As in the Lagrangian formalism, these equations are not necessarily consistent everywhere on \({\mathcal {P}}\) and we must implement a suitable constraint algorithm in order to find a final constraint submanifold \({\mathcal {P}}_f\hookrightarrow {\mathcal {P}}\) (if it exists) where there exist vector fields \(X\in {\mathfrak {X}}({\mathcal {P}})\), tangent to \({\mathcal {P}}_f\), which are (not necessarily unique) solutions to (3) on \({\mathcal {P}}_f\).

6 Damped mechanical systems with holonomic constraints

There are two classes of constraints: holonomic, which only depend on the generalized coordinates and time, and nonholonomic, which have a dependence on velocities or momenta. Nonholonomic constraints are more intricate and there are several ways to implement them (see [33] for a general study of these kind of constraints in the symplectic setting).

In a recent article [20] the authors consider contact systems with nonholonomic constraints and show how a contact system can be understood as a symplectic system with nonholonomic constraints. This chapter adds to these results by considering singular Lagrangians and allowing explicit dependence on time of both the Lagrangian and the constraints. On the other hand, we only consider holonomic constraints.

Consider a Lagrangian precocontact system \(({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}},{{\mathcal {L}}'})\), with \(\tau =\mathrm {d}t\). We will denote by \(\eta _{{\mathcal {L}}'}\), \({\mathcal {C}}'\) and \(E_{{\mathcal {L}}'}\) the contact form, characteristic distribution and Lagrangian energy associated to the system \(({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}},{\mathcal {L}}')\). Now we add a set of independent constraints \(f^\alpha (t,q^i,s)=0\) with \(1\le \alpha \le d\), which define a submanifold \(S\hookrightarrow {\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\). In order to define a suitable constraint submanifold, these constraints functions must verify the condition

$$\begin{aligned} {{\,\mathrm{rank}\,}}\left( \dfrac{\partial f^\alpha }{\partial q^i}\right) = d\,,\quad \forall t,s\,. \end{aligned}$$

Therefore, we can understand these constraints as a constraint in the generalized coordinates \((q^i, s)\) for every value of time t.

In order to find the precocontact Lagrangian vector field for \((S,{\mathcal {L}})\), we add d new configuration variables \(\lambda _\alpha \), thus the enlarged manifold is \({\mathbb {R}}\times \mathrm {T}(Q\times {\mathbb {R}}^d)\times {\mathbb {R}}\), with local variables \((t,q^i,v^i,\lambda _\alpha ,v_\alpha ,s)\). We consider the new Lagrangian:

$$\begin{aligned} {\mathcal {L}}={\mathcal {L}}'+\lambda _\alpha f^\alpha \,. \end{aligned}$$

thus \(\lambda _\alpha \) act as Lagrange multipliers and we consider them dynamical variables.

We have the precocontact Lagrangian system \(({\mathbb {R}}\times \mathrm {T}(Q\times {\mathbb {R}}^d)\times {\mathbb {R}},{\mathcal {L}})\). The contact form is the same \(\eta _{\mathcal {L}}=\eta _{{\mathcal {L}}'}\,\), and the characteristic distribution is

$$\begin{aligned} {\mathcal {C}}={\mathcal {C}}'\cup \left<\frac{\partial }{\partial \lambda _\alpha },\frac{\partial }{\partial v_\alpha }\right>\,. \end{aligned}$$

And the Lagrangian energy is

$$\begin{aligned} E_{{\mathcal {L}}}=E_{{\mathcal {L}}'}-\lambda _\alpha f^\alpha \,. \end{aligned}$$

The primary constraints are generated by sections of \({\mathcal {C}}\), which we can separate in two classes, those which are sections of \({\mathcal {C}}'\) and \(\dfrac{\partial }{\partial \lambda _\alpha }\) and \(\dfrac{\partial }{\partial v_\alpha }\). The last ones give the constraints:

$$\begin{aligned} {\mathscr {L}}_{\partial /\partial \lambda _\alpha }E_{\mathcal {L}}=-f^\alpha =0\,;\quad {\mathscr {L}}_{\partial /\partial v_\alpha }E_{\mathcal {L}}=0\,. \end{aligned}$$

Thus, we recover the original constraints from the constraint algorithm. If Y is a section of \({\mathcal {C}}'\), then

$$\begin{aligned} {\mathscr {L}}_YE_{{\mathcal {L}}}={\mathscr {L}}_YE_{{\mathcal {L}}'}-\lambda _\alpha {\mathscr {L}}_Yf^\alpha =0\,. \end{aligned}$$

The primary constraints for the Lagrangian \({\mathcal {L}}'\) (that is, without imposing \(f^\alpha =0\)) are \({\mathscr {L}}_YE_{{\mathcal {L}}'}\). Thus, these constraints become coupled with \(f^\alpha \) and are not conserved in general. From this point the constraints algorithm should continue imposing the tangency condition. The outcome will depend on the particular Lagrangian and constraints.

We will now compute the dynamical equations, which are complementary to the constraint algorithm. Consider a holonomic vector field:

$$\begin{aligned} X = f\frac{\partial }{\partial t} + v^i\frac{\partial }{\partial x^i} + v_\alpha \frac{\partial }{\partial \lambda _\alpha } + G^i\frac{\partial }{\partial v^i} + G_\alpha \frac{\partial }{\partial v_\alpha } + g\frac{\partial }{\partial s}\,. \end{aligned}$$

Then the precocontact equations (22) are

$$\begin{aligned}&f = 1\,,\\&g = {\mathcal {L}}\,,\\&f^\alpha =0\,,\\&\frac{\partial ^2 {\mathcal {L}}'}{\partial t\partial v^i} + v^j\frac{\partial ^2 {\mathcal {L}}'}{\partial q^j\partial v^i} + G^j\frac{\partial ^2 {\mathcal {L}}'}{\partial v^j\partial v^i} + {\mathcal {L}}'\frac{\partial ^2 {\mathcal {L}}'}{\partial s\partial v^i} - \frac{\partial {\mathcal {L}}'}{\partial q^i}\\ {}&\quad =\frac{\partial {\mathcal {L}}'}{\partial s}\frac{\partial {\mathcal {L}}'}{\partial v^i}+\lambda _\alpha \left( \frac{\partial f^\alpha }{\partial q^i}+\frac{\partial f^\alpha }{\partial s}\frac{\partial {\mathcal {L}}'}{\partial v^i}\right) \,. \end{aligned}$$

7 Examples

In the following examples we consider mechanical systems in Riemannian manifolds described by Lagrangians of the form \(L = K - U\), with K and U the kinetic and potential energy respectively [1]. These Lagrangians are hyperregular. In order to introduce dissipation and external forces, we will add some additional terms to these Lagrangians such as \(\gamma s\) and G(tq) respectively. We also consider systems subjected to holonomic time-dependent constraints \(f^\alpha (t,q)\).

7.1 Damped forced harmonic oscillator

In this example we are going to study a forced harmonic oscillator with damping. We will develop both the Lagrangian and Hamiltonian formalisms. Consider a harmonic oscillator of mass m with elastic constant k and an external force f(t) depending on time.

7.1.1 Lagrangian formalism

The configuration manifold for this system is \(Q={\mathbb {R}}\) equipped with coordinate q. Consider the phase manifold \({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\) equipped with coordinates (tqvs) and the Lagrangian function \({\mathcal {L}}:{\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\rightarrow {\mathbb {R}}\) given by

$$\begin{aligned} {\mathcal {L}}(t,q,v,s) = \frac{1}{2}mv^2 - \frac{k}{2}q^2 + q f(t) - \frac{\gamma }{m} s\,, \end{aligned}$$
(23)

where f(t) is a time-dependent external force. The Lagrangian energy associated to this Lagrangian function is

$$\begin{aligned} E_{\mathcal {L}}= \frac{1}{2}mv^2 + \frac{k}{2}q^2 - qf(t) + \frac{\gamma }{m} s\,, \end{aligned}$$

and its differential is

$$\begin{aligned} \mathrm {d}E_{\mathcal {L}}= -qf'(t)\mathrm {d}t + (kq - f(t))\mathrm {d}q + mv\mathrm {d}v + \frac{\gamma }{m}\mathrm {d}s\,. \end{aligned}$$
Fig. 1
figure 1

These figures depict the evolution of the position and velocity of the damped harmonic oscillator with respect to time and the phase portrait of the system

The Cartan 1-form for the Lagrangian \({\mathcal {L}}\) is \( \theta _{\mathcal {L}}= mv\mathrm {d}q\). The contact 1-form is \(\eta _{\mathcal {L}}= \mathrm {d}s - mv\mathrm {d}q\), and its differential is \(\mathrm {d}\eta _{\mathcal {L}}= m\mathrm {d}q\wedge \mathrm {d}v\). The Reeb vector fields are:

$$\begin{aligned} R_t^{\mathcal {L}}= \frac{\partial }{\partial t}\ ,\quad R_s^{\mathcal {L}}= \frac{\partial }{\partial s}\,. \end{aligned}$$

Consider a vector field \(X\in {\mathfrak {X}}({\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}})\) with local expression

$$\begin{aligned} X = a\frac{\partial }{\partial t} + F\frac{\partial }{\partial q} + G\frac{\partial }{\partial v} + g\frac{\partial }{\partial s}\,. \end{aligned}$$

The cocontact Lagrangian equations (8) for this vector field yield the conditions

$$\begin{aligned} \left\{ \begin{array}{ll} F = m\,,\\ G = -\frac{k}{m}q + \frac{f(t)}{m} - \frac{\gamma }{m} v\,,\\ g = {\mathcal {L}}\,,\\ a = 1\,. \end{array}\right. \end{aligned}$$

Hence, the vector field X is

$$\begin{aligned} X = \frac{\partial }{\partial t} + v\frac{\partial }{\partial q} + \left( -\frac{k}{m}q + \frac{f(t)}{m} - \gamma v \right) \frac{\partial }{\partial v} + {\mathcal {L}}\frac{\partial }{\partial s}\,. \end{aligned}$$

Its integral curves (t(r), q(r), v(r), s(r)) satisfy the system of differential equations

$$\begin{aligned} \left\{ \begin{array}{ll} \dot{t} = 1\,,\\ m\ddot{q} + \gamma \dot{q} + kq = f(t)\,,\\ \dot{s} = {\mathcal {L}}\,. \end{array}\right. \end{aligned}$$

In Fig. 1a we see the evolution with respect to time of the position and the velocity of the damped oscillator taking as external force a smooth pulse at \(t = 1\). We can see the damping of the position and the velocity. In Fig. 1b we have represented the phase portrait of the same solution where we can see the initial pulse and how the system decays to the equilibrium point due to the friction.

In Fig. 2 we can see the dissipation of both the Lagrangian energy and the mechanical energy given by

$$\begin{aligned} E_m = \frac{1}{2}m v^2 + \frac{1}{2}kq^2\,. \end{aligned}$$

Notice that the Lagrangian energy decays exponentially, while the mechanical energy follows the evolution of the Lagrangian energy but oscillating around it.

Fig. 2
figure 2

Evolution of the mechanical energy (red) and the Lagrangian energy (blue) (color figure online)

7.1.2 Hamiltonian formalism

Consider the Legendre map associated to the Lagrangian function (23):

$$\begin{aligned} {\mathcal {F}}{\mathcal {L}}:{\mathbb {R}}\times \mathrm {T}Q\times {\mathbb {R}}\rightarrow {\mathbb {R}}\times \mathrm {T}^*Q\times {\mathbb {R}}\,, \end{aligned}$$

which is given by

$$\begin{aligned} {\mathcal {F}}{\mathcal {L}}(t,q,v,s) = \left( t,q,p\equiv mv,s\right) \,. \end{aligned}$$

Notice that the Legendre map \({\mathcal {F}}{\mathcal {L}}\) is a global diffeomorphism and hence \({\mathcal {L}}\) is an hyperregular Lagrangian.

Then, \({\mathbb {R}}\times \mathrm {T}^*Q\times {\mathbb {R}}\) is equipped with the cocontact structure \((\mathrm {d}t, \mathrm {d}s - p\mathrm {d}q)\). The Hamiltonian function H such that \({\mathcal {F}}{\mathcal {L}}^*H = E_{\mathcal {L}}\) is

$$\begin{aligned} H(t,q,p,s) = \frac{p^2}{2m} + \frac{k}{2}q^2 - qf(t) + \frac{\gamma }{m} s\,. \end{aligned}$$

Then, a vector field \(Y\in {\mathfrak {X}}({\mathbb {R}}\times \mathrm {T}^*Q\times {\mathbb {R}})\) is a solution to Hamilton’s equation (3) if it has local expression

$$\begin{aligned} Y = \frac{\partial }{\partial t} + \frac{p}{m}\frac{\partial }{\partial q} + \left( \!-kq + f(t) -\frac{p}{m}\gamma \right) \frac{\partial }{\partial p} + \left( \frac{p^2}{2m} - \frac{k}{2}q^2 + qf(t) - \frac{\gamma }{m} s \right) \frac{\partial }{\partial s}\,. \end{aligned}$$

Its integral curves (t(r), q(r), p(r), s(r)) satisfy

$$\begin{aligned} \left\{ \begin{array}{ll} \dot{t} = 1\,,\\ \dot{q} = \frac{p}{m}\,,\\ \dot{p} = -kq + f(t) - \frac{p}{m}\gamma \,,\\ \dot{s} = \frac{p^2}{2m} - \frac{k}{2}q^2 + qf(t) - \frac{\gamma }{m} s\,. \end{array}\right. \end{aligned}$$

Combining the second and the third equations above, we obtain the second-order differential equation

$$\begin{aligned} m\ddot{q} + \gamma \dot{q} + kq = f(t) \,. \end{aligned}$$

7.2 A time-dependent system with central force and friction

Consider the Kepler problem in the case where the mass of the particle subjected to the central force is a non-vanishing function of time m(t). It is clear that the motion of the particle is on a plane and hence the configuration manifold is \(Q = R^2{\setminus }{0}\) endowed with coordinates \((r,\varphi )\).

The phase bundle \({\mathbb {R}}\times \mathrm {T}^*Q\times {\mathbb {R}}\) with coordinates \((t, r, \varphi , p_r, p_\varphi , s)\) has a natural cocontact structure given by the 1-forms \(\tau = \mathrm {d}t\) and \(\eta = \mathrm {d}s - p_r\mathrm {d}r - p_\varphi \mathrm {d}\varphi \). The Reeb vector fields are

$$\begin{aligned} R_t = \frac{\partial }{\partial t}\ ,\quad R_s = \frac{\partial }{\partial s}\,. \end{aligned}$$

Consider the Hamiltonian function \(H\in {\mathscr {C}}^\infty ({\mathbb {R}}\times \mathrm {T}^*Q\times {\mathbb {R}})\) given by

$$\begin{aligned} H(t, r, \varphi , p_r, p_\varphi , s) = \frac{p_r^2}{2m(t)} + \frac{p_\varphi ^2}{2m(t)r^2} + \frac{k}{r} + \gamma s\,. \end{aligned}$$

The vector field \(X\in {\mathfrak {X}}({\mathbb {R}}\times \mathrm {T}^*Q\times {\mathbb {R}})\) satisfying equations (3) has local expression

$$\begin{aligned} X= & {} \frac{\partial }{\partial t} + \frac{p_r}{m(t)}\frac{\partial }{\partial r} + \frac{p_\varphi }{m(t)r^2}\frac{\partial }{\partial \varphi } + \left( \frac{p_\varphi ^2}{m(t)r^3} + \frac{k}{r^2} - \gamma p_r \right) \frac{\partial }{\partial p_r}\\&- \gamma p_\varphi \frac{\partial }{\partial p_\varphi } + \left( \frac{p_r^2}{2m(t)} + \frac{p_\varphi ^2}{2m(t)r^2} - \frac{k}{r} - \gamma s \right) \frac{\partial }{\partial s}\,. \end{aligned}$$

Then, the integral curves \((t, r, \varphi , p_r, p_\varphi , s)\) satisfy

$$\begin{aligned} \left\{ \begin{array}{ll} \dot{t} = 1\,,\\ m(t)\dot{r} = p_r\,,\\ m(t)r^2{{\dot{\varphi }}} = p_\varphi \,,\\ \dot{p}_r = \frac{p_\varphi ^2}{m(t)r^3} + \frac{k}{r^2} - \gamma p_r\,,\\ \dot{p}_\varphi = -\gamma p_\varphi \,,\\ \dot{s} = \frac{p_r^2}{2m(t)} + \frac{p_\varphi ^2}{2m(t)r^2} - \frac{k}{r} - \gamma s\,. \end{array}\right. \end{aligned}$$

Hence, the integral curves must fulfill the system of second-order equations

$$\begin{aligned} \left\{ \begin{array}{ll} \frac{\mathrm {d}}{\mathrm {d}t}\left( m(t)\dot{r} \right) = m(t)r{{\dot{\varphi }}}^2 + \frac{k}{r^2} - \gamma m(t)\dot{r}\,,\\ \frac{\mathrm {d}}{\mathrm {d}t}\left( m(t)r^2{{\dot{\varphi }}} \right) = -\gamma m(t)r^2{{\dot{\varphi }}}\,. \end{array}\right. \end{aligned}$$

7.3 Damped pendulum with variable length

Consider a damped pendulum of mass m with variable length \(\ell (t)\) [32]. Its position in the plane can be described using polar coordinates \((r,\theta )\). The constraint \(r = \ell (t)\) will be introduced in the Lagrangian function via a Lagrange multiplier. The phase space of this system is the bundle \({\mathbb {R}}\times \mathrm {T}{\mathbb {R}}^3\times {\mathbb {R}}\), equipped with coordinates \((t, r, \theta , \lambda , v_r, v_\theta , v_\lambda , s)\). The Lagrangian function describing this system is

$$\begin{aligned} {\mathcal {L}}= \frac{1}{2}m(v_r^2 + r^2v_\theta ^2) - mgr(1-\cos \theta ) + \lambda (r-\ell (t)) - \gamma s\in {\mathscr {C}}^\infty ({\mathbb {R}}\times \mathrm {T}{\mathbb {R}}^3\times {\mathbb {R}})\,, \end{aligned}$$

where \(\lambda \) is the Lagrange multiplier.

The contact 1-form is

$$\begin{aligned} \eta _{\mathcal {L}}= \mathrm {d}s - mv_r\mathrm {d}r - mr^2v_\theta \mathrm {d}\theta \,, \end{aligned}$$

then

$$\begin{aligned} \mathrm {d}\eta _{\mathcal {L}}= m\mathrm {d}r\wedge \mathrm {d}v_r + 2mrv_\theta \mathrm {d}\theta \wedge \mathrm {d}r + mr^2\mathrm {d}\theta \wedge \mathrm {d}v_\theta \,, \end{aligned}$$

and we have the 1-form \(\tau = \mathrm {d}t\). Hence, \(({\mathbb {R}}\times \mathrm {T}{\mathbb {R}}^3\times {\mathbb {R}}, \tau ,\eta _{\mathcal {L}})\) is a precocontact manifold. We can take as Reeb vector fields \(R_s = \partial /\partial s\), \(R_t = \partial /\partial t\). The characteristic distribution of \((\tau ,\eta _{\mathcal {L}})\) is

$$\begin{aligned} {\mathcal {C}}= \ker \tau \cap \ker \eta _{\mathcal {L}}\cap \ker \mathrm {d}\eta _{\mathcal {L}}= \left\langle \frac{\partial }{\partial \lambda },\frac{\partial }{\partial v_\lambda } \right\rangle \,. \end{aligned}$$

The Lagrangian energy associated to \({\mathcal {L}}\) is

$$\begin{aligned} E_{\mathcal {L}}= \frac{1}{2}m(v_r^2 + r^2v_\theta ^2) + mgr(1-\cos \theta ) - \lambda (r-\ell (t)) + \gamma s\,, \end{aligned}$$

and thus

$$\begin{aligned}&\mathrm {d}E_{\mathcal {L}}- R_t(E_{\mathcal {L}})\mathrm {d}t - R_s(E_{\mathcal {L}})\eta \\&\quad = mv_r\mathrm {d}v_r + mr^2v_\theta \mathrm {d}v_\theta + \big (mrv_\theta ^2 + mg(1-\cos \theta ) - \lambda + \gamma m v_r\big )\mathrm {d}r \\&\qquad + \big ( mgr\sin \theta + \gamma mr^2 v_\theta \big )\mathrm {d}\theta - (r - \ell (t))\mathrm {d}\lambda \,. \end{aligned}$$

Consider a sode \(X\in {\mathfrak {X}}({\mathbb {R}}\times \mathrm {T}{\mathbb {R}}^3\times {\mathbb {R}})\) with local expression

$$\begin{aligned} X = f\frac{\partial }{\partial t} + v_r\frac{\partial }{\partial r} + v_\theta \frac{\partial }{\partial \theta } + v_\lambda \frac{\partial }{\partial \lambda } + G_r\frac{\partial }{\partial v_r} + G_\theta \frac{\partial }{\partial v_\theta } + G_\lambda \frac{\partial }{\partial v_\lambda } + g\frac{\partial }{\partial s}\,. \end{aligned}$$

The dynamical equations for the vector field X yield the conditions

$$\begin{aligned} f= & {} 1\,,\quad v_r = v_r\,,\quad v_\theta = v_\theta \,,\quad r - \ell (t) = 0\,,\quad g = {\mathcal {L}}\,,\\ G_r= & {} rv_\theta ^2 - g(1-\cos \theta ) + \frac{\lambda }{m} - \gamma v_r\,,\quad G_\theta = -\frac{2}{r}v_r v_\theta - \frac{g}{r}\sin \theta - \gamma v_\theta \end{aligned}$$

and we obtain the constraint function

$$\begin{aligned} \xi _1 = r - \ell (t)\,, \end{aligned}$$

defining the first constraint submanifold \(M_1\hookrightarrow {\mathbb {R}}\times \mathrm {T}{\mathbb {R}}^3\times {\mathbb {R}}\).

Hence, the vector field X has the form

$$\begin{aligned} X&= \frac{\partial }{\partial t} + v_r\frac{\partial }{\partial r} + v_\theta \frac{\partial }{\partial \theta } + v_\lambda \frac{\partial }{\partial \lambda } + \left( rv_\theta ^2 - g(1-\cos \theta ) + \frac{\lambda }{m} - \gamma v_r\right) \frac{\partial }{\partial v_r}\\&\quad + \left( -\frac{2}{r}v_r v_\theta - \frac{g}{r}\sin \theta - \gamma v_\theta \right) \frac{\partial }{\partial v_\theta } + G_\lambda \frac{\partial }{\partial v_\lambda } + {\mathcal {L}}\frac{\partial }{\partial s}\qquad \text {(on } M_1\text {)}\,. \end{aligned}$$
Fig. 3
figure 3

Plots of the pendulum with friction coefficient \(\gamma =0.5\) and \(\ell (t) = 1 + 0.1\sin (2\pi t)\)

Fig. 4
figure 4

Plots of the pendulum with friction coefficient \(\gamma =0.75\) and \(\ell (t) = 1 + 0.1\sin (2\pi t)\)

Imposing the tangency of the vector field X to the submanifold \(M_1\), namely the condition \({\mathscr {L}}_X \xi _1 = 0\), we obtain the constraint

$$\begin{aligned} \xi _2 = v_r - \ell '(t) = 0\qquad \text {(on } M_1\text {)}\,, \end{aligned}$$

defining a new constraint submanifold \(M_2\hookrightarrow M_1\). The tangency condition \({\mathscr {L}}_X \xi _2 = 0\) of the vector field X to the submanifold \(M_2\) yields the new constraint function

$$\begin{aligned} \xi _3 = mr v_\theta ^2 - g(1-\cos \theta ) + \lambda - m\gamma \ell '(t) - \ell ''(t)\qquad \text {(on }\, M_2 \text {)}\,, \end{aligned}$$

defining a new constraint submanifold \(M_3\hookrightarrow M_2\), and we also get \(G_r = \ell ''(t)\). Imposing again the tangency condition we obtain a new constraint function

$$\begin{aligned} \xi _4 = {\mathscr {L}}_X \xi _3&= v_\lambda - 3m\ell '(t) v_\theta ^2 - 2m\ell (t)\gamma v_\theta ^2 - mg v_\theta \sin \theta \\&\quad - m\gamma \ell ''(t) - m\ell '''(t)\qquad \text {(on } M_3 \text {)}\,, \end{aligned}$$

defining the submanifold \(M_4\hookrightarrow M_3\). Requiring X to be tangent to \(M_4\) we determine the last coefficient \(G_\lambda \), whose expression we will omit, and no new constraints appear. Thus, there is a unique vector field solution to equations (8) and has local expression

$$\begin{aligned} X&= \frac{\partial }{\partial t} + \ell '(t)\frac{\partial }{\partial r} + v_\theta \frac{\partial }{\partial \theta } + \left( 3m\ell '(t) v_\theta ^2 + 2m\ell (t)\gamma v_\theta ^2\right. \\&\quad \left. + mg v_\theta \sin \theta + m\gamma \ell ''(t) + m\ell '''(t) \right) \frac{\partial }{\partial \lambda } \\&\quad + \ell ''(t)\frac{\partial }{\partial v_r} + \left( -\frac{2}{r}v_r v_\theta - \frac{g}{r}\sin \theta - \gamma v_\theta \right) \frac{\partial }{\partial v_\theta }\\&\quad + G_\lambda \frac{\partial }{\partial v_\lambda } + {\mathcal {L}}\frac{\partial }{\partial s}\qquad \text {(on } M_4 \text {)}\,. \end{aligned}$$

The integral curves of this vector field satisfy the following second-order differential equation

$$\begin{aligned} \ddot{\theta }= -\gamma {{\dot{\theta }}} - 2\frac{\ell '(t)}{\ell (t)}{{\dot{\theta }}} - \frac{g}{\ell (t)}\sin \theta \,. \end{aligned}$$
(24)

Notice that if we consider a pendulum with fixed length \(\ell (t) = \ell _\circ \), we recover the usual equation for a damped pendulum:

$$\begin{aligned} \ddot{\theta }= -\gamma {{\dot{\theta }}} - \frac{g}{\ell _\circ }\sin \theta \,. \end{aligned}$$

On the other hand, setting \(\gamma =0\) in equation (24), we obtain the equation of the simple pendulum with variable length studied in [32].

In Figs. 3 and 4 we have represented a couple of simulations of a damped pendulum of mass \(m=1\) with variable length considering \(\ell (t) = 1 + 0.1\sin (2\pi t)\), friction coefficients \(\gamma = 0.5\) and \(\gamma = 0.75\) respectively, and initial conditions \(\theta (0) = \pi /4\) and \({{\dot{\theta }}}(0) = 0\). We have plotted the evolution of the radial and angular coordinates and we can see the loss of amplitude, and hence of energy, of the system. Notice that in this example, the energy does not tend to zero, but to a positive constant since the radial coordinates keeps oscillating forever.

8 Conclusions and further research

In this paper we have introduced a geometrical formulation for time-dependent contact systems by defining a new geometric structure: cocontact manifolds. This new notion combines the well-known contact and cosymplectic structures. We have also proved that cocontact manifolds are Jacobi manifolds and defined and characterize the notions of isotropic and Legendrian submanifolds.

This geometrical setting allows us to develop the Hamiltonian and Lagrangian formalisms for time-dependent contact systems, generalizing those for contact systems [6, 18, 26] and cosymplectic systems [23]. In addition, we have studied the problem where the system is defined by a singular Lagrangian, thus introducing the notion of precocontact structure. This is useful since many systems are defined by singular Lagrangians. As an application, we have studied the particular case of cocontact systems with time-dependent holonomic constraints.

We have worked out two regular examples: the damped forced harmonic oscillator and the Kepler problem with non-constant mass and friction; and a singular one: a pendulum with variable length and friction. This last example is singular because we have introduced the constraint with a Lagrange multiplier and the constraint algorithm gives back the constraint. Computer simulations of some of these examples have been included.

The structures introduced in this paper could be used to improve our understanding of time-dependent dissipative systems. For instance, providing new geometric integrators [7,8,9, 49] from the discretization of the obtained equations, discussing symmetries and their associated dissipated and conserved quantities, and studying reduction procedures such as coisotropic reduction [1, 18] and Marsden–Weinstein reduction [42]. It would be also interesting to state the Hamilton–Jacobi theory for these systems and describe the Skinner–Rusk unified formalism for cocontact systems.

The formulation presented in this work is also a first step towards finding a geometric formalism for non-autonomous dissipative field theories based on the k-contact setting [25, 27, 34] and generalizing the multisymplectic formalism [12, 46]. The k-contact formalism allows to describe autonomous field theories, such as field theories with damping, some equations from circuit theory, such as the so-called telegrapher’s equation, or the Burgers’ equation. Nevertheless, there are many examples of non-autonomous field theories, like Maxwell’s equations with a non constant charge density or general relativity with matter sources that require a formulation for non-autonomous field theories.