{'fraction_non_alphanumeric': 0.053517680166401564, 'fraction_numerical': 0.016689098250336473, 'mean_word_length': 4.292152292152292, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Continuous and discrete damping reduction for systems with quadratic interaction

We study the connection between Lagrangian and Hamiltonian descriptions of closed/open dynamics, for a collection of particles with quadratic interaction (closed system) and a sub-collection of particles with linear damping (open system). We consider both continuous and discrete versions of mechanics. We define the Damping Reduction as the mapping from the equations of motion of the closed system to those of the open one. As variational instruments for the obtention of these equations we use the Hamilton's principle (closed dynamics) and Lagrange-d'Alembert principle (open dynamics). We establish the commutativity of the branches Legendre transform + Damping Reduction and Damping Reduction+Legendre transform, where the Legendre transform is the usual mapping between Lagrangian and Hamiltonian mechanics. At a discrete level, this commutativity provides interesting insight about the resulting integrators. More concretely, Discrete Damping Reduction yields particular numerical schemes for linearly damped systems which are not symplectic anymore, but preserve some of the features of their symplectic counterparts from which they proceed (for instance the semi-implicitness in some cases). The theoretical results are illustrated with the examples of the heat bath and transmission lines. In the latter case some simulations are displayed, showing a better performance of the integrators with variational origin.


Introduction
The variational description of non-conservative physical systems (open systems) represents a difficult task from the mathematical physics perspective. A cornerstone concerning this issue is the proof in [4] that the dynamical equations of a linearly damped mechanical system cannot be obtained via the Hamilton's principle [1,2]. Ever since, there have been several attempts to provide a general method of dealing with non-conservative forces in classical mechanics, for instance the use of Rayleigh dissipation forces [11], the doubling of variables [3,9,16] and the use of fractional derivatives [8,14,20]. A remarkable approach, due to its phenomenological versatility, is the Lagrange-d'Alembert principle [5], where the variation of the action is set equal to an additional integral term involving the work done by external forces (those provoking that the system is not conservative) under virtual displacements. As happens with the usual Hamilton's principle (which is suitable for the dynamical description of conservative systems), the Lagrange-d'Alembert principle can be performed in Lagrangian and Hamiltonian fashions, both related to each other by the Legendre transformation [1]. It is important to note, however, that Lagrange-d'Alembert principle is not variational in the pure sense on the word.
Among all non-conservative systems, we will focus in this work on those subject to linear damping. From a physical perspective, damping can be considered as a phenomenon produced by the interaction of the open system under consideration and its environment, forming both (open system+environment) a closed system which can be dealt with by means of the usual variational techniques. This closed-system modeling of open system's dynamics is widely used in describing dissipative quantum mechanical systems [6]. As for the closed system, we consider a collection of particles where we allow quadratic interaction. The open subsystem will be a sub-collection of these particles subject to linear damping (and also to a conservative potential interaction among them). We refer to the process of Damping Reduction (DR) as the mapping from the equations of motion of the closed system obtained from the Hamilton's principle (i.e. Euler-Lagrange equations and Hamilton equations) to those expressing the external forcing (yield by Lagrange-d'Alembert principle).
The main aim of this paper is showing the commutativity of the diagram schematically displayed in Figure 1 (left), which involves Hamilton's principle, the Legendre transformation and DR. It is worth noting that the path EL Eqs → Forced EL Eqs → Forced Ham Eqs, shall involve as well the Lagrange-d'Alembert principle, as the pseudo-variational tool to describe forced mechanical systems. We remark also that the DR is performed from the dynamical equations, and not at the action level. In particular, we differentiate between the dynamical equations of the open system and the environment; replacing the solution of the latter (which will depend in general on the initial conditions of all variables) in the former, leads to the forced equations of the open subsystem. This is schematically shown in Figure 1 (right) for the Lagrangian side (the Hamiltonian is equivalent). Finally, our investigation not only concerns the continuous version of mechanics, but also the discrete one. The discrete version of mechanics [17,18] yields unified numerical schemes approximating the continuous dynamics with powerful structure-preserving properties. In particular, the discretisation of Hamilton's principle provides the so-called discrete Euler-Lagrange equations, which under some regularity conditions produce numerical integrators (variational integrators) that are symplectic [21] and momentum preserving in the presence of symmetries. These integrators are applied over conservative systems and, in spite they do not preserve the energy, have proven to present a stable behaviour, explained in terms of Backward Error Analysis [12,13]. Both the Legendre transformation [17] and the Lagrange-d'Alembert principle [19] are available at the discrete level (represented the former as discrete momentum matching; accounting the latter for the discrete description of externally forced systems, hence open), and therefore the question whether the diagram Figure 1 (left) is commutative for discrete mechanics raises naturally. We investigate this circumstance for systems with quadractic interaction and a continuous family of discretisations depending on a parameter γ ∈ [0, 1] ⊂ R. We prove the commutativity; moreover, we observe that the numerical schemes after the discrete version of the Damping Reduction, although non-symplectic anymore (they are applied now to open systems), preserve some of the features of their symplectic couterparts, for instance the semi-implicitness in some cases. Furthermore, we illustrate our results with the example of two particles with quadratic potential coupled to transmission lines, and observe a superior approximation of the dissipative energy in the case of the obtained semi-implicit schemes over other state-of-the-art schemes, namely the implicit and explicit Euler methods.
The paper is organised as follows: §2 and §3 introduce Hamilton's principle and the Lagranged'Alembert principle, both in Lagrangian and Hamiltonian forms, for continuous and discrete mechanics, respectively. §4 accounts for the introduction of the system under study, i.e. N particles with quadratic interaction. We define the Continuous Damping Reduction (CDR), both in Lagrangian and Hamiltonian forms, and prove in Theorem 4.3 that the diagram Figure 1 (left) is commutative. We illustrate the theorem by means of the Heat Bath example, where we show carefully the Damping Reduction process. In §5 we establish the discrete counterpart of Theorem 4.3. Namely, we provide a continuous family of discretisation of the closed and open systems (depending on γ ∈ [0, 1]), we define the discrete version of Damping Reduction (DDR) and prove in Theorem 5.4 that the diagram Figure 1 (left) is commutative also at a discrete level. This accounts for the major contribution of the paper. §6 illustrates this last result with the example of transmission lines. We simulate the obtained integrators after reduction for γ = 0 and a harmonic potential, observing a superior performance over the usual Euler discretisations.

Continuous Lagrangian and Hamiltonian description of Closed/Open systems
In the sequel we shall consider the configuration space of the studied systems as a finite dimensional smooth manifold Q. Moreover, T Q and T * Q will denote its tangent and cotangent bundles, locally represented by coordinates (q,q) and (q, p), respectively. For more details on the geometric formulation of mechanics we refer to [1] 2.1. Closed systems. Given a Lagrangian function L : T Q → R, the associated action functional in the time interval [0, T ] for a smooth curve q : Through Hamilton's principle, i.e. the true evolution of the system q(t) with fixed endpoints q(0) and q(T ) will satisfy we obtain the Euler-Lagrange equations via calculus of variations: Define the Legendre transformation: If (3) is a global diffeomorphism we say that it is hyperregular, and we call the Lagrangian function hyperregular. Under the assumption of hyperregularity, through the Legendre transformation we can define the Hamiltonian function H : T * Q → R: where ·, · : T * Q × T Q → R is the natural pairing. From the definition of the Hamiltonian function (4) it follows that L(q,q) = p,q − H(q, p). Furthermore, from (1) we can write the stationary condition of the action functional in a Hamiltonian version, i.e.
Again, using calculus of variations we obtain the Hamilton equations: We shall consider that the physical energy of the system is given by the Hamiltonian function (4). It is easy to check that dH(q, p)/dt = 0 under (6), showing that the system is closed. Equivalently, the Lagrangian energy is invariant under (2), i.e. dE(q,q)/dt = 0.
2.2. Forced systems. First we model the external forces (which might include damping, dragging, etc.) through the mapping The forced dynamics is provided by the Lagrange-d'Alembert principle [2,5]: the true evolution of the system q(t) between fixed points q(0) and q(T ) will satisfy where δq ∈ T Q, which provides the forced Euler-Lagrange equations: Now, the Lagrangian energy of the system (7) is not preserved by (10). In particular dE(q,q)/dt = f L (q,q),q , showing that this kind of systems is open. The dual version of the Lagrange-d'Alembert principle (9) is naturally obtained through the Legendre transformation (3). The dual external forces f H : −1 (we recall that we are assuming L hyperregular), while the dynamics is established by yielding the forced Hamilton equationṡ Obviously, the Hamiltonian function (4) is not preserved under (12). In particular dH(q, p)/dt = f H (q, p), ∂H ∂p .
3. Discrete Lagrangian and Hamiltonian description of Closed/Open systems 3.1. Closed systems. The construction of the discrete version of mechanics relies on the substitution of T Q by the Cartesian product Q×Q (note that these two spaces contain the same amount of information at local level) [17,18]. The continuous curves q(t) will be replaced by discrete ones, say q d = {q k } 0:N := {q 0 , q 1 , ..., q N } ∈ Q N +1 , where N ∈ N and the power N +1 indicates the Cartesian product of N + 1 copies of Q. Given an increasing sequence of times {t k = hk | k = 0, ..., N } ⊂ R, with h = T /N , the points in q d will be considered as an approximation of the continuous curve at time t k , i.e. q k q(t k ). Defining the discrete Lagrngian L d : Q × Q → R as an approximation of the action integral in one time step, say L d (q k , q k+1 ) t k +h t k L(q(t),q(t)) dt, we can establish the so called discrete action sum: Applying the Hamilton's principle over (13), i.e. considering variations of q d with fixed endpoints q 0 , q N and extremizing S d , we obtain the discrete Euler-Lagrange equations where D 1 and D 2 denote the partial derivative with respect to the first and second variables, respectively. If L d is regular, i.e. the matrix D 12 L d is invertible, the equations (14) define a discrete Lagrangian flow F L d : Q × Q → Q × Q; (q k , q k+1 ) → (q k+1 , q k+2 ), which is normally called variational integrator of the continuous dynamics provided by the Euler-Lagrange equations (2) (indistinctly, we shall call the equations (14) also variational integrator). Moreover, (14) are a discretisation in finite differences of (2). In order to establish the Hamiltonian picture we need to introduce the discrete Legendre transforms. From L d two of them can be defined: We observe that the momentum matching condition, i.e.
provides the discrete Euler-Lagrange equations (14) according to (15) (based on this, we shall refer indistinctly to the discrete Legendre transform as momentum matching). Under the regularity of L d , both discrete Legendre transforms are invertible and the discrete Hamiltonian flowF L d : can be defined by any of the following identities: see [17] for the proof. At the Hamiltonian level, the mapF L d is called variational integrator of the continuous dynamics provided by the Hamilton equations (6). Moreover, the discrete equations provided by (15) are a discretisation in finite differences of (6). A crucial feature of variational integrators is its symplecticity. If Ω T * Q is the canonical symplectic form on T * Q (which, according to Darboux theorem, can be locally written as Ω T * Q = dq ∧dp), Thus, the symplecticity of the variational integrators imply F * L d Ω Q×Q = Ω Q×Q [17,18], which furthermore imply that the energy cannot be conserved at the same time [10]. However, symplectic integrators have proven to present a stable energy behaviour even in long-term simulations [21], behaviour that can be explained in terms of Backward Error Analysis [12,13].
3.2. Forced systems. As discrete version of the external forces (8) we consider the maps Note that the previous equation implies that f − L d (q k , q k+1 ) ∈ T * q k Q and f + L d (q k , q k+1 ) ∈ T * q k+1 Q. The discrete Lagrange-d'Alembert principle [17,19] provides discrete curves between fixed q 0 , q N satisfying the critical condition These curves are given by the forced discrete Euler-Lagrange equations they are a discretisation in finite differences of (10) and, under the regularity of the matrix , provide a forced discrete Lagrangian map F f L d : Q × Q → Q × Q approximating their continuous solution. In the forced case, the discrete Legendre transformation is defined by The momentum matching condition (16) reproduces the forced discrete Euler-Lagrange equations (18). Moreover, (19) provide a discretisation in finite differences of (12), whereas (17)

System of N particles with quadratic interaction
We shall consider a system of N particles. The configuration space of each particle is Q = R d . We will allow quadratic interaction among all of them, plus a conservative potential among the n < N particles of the open subsystem.
4.1. Closed system. Consider (q i ,q i ) ∈ T R d the coordinates and velocities of the i-th particle for i = 1, ..., N; d, N ∈ N. Define (q,q) := ((q 1 ,q 1 ), (q 2 ,q 2 ), ..., (q N ,q N )) and the Lagrangian function where m i ∈ R + for all i; λ ij ∈ R for all i, j; n ∈ N with n ≤ N (n the number of particles of the open subsystem) and V : (R d ) n → R is a smooth function. As we shall see, different distributions of the particles in space correspond to different matrices Λ := (λ ij ) ∈ R N×N . In all cases Λ is symmetric, since it encodes the reciprocal interaction between i, j-th particles. Finally, for sake of simplicity, we denote q i q j := q T i q j in terms of R d scalar product; the same applies for velocities and momenta.  (20), it is easy to see that a change of variables r i = R ij q j generates the new Lagrangian with diag(λ 1 , ..., λ N ) = R T ΛR. This Lagrangian acounts for a set of N decoupled harmonic oscillators, and therefore the interaction between the open subystem and the environment is absent. This exemplifies that the possibility of performing the damping reduction, as we shall detail in the examples, relies strongly on the particular expression of Λ, and that any transformation to a simpler problem might eliminate some of the physical properties that lead to the damping of the open subsystem.
Since we are dealing with closed systems, the energy, both in its Lagrangian (7) and Hamiltonian forms is invariant under the dynamics (21) and (23), respectively. This is dE(q,q)/dt = dH(q, p)/dt = 0, which can be checked after a straightforward computation, as discussed in §2.1.

Continuous Damping
Reduction: the open system. By Continuous Damping Reduction (CDR henceforth) of the Euler-Lagrange(21)/Hamilton(23) dynamical equations we mean the process of focusing on a subsystem of n ∈ N particles (n < N ) which is linearly damped in all coordinates due to the physical interaction with the enviroment. The CDR, which has its physical roots in the quadratic interaction will obey a particular physical process depending on the kind of system we are dealing with. Let us define (q,q) := ((q 1 ,q 1 ), ..., (q n ,q n )) and (q,p) := ((q 1 , p 1 ), ..., (q n , p n )), the coordinates, velocities and momenta of the open subsystem. Moreover, consider its Lagrangian L s : where the superscript s stands for subsystem. It is easy to check that the Legendre transformation FL s (3) relating (24a) and (24b) is locally defined by p a = FL s (q a ,q a ) = m aq a . Given this, we define the CDR as follows Definition 4.2. For i, j = 1, ..., N, and a, b = 1, ..., n; we define the CDR in its Lagrangian and Hamiltonian forms, respectively, as where (25b) follows directly from (25a) just employing the Legendre transform.
Note that, in order to emphasize that after CDR we are going to focus in the open subsystem, we employ different indices, particularly i, j for the closed system and a, b for the open one. Finally, the relationship between the matrices Λ andΛ := (λ ab ) ∈ R n×n (corresponding to the distribution of the open subsystem) is determined by the particular physical process producing the CDR.
The Lagrangian CDR (25a) applied to (21) provides the dynamical equations of the damped open subsystem, i.e.
Define the external forces by again for a = 1, ..., n; linked through FL s . It is easy to check that the Lagrange-d'Alembert principle (9) for L s (q,q) (24a) and external forces f L (q,q) (27a) provides the open Lagrangian dynamics (26). The previous discussion allows us to establish the following theorem.
On the other hand, as metioned above the forced Euler-Lagrange equations for the damped subsystem of n particles (26) can be obtained through the Lagrange-d'Alembert principle for L s (q,q) (24a) and external forces f L (q,q) (27a). The application of the Legendre transform over this principle yields its Hamiltonian expression for H s (q,p) (24b) and external forces f H (q,p) (27b), which in coordinates looks like Taking variations in the first integral, doing integration by parts and considering that δq a (0) = δq a (T ) = δp a (0) = δp a (T ) = 0 yields directly FHEqs n . This accounts for the branch 1 and proves the theorem. ij κ ijqiqj , where the matrix K = (κ ij ) is not diagonal. Such terms correspond to mechanical systems known as inerters [15,22], for which the kinetic energy is defined as: whereq fin andq in denote the terminal points of an inerter, and b denotes the inertance. In order for the diagram to commute for such systems one needs to apply linear transformations on the coordinates and momenta. In order to illustrate this phenomenon, let us consider two masses (m in , m fin ) coupled to one another through a transmission line comprising a set of inerters and springs (with n ∈ N inerters). After applying the Legendre transformation to the Lagrangian (see [15]), the Hamiltonian function of the closed system reads where k in , k fin , k ∈ R are spring coupling constants between the first mass and the first interter, between the second mass and the final inerter, and between the inerters themselves, respectively. We observe a non-diagonal kinetic energy due to the coupling among the momenta within the inerter line, i.e. p i p j , and the inerters and final mass, i.e. p fin p i . It can be shown that, after Hamiltonian CDR (similar to §6, see [15] for more details), the equations for the open system read where D depends on the k s and b. It is apparent that these are not linearly damped equations. However, it can be shown as well that redefining the momenta byp fin := m finqfin = p fin + n i=1 p i the open equations become which are (29) for two particles with V (q in , q fin ) = k in q 2 in /2 + k fin q 2 fin /2 andΛ = −D D D −D .

4.3.
Example: Heat Bath. In the example sections (both here and §6) we consider a set of two linear dissipative systems that are interacting with one another through an arbitrary interaction potential as illustrated in Figure 2.  We observe that the open subsystem contains two particles, this is n = 2, corresponding to q 1 and q 2 . The total set of particles is denoted by {q i } N 1 := {q 1 , q 2 , ..., q N−1 , q N }. According to (25a) we are going to employ the index a = 1, 2, to denote the particles in the open subsystem. Moreover, for simplicity, we consider that both heat baths contain the same amount of particles, i.e. (N − 2)/2. Taking this into account, we can rearrange the particle ordering as where naturally Q j a denotes the j-th oscillator coupled to the a-th open system (not to confuse with Q the smooth manifold introduced in §2). Using this notation, the Lagrangian dynamics of the closed system is given by Here, ω j a denotes the frequency of the j-th oscillator coupled to the a-th open system, and γ j a denotes the strength of the interaction of the j-th oscillator and the a-th open system; henceforth, we shall consider that m j a = M for all a and j. We can rearrange (31) to obtain L(q,q) = Using (30), (31) and comparing to Figure 3, we observe that the quadratic interaction matrix Λ is given by Using the Legendre transformation (3) on (31), we obtain the Hamiltonian function H(q, p) = 2 a=1 H s (q a , p a ) + 2 a=1 H hb (q a , p a ; Q a , P a ), where: H hb (q a , p a ; Q a , P a ) = The dynamics of the closed system can be obtained by applying the Hamilton's equation (6) to (33), yielding:q The heat bath degrees of freedom can be eliminated by solving their dynamics (34c), (34d) in terms of the open system degrees of freedom: Q j a (t) = Q j a (0) cos(ω j a t) + P j a (0) sin(ω j a t)/ω j a + γ j a t 0 dt q a (t ) sin(ω j a (t − t )) ω j a .

Doing integration by parts and using the solution for the open system in equation (34d), one obtains the following form of the solution for the open system:
Here γ a (t−t ) denotes the memory function [24] for the dissipation. In other words, the dissipative dynamics is not local-in-time: As the system dynamics becomes local-in-time the memory function converges to the delta function, i.e. γ a (t − t ) → γ a δ(t − t ) with γ a ∈ R. This can be understood by observing that replacing the γ a (t − t ) with γ a δ(t − t ) turns the integro differential equation (35b) in to local differential equation. An environment with a memory function proportional to a delta function is referred to as a Markovian or memoryless environment. Typically, an environment with large number of degrees of freedom exhibit Markovian behavior. In the equation (36), as N → ∞ the sum can be replaced with a integral and by choosing the right distribution for the coupling constants, e.g. γ j = γω j : F (t) is the force term which depends on the initial conditions of the heat bath and the initial position of the open system: Here F (t) can be considered as the random fluctuation force exerted on the open system by the environment.
In such case, the equations of the open system (35) becomė which correspond to equations (29). In conclusion, the physical process leading to equations (38) represents the Hamiltonian Continuous Damping Reduction (CDR) (25b) and the branch 2 in Theorem 4.3 (also the process scketched in Figure 1 (right)). Observe that equations (38) contain the non-autonomous term F (t), that only vanishes if P j a (0) = 0 and Q j a (0) = γ j a q a (0)/(ω j a ) 2 , which is a rather unnatural scenario. Then, apparently this example does not fit diagram (28). However, it is easy to see that the diagram admits a non-autonomous extension, which consists basically in adding external non-autonomous forces after damping reduction and also in f L , f H .
Furthermore, the damping matrixΛ is given bỹ Branch 1 in Theorem 4.3 is given by the following steps. First we obtain the Euler-Lagrange equations from Lagrangian (31) through the Hamilton's principle: We can eliminate the degrees of freedom of the heat bath Q j a from (40b) using analogous arguments as in the Hamiltonian side. This process leads from (40a) to which is the Langevin equation for a Brownian motion, i.e. the random motion of a particle immersed in a fluid and being subject to dissipation and fluctuation [24]. By assuming that the environment is Markovian which accounts for the Lagrangian Continuous Damping Reduction (25a). Furthermore, it is easy to see that (42) can be equivalently obtained from the Lagrange-d'Alembert principle (9) using L s (q a ,q a ) (32a) and external forces f L (q a ,q a ) (27a) given by the damped matrixΛ (39). Finally, after aplying the Legendre transform given by the Lagrangian of the open subsystem, i.e. FL s , over the Lagrangian itself and the external forces, we can employ the Lagrange-d'Alembert principle in its Hamiltonian form (11) with H s (q a , p a ) (33a) and f H (q a , p a ) (27b) (againΛ in (39)) in order to reobtain (38). This sets the commutativity of diagram (28) for the heat bath, as established in Theorem 4.3.
Note finally that we have set n = 2 for simplicity in the figures, but we have not made any further restriction on the index a along the example. Therefore, this procedure applies to any n < N.

Discrete counterpart
According to §3 we set the following discretisation L d (q k , q k+1 ) : , ..., q k+1 n ) (the same for k): with γ ∈ [0, 1]. The discrete Euler-Lagrange equations (14) in this case read for i = 1, ..., N and k = 1, ..., N − 1. We will denote these equations DELEqs γ N in the diagram below (after Discrete Euler Lagrange Equations), accounting for the closed system containing the N particles and depending on the γ parameter. As discussed above, (44) are a discretisation in finite differences of (21).
Remark 5.1. Observe that both γ = 1 and γ = 0, corresponding to the initial and final endpoint discretisations, respectively, provide the same discrete EL equations: whereas γ = 1/2 (midpoint rule) leads to The discrete Legendre transforms (15) over (43) read From these equations it is easy to check that This equation + momentum mathching (16) provides the symplectic integrator: which is implicit in both q and p. Similarly to the Lagrangian side, we will denote these equations in the diagram below as DHEqs γ N (after Discrete Hamilton Equations). Remark 5.2. Note that γ = 0 and γ = 1 generate, respectively, for i = 1, ..., N and k = 1, ..., N − 1; which are both symplectic Euler [13,21] discretisations of (23). Note the semi-implicit nature of both integrators, i.e. implicit in q and explicit in p for γ = 0 and conversely for γ = 1 Finally, γ = 1/2 generates naturally the midpoint rule again implicit in both q and p.
plus the discrete external forces The forced discrete Legendre transform (19) for this system reads which furthermore yields where (50b) follows directly from (50a) and (49).
With these elements we can establish the following theorem.
Theorem 5.4. Given a discrete Lagrangian function L d (q k , q k+1 , γ) (43) for a closed system of N interacting particles, the discrete Lagrangian of the open subsystem L s d (q k ,q k+1 , γ) (46), the DDR given in Definition 5.3 and the discrete forces (47), the following diagram commutes. (14) DHEqs γ N , (45) In other words, its two branches, i.e. Proof. Applying (50b) to the DHEqs γ N (45) we obtain which are FDHEqs γ n . This accounts for branch 2 in the diagram. On the other hand, we observe that the application of the Lagrangian DDR (50a) over (44) produces which are denoted FDELEqs γ n (after Forced Discrete Euler Lagrange Equations) in the diagram, accounting for the open system containing the n particles and depending on the γ parameter. It is easy to see that the choice of (46) for the discrete Lagrangian of the open subsystem and (47) for the discrete forces, also provides FDELEqs γ n through the Lagrange-d'Alembert principle (18). Furthermore, (53) are equivalent to the momentum mathching condition (p k a ) − = (p k a ) + for (48a), (48b). Using (49) and (48), one arrives to which, after considering that a m a that follows directly from (49), are again FDHEqs γ n and accounts for branch 1 in the diagram, proving its commutativity.
Remark 5.5. Naturally, FDHEqs γ n are not symplectic integrators anymore, since they are approximating the dynamics of non-Hamiltonian systems. However, we observe that FDHEqs 0 n and FDHEqs 1 n , i.e.
retain the semi-implicit nature of their symplectic counterparts for the closed system shown in Remark 5.2. Finally FDHEqs 1/2 is fully implicit as its symplectic counterpart.  As in §4.3 we assume that there are (N − 2)/2 in each transmission line; moreover, we also employ the notation (30). The Lagrangian of the closed system illustrated in Figure 4 reads as following: where L s encodes the dynamics of the open systems a = 1, 2, L tl encodes the dynamics of their corresponding environment (transmission lines) j = 1, 2, ..., (N−2)/2, and L int encodes the systemenvironment interaction. In particular: Here we will assume that m j a = M for all a and j. Moreover, each transmission line is coupled to the corresponding open system q a through the same coupling strength with which its elements are coupled together, namely λ a . We observe that Figure 4 and (54) correspond to the following quadratic interaction matrix Λ, which we show decomposed in boxes for simplicity: Λ 0 encodes the quadratic interaction among the particles q 1 , q 2 , Q 1 1 , Q 1 2 (in this precise order both in rows and columns), whereas Λ 1 represents the same for the set Q 1 1 , Q 2 1 , · · · , Q (N−2)/2 1 (in order to clarify the notation, we remark that the δ -th η-th entry in Λ 1 would be the (δ + 1)th (γ + 1)-th in Λ, since the latter incorporates rows and columns for q 1 , q 2 , whereas the ones corresponding to Q 1 2 are displaced from Λ 0 to Λ 2 as we shall comment shortly). We observe that Λ 1 is 0 except for the diagonal and upper and lower diagonal entries, which physically means that each particle in the transmission line only interacts with its first neighbours (and its own quadratic potential λ 1 (Q j 1 ) 2 /2). The interaction among Q 1 2 , Q 2 2 , · · · , Q (N−2)/2 2 is given by Λ 2 , which is equivalent to Λ 1 with 1 → 2 (according to the notation above, the δ -th η-th entry in Λ 2 corresponds to (δ + N−4 2 )-th (η + N−4 2 )-th in Λ). The Euler-Lagrange equations for the closed system (54) read as following: As the number of particles forming the transmission line tends to infinity, i.e. N → ∞, while the length of the line remains finite, the equations (55) tend to a set of spatially continuous equations: where ρ = M/h x is the mass density of the transmission line (h x being the spatial separation of the systems in the line), and K a = h x λ a . As it is obvious from (56), we are considering q a as a function of space and time, i.e. q a = q a (t, x) (we consider that the transmission line is distributed along the x direction of R d ). (56b) is a wave equation which admits the following solution in terms of inward and outward traveling waves with the velocity v a = K a /ρ : . Now, we will make a crucial assumption, q in a (x + v a t) = 0; that is, the transmission line is long enough compared to the time scale of system dynamics, and thus, there will not be any waves traveling towards the open system as a result of reflection. 3 With this assumption it is easy to check the following identity ∂q a (t, In other words, the wave solution for the behavior of the transmission line converts the spatial derivatives into temporal derivatives. Consequently, (56a) can be written in the following dissipative form m aqa + ∂ qa V + D aqa = 0, a = 1, 2; with D a = √ K a ρ being the damping rate. Thus, by eliminating the environment (transmission line, whose dynamics is given by (55b)), from the closed system dynamics (both equations (55)), the resulting dynamics for the two-mass system (open system) appears dissipative. This represents the Lagrangian CDR for the system given in Figure 4, where (58) accounts for (26). The damping matrixΛ readsΛ From (54), using the Legendre transformation one obtains the Hamiltonian function and L int is given in (54c). Using the same arguments which led to (56), we observe that the dynamics of the open system can be written in terms of the Hamilton's equations as following: Employing the relationiship (57), these equations can be re-written in the following form: These equations represent the dynamics of the forced (open) system after the Hamiltonian CDR.
With these equations and the particular expressions of the subsystem Lagrangian L s (54a), the subsystem Hamiltonian (60) and the damping matrix (59), it is easy to establish the commutativity prescribed in Theorem 4.3.
Remark 6.1. The generalisation of the previous development to several transmission lines attached to each particle in the open subsystem is straightforward. We observe that each transmission line must be placed along one of the independent spacial directions in R d , such that there are no wave projections over the other ones (we sketch such a system in Figure 5, where naturally the projection is inevitable). Q j (a,α) would represent the j-th particle of the α-th transmission line attached to the a-th particle in the open subsystem, all of them with mass M . Assuming that there are a total of N particles, and d (at most) transmission lines for each a, then a = 1, 2; α = 1, ..., d and j = 1, ..., (N − 2)/2d. Furthermore, we assume that there are only outgoing waves in each direction, i.e. q a (t, where v (a,α) = K (a,α) /ρ α , K (a,α) = h xα λ a and ρ α = M/h xα ; with h xα the spatial separation of the system in the x α -line. Taking into account the superposition of waves, following the showed CDR we end up with the damped equation   6.2. Discrete setting. Now we will consider the closed system illustrated in Figure 4 in a temporally discrete setting. The corresponding discrete dynamics is encoded in the discrete Lagrangian (43), where we choose γ = 0, which in this case reads where k denotes the discrete time index. Similar to the continuous counterpart, L s d encodes the dynamics of the open system, L tl d encodes the dynamics of the environment and L int d encodes the system-environment interaction: Furthermore, the discrete Euler-Lagrange equations DELEqs 0 N (44) are: for k = 1, ..., N − 1 and j = 2, ..., (N − 2)/2 − 1. It is easy to check (for details see [15]) that discrete wave-like equation (62b) can be satisfied with following solution: in terms of inward and outward discrete traveling waves where the velocity v = hx h is defined in terms of the spatial and temporal slices and t k = kh, k = 0, ..., N. According to this, it is easy to check that Similar to the continuous analogue, one finds v a = K a /ρ. By making the same crucial assumption of no reflection in the transmission line, i.e. q in (x j − vt k ) = 0, we can see the following identity: which converts spatial differences into temporal differences. As a result of that, the equation (62a) can be re-written in the following form: with D a = √ K a ρ being the damping rate. Since Q 0 a ≡ q a , we obtain In this example, these are FDELEqs 0 n . The process leading to (65) corresponds to the Lagrangian Discrete Damping Reduction (DDR) (50a) for the transmission line system, withΛ determined in (59). The same discrete forced Euler-Lagrange equations may be obtained through the discrete Lagrange-d'Alembert principle (18) by picking L s d (q k a , q k+1 a ) (61a) and the discrete forces (47) with γ = 0, as established in diagram (51). From (61), we apply the discrete Legendre transform (15), in order to obtain DHEqs 0 N : It is easy to observe that the momentum mathching (p a ) (k,−) = p (k,+) a and (P j a ) (k,−) = (P j a ) (k,+) reproduce the discrete Euler-Lagrange equation (62a) and (62b), respectively. Finally, the equations (66a), (66b) can be expressed in the following form: given the appropriate elimination of the discrete dynamics of the enviroment (66c), (66d) based on the conversion of spatial difference to temporal difference encoded in the equation (63). This accounts for the Hamiltonian DDR (50b), and the previous equations are the DFHEqs 0 n in this example. They can be equivalently obtained from forced momentum matching (19), i.e.:  (51). This provides its commutativity in the Rubin model case, as set in Theorem 5.4. Moreover, as mentioned in Remark 5.5, the obtained integrators are semi-implicit in nature which is a direct result of the DDR of the symplectic integrators for the system-environment as a whole (closed system) given in equations (62).
In the following we compare the accuracy of the approximations of different integrators for a binary oscillator in a linear dissipative environment illustrated in Figure 6(a), which corresponds to the potential V (q 1 , q 2 ) = 1 2 k(q 1 − q 2 ) 2 . Figures 6 (b) and (c) depict the approximate dynamics of the displacement of m 1 and the energy decay of the binary oscillator respectively, with the initial condition q 1 (0) = 10, q 2 (0) = −10. Dynamics of the displacement of the m 1 in time with the initial condition q 1 (0) = 10, q 2 (0) = −10, and the parameters m 1 = m 2 = 100, k = 10000 and a characteristic damping rate D = 100. The integrators constructed by explicit Euler, implicit Euler and semi-implicit Euler are represented by green circles, blue squares, and red stars, respectively. The numerically exact solution and symplectic integration associated to the closed system of transmission line with the parameters M = 1, λ = 2000 are represented with black diamonds and magenta triangles, both of which almost coincide with semi-implicit approximation. (c) Depicts the energy decays of the binary system in time with the same symbols described in (b). In addition the full energy of the closed system is calculated by the symplectic integrator and represented by cyan plus symbols. As one can see the total energy of the system-environment is a symmetry of the dynamics and is preserved up to bounded oscillations under symplectic integration.

Conclusions
We prove the commutativity of the branches Legendre Transform + Damping Reduction and Damping Reduction +Legendre transform as shown in Figure 1 (left), connecting Lagrangian and Hamiltonian descriptions of open/closed dynamics, for a system of N particles with quadratic interaction and both continuous and discrete versions of mechanics. We consider the damping as a physical phenomenon due to the interaction between the given open system (linearly damped) and its environment, forming both a closed system. The Damping Reduction is considered as the mapping from the equations of motion of the closed system to those of the open one (i.e. closed → open dynamics). As a natural instrument for the dynamical description of forced systems (open), we employ the Lagrange-d'Alembert principle. Although this commutativity might seem natural when established at a continuous level, it is not at a discrete level. We prove it for a family of discretisations depending on a parameter γ ∈ [0, 1], accounting for the major contribution of the paper.
We observe that the applicability of the Damping Reduction in the exposed terms (i.e. Figure 1 (right)) depends on the distribution of the particles, represented by the matrix Λ. We provide two particular examples (heat bath Λ hb and trasmission lines Λ tl ) where it can be performed.
The questions for what kind of Λ the reduction can be undertaken, or whether any Λ can be transformed to Λ hb,tl via linear change of variables, remain open, and also interesting lines of investigation.
The Damping Reduction at a discrete level yields particular numerical schemes approximating the dynamics of linearly damped systems. These schemes are not symplectic anymore, but preserve some of the features of their symplectic counterparts (for instance the semi-implicitness in some cases) which are indeed obtained in a variational way. We display some simulations for the transmission line example, and observe a better performance over other usual integrators (both dynamically and energy wise), in particular the Euler schemes. This is a new example showing that the integrators with a variational origin perform superiorly when approximating the energy evolution of the systems, even though they are not conservative.