Fellow, IEEE, Doroth Salvatore Monaco
email: salvatore.monaco@uniroma1.it

Member, IEEE Mattia Mattioni
email: mattia.mattioni@uniroma1.it

Student Member, IEEE Alessio Moreschini
email: alessio.moreschini@uniroma1.it

D Normand-Cyrot
email: dorothee.normand-cyrot@centralesupelec.fr

Nonlinear Hamiltonian systems under sampling

Keywords: Sampled-data control, Energy Systems, Computational methods, Nonlinear systems

This paper investigates the transformation of Hamiltonian structures under sampling. It is shown that the exact sampled-data equivalent model associated to a given port-Hamiltonian continuous-time dynamics exhibits a discrete-time representation in terms of the discrete gradient, with the same energy function but modified damping and interconnection matrices. By construction, the proposed sampled-data dynamics guarantees exact matching of both the state evolutions and the energy-balance at all sampling instants. Its generalization to port-controlled Hamiltonian dynamics leads to characterize a new power conjugate output which recovers the average-passivating output. On these bases, energy-management control strategies are proposed. An energetic interpretation is confirmed by its description in the Dirac formalism. Two classical examples are worked out to validate the proposed sampleddata modeling in a comparative way with the literature.

I. INTRODUCTION

Gradient or Hamiltonian dynamics at large, endorsing straight relations with fundamental physical properties such as energy conservation or variation principles, have been widely investigated in the continuous-time setting (see [START_REF] Wiggins | Introduction to applied nonlinear dynamical systems and chaos[END_REF], [START_REF] Van Der Schaft | Port-Hamiltonian systems theory: An introductory overview[END_REF] and references therein). Among the vast dedicated literature, two main conceptual approaches can be distinguished with their own features depending on the goal, modeling or control: the Dirac approach and the input-state-output approach. The former one, employing an abstract generalization of the bondgraph formalism, is particularly efficient to model the interconnections and the energy flowing between the components of the system [START_REF] Maschke | Port-controlled Hamiltonian systems: modelling origins and systemtheoretic properties[END_REF]- [START_REF] Duindam | Modeling and control of complex physical systems: the port-Hamiltonian approach[END_REF]. The latter one, based on the differential representation of the Hamiltonian function, is well suited for energy-based design [START_REF] Ortega | Interconnection and damping assignment passivity-based control of port-controlled Hamiltonian systems[END_REF]- [START_REF] Van Der Schaft | Port-Hamiltonian modeling for control[END_REF]. Nowadays, an efficient interplay between both approaches supports innovative research in various physical domains where energy and energy exchanges serve as lingua franca (e.g., [START_REF] Duindam | Modeling and control of complex physical systems: the port-Hamiltonian approach[END_REF], [START_REF] Ortega | Putting energy back in control[END_REF], [START_REF] Van Der Schaft | L2-gain and passivity techniques in nonlinear control[END_REF]).

All of this essentially concerns the continuous-time framework while a consensus on a unifying input-state-output representation of Hamiltonian structures in discrete time is still missing. Two approaches coexist, describing port-Hamiltonian systems on discrete manifolds in the Dirac formalism [START_REF] Talasila | Geometry and Hamiltonian mechanics on discrete spaces[END_REF]- [START_REF] Šešlija | Port-Hamiltonian systems on discrete manifolds[END_REF] or Hamiltonian difference equations in a state-space oriented approach [START_REF] Itoh | Hamiltonian-conserving discrete canonical equations based on variational difference quotients[END_REF]- [START_REF] Quispel | A new class of energy-preserving numerical integration methods[END_REF]. In this case, the discrete gradient function, a geometric and numerical integration tool properly expressing the variation of a function between two points, is used in place of the usual gradient function. We note that if, one one side, the discrete gradient function opens towards discrete structures looking similar to the continuoustime ones, on the other it generates implicit difference statespace representations. The interest of the community recently extends to a digital environment including dynamics issued from sampling, with direct impact in real time applications. In this context, several works find their roots in various sampling and time-integration devices so providing Hamiltonian forms through symplectic integration [START_REF] Le Gorrec | Dirac structures and boundary control systems associated with skew-symmetric differential operators[END_REF]- [START_REF] Trenchant | Finite differences on staggered grids preserving the port-Hamiltonian structure with application to an acoustic duct[END_REF], geometric scattering [START_REF] Stramigioli | Sampled data systems passivity and discrete port-Hamiltonian systems[END_REF], spatial discretization of the continuous-time energybalance [START_REF] Bansal | Port-Hamiltonian modelling of fluid dynamics models with variable cross-section[END_REF], [START_REF] Bansal | Structure-preserving spatial discretization of a two-fluid model[END_REF], Galerkin discretization [START_REF] Moulla | Pseudo-spectral methods for the spatial symplectic reduction of open systems of conservation laws[END_REF] up to numerical methods like Runge-Kutta [START_REF] Laila | Discrete-time IDA-PBC design for underactuated Hamiltonian control systems[END_REF], Gauss-Legendre [START_REF] Kotyczka | Discrete-time port-Hamiltonian systems: A definition based on symplectic integration[END_REF]. Despite these studies provide structures satisfying the required energybalance properties, well identified links between all these forms are still missing.

The attempt of this work is to fill this gap, understanding which discrete-time Hamiltonian input-state-output representation is recovered when sampling a continuous-time Hamiltonian one. The study is performed for general nonlinear forms and set in a formal way, inspired from the Lie series framework involved in the characterization of sampled dynamics associated to nonlinear differential dynamics developed in [START_REF] Monaco | From chronological calculus to exponential representations of continuous and discrete-time dynamics: A lie-algebraic approach[END_REF]. A further motivation to this work is in recent authors' contributions [START_REF] Moreschini | Discrete port-controlled Hamiltonian dynamics and average passivation[END_REF] describing, in a differential-geometric setting, discrete-time port-Hamiltonian structures embedding the required properties of energy conservation or dissipation. These discrete-time forms are adopted in the present study as target structures to recover under exact sampling.

Along these lines, the paper addresses the preservation of Hamiltonian structures under sampling or time-integration at large and in a nonlinear context. In all cases (gradient, port-Hamiltonian or port-controlled Hamiltonian), we show that similar discrete-time structures can be recovered under exact sampling with respect to the same Hamiltonian func-tion with modified structural matrices (embedding the interconnection and the dissipation matrices). As a consequence of exact matching of the state behaviours with unchanged Hamiltonian function, the energy properties of the continuoustime structure are preserved at all sampling instants. The approach is constructive. The solutions are described by their series expansions in powers of the sampling period that can be computed, iteratively, in an approximation perspective. In addition, the continuous-time model is recovered in first approximation so preserving a physical interpretation of the results. To strengthen physical validity, the associated discrete Dirac structure is described and compared with the underlying continuous-time one.

In detail, the contributions of this work are specified below.

• Formal expressions of discrete gradient, discrete Jacobian and discrete Hessian along a given sampled-data dynamics are in Proposition 3.4. These forms provide new computable series expansions of these objects around the usual gradient, Jacobian and Hessian. • Theorem 4.1 and Theorem 5.1 describe the sampleddata equivalent forms to continuous-time gradient and Hamiltonian structures respectively: gradient forms are transformed into Hamiltonian-like ones with modified dissipation matrix; conservative or dissipative Hamiltonian structures are transformed into equivalent structures under exact sampling that preserve the continuous-time energy-balance equality at the sampling instants. All these forms are parameterized by the sampling period. • The characterization of port-controlled Hamiltonian dynamics under sampling is in Theorem 6.1 opening towards energy-based stabilizing control strategies. A power-conjugate output is defined and its relation with the average-passifying output introduced in [START_REF] Monaco | Nonlinear average passivity and stabilizing controllers in discrete time[END_REF] is clarified. Accordingly, digital damping through negative output feedback may be worked out for stabilization. • The discrete Dirac structure sustaining the proposed sampled-data form is described in Theorem 6.3 reinforcing its physical interpretation. Besides their theoretical interests, the results are constructive opening wide perspectives to digital energy management and structure assignment design as well as networked modeling of interconnected structures. A preliminary work making reference to Linear Time Invariant (LTI) models is in [START_REF] Moreschini | Gradient and hamiltonian dynamics under sampling[END_REF].

The rest of the paper is organized as follows. Notations and recalls are in Section II to fix port-Hamiltonian input-stateoutput representations in both the continuous and discrete-time frameworks. The notions of discrete gradient, Jacobian and Hessian are given. The section ends formalizing the general question addressed in the paper with the LTI case discussed as a motivating example. In Section III, instrumental results, developed in the formalism of the algebra of series, are proved as fundamental tools to reshape exact sampled-data models into discrete port-Hamiltonian structures. Section IV addresses the question for gradient dynamics as a preliminary attempt towards the case of port-Hamiltonian dynamics. The main results are in Sections V where sampled-data input-state-output representations of port-Hamiltonian dynamics are described and their structural and energetic properties highlighted. Section VI discusses the extension to port-controlled Hamiltonian dynamics. On these bases, energy-based stabilizing control strategies are briefly recalled. In Section VII, simulated case studies are worked out to illustrate computational aspects. Concluding remarks end the paper.

II. PROLEGOMENA

A. Some notations All functions and vector fields defining the dynamics are assumed smooth and complete over the respective definition spaces. R and N denote the set of real and natural numbers including 0 respectively. R n×m denotes the set of real valued n × m matrices. For any vector v ∈ R n , |v| and v define the norm and transpose of v respectively. I d denotes the identity function on the definition space while I denotes the identity operator and the identity matrix when related to a linear operator. For a matrix A ∈ R n×n , we denote by A -1 its inverse and, for the sake of the notations, its pseudoinverse when singular. The symmetric and skew-symmetric parts of A ∈ R n×n are denoted by sym(A) = 1 2 (A + A ) and

skew(A) = 1 2 (A -A ). Given a differentiable real-valued function V (•) : R n → R, ∇V represents the gradient column-vector with ∇ = col{ ∂ ∂ x i } i=1,n and ∇ 2 V denotes its Hessian matrix with ∇ 2 = ∂ 2 ∂ x i ,∂ x j i, j=1,n . Given a vector-valued function F(x) = col(F 1 (x), . . . , F n (x)), J[F(x)] = { ∂ ∂ x j F i (x)} i, j=1
,n denotes the Jacobian of F.

The symbols " > 0" and " < 0" denote positive and negative definite functions (or matrices), respectively. Indicating by X a formal variable that can represent an operator (or a matrix in the linear case), one defines the formal exponential series e X = I + ∑ p≥1 X p p! with X p the power p composition of X with respect to a given product. Accordingly, formal manipulations are worked out as the inverse series denoted by (I + X) -1 with (I + X) -1 = I + ∑ p≥1 (-1) p X p , or formal quotient denoted by e X -1 X , that stands for the formal cancellation of X in the numerator series e X -1 so getting e X -I X = I + ∑ p≥1 X p (p+1)! ; similar rules apply to define formal algebraic relations along the paper.

Given a smooth vector field

f over R n , L f = ∑ n i=1 f i (x) ∂ ∂ x i
denotes its associated Lie derivative operator. Setting L 0 f = I, one iteratively defines the composition at power p as

L p f = L f L p-1 f ; e f := I + ∑ p≥1 L p f
p! represents the exponential Lie series operator recovering, for linear vector fields, the exponential of the matrix representing the operator. For any smooth function h(•) : R n → R, the equality of functions e f h(x) = h(e f (x)) = e f h| x holds true [START_REF] Gröbner | Contributions to the method of Lie series[END_REF]Page 22], where | x denotes the evaluation of the function at x. Given a function of time γ(t), γ k := γ(kδ ) denotes its value at time t = kδ , with k ∈ N for a fixed δ ∈]0, T [, T > 0. The root-mean-square error (RMSE) between a continuous-time function γ(t) and a discrete sequence γ d (kδ ) is given for T > 0 by RMSE =

∑ T k=1 1 T (γ d (kδ ) -γ(t)| t=kδ ) 2 . A function R(x, δ ) = O(δ p ) is said in O(δ p ) δ p , p ≥ 1 if whenever it is defined, it can be written as R(x, δ ) = δ p-1 R(x, δ ) and there exist a function θ ∈ K ∞ and δ > 0 such that ∀δ ≤ δ , | R(x, δ )| ≤ θ (δ ).
Given two matrices A ∈ R n 1 ×n 2 and B ∈ R m 1 ×m 2 , the Kronecker product is denoted by A ⊗ B ∈ R n 1 m 1 ×n 2 m 2 . Given a matrix-valued function L(x) : R n → R n×n , the following representations are set under differentiation

∂ L(x) ∂ x = ∂ ∂ x ⊗ L(x) = ∂ L(x) ∂ x 1 . . . ∂ L(x) ∂ x n ∈ R n×n 2
and consequently, for an n-dimensional vector, N(x) :

R n → R n ∂ L(x)N(x) ∂ x = ∂ L(x) ∂ x (N(x) ⊗ I) + L(x) ∂ N(x) ∂ x =L(x) ∂ ∂ x N(x) + n ∑ i=1 ∂ ∂ x i L(x) N(x).

B. Discrete gradient function

Let us first recall from the literature (see [START_REF] Gonzalez | Time integration and discrete Hamiltonian systems[END_REF], [START_REF] Mclachlan | Geometric integration using discrete gradients[END_REF], [START_REF] Hairer | Geometric numerical integration: structure-preserving algorithms for ordinary differential equations[END_REF]) the definition of discrete gradient function.

Definition 2.1 (Discrete gradient): Given a smooth realvalued function V (•) : R n → R, its discrete gradient is a vectorvalued function of two variables, ∇V

. . : R n ×R n → R n , defined as ∇V w v = col ∇i V w v i=1,n
satisfying the variational equality

V (w) -V (v) = (w -v) ∇V w v (1)
with, by continuity, ∇V

v v = ∇V (v).
From this definition, the extended notions of discrete Jacobian and discrete Hessian are now introduced.

Definition 2.2 (Discrete Jacobian): Given a vector function F = col{F 1 , . . . , F n } : R n → R n with F i (•) : R n → R, its discrete Jacobian is a matrix-valued function of two variables J

[F] . . : R n × R n → R n×n defined as J[F] w v = ∇ j [F i ] w v i, j=1,n and satisfying F(w) -F(v)= J[F] w v (w -v) = col (w -v) ∇F i w v i=1,n (2)
with ∇F i w v = col ∇ j F i w v j=1,n
and by continuity J

[F] v v = J[F(v)]. When F(•) = ∇V (•), one defines the discrete Hessian matrix of V (•) as ∇2 V w v = J[∇V ] w v with ∇2 V v v = ∇ 2 V (v).
According to Definitions above, the discrete gradient and the discrete Jacobian are not uniquely defined depending on choice of the the path from v to w. For instance, for v = col{v 1 , . . . , v n } and w = col{w 1 , . . . , w n }, the discrete gradient can be computed component-wise through the integral form ∇i

V w v = 1 w i -v i w i v i ∂V (w 1 , ..., w i-1 , ξ , v i+1 , ..., v n ) ∂ ξ dξ . (3)
In the following, the general constructive forms of the discrete gradient function and discrete Jacobian matrix proposed below are used.

Proposition 2.1: For a given smooth function V (•) : R n → R, by the mean value theorem, one gets

V (w) -V (v) = (w -v) 1 0 ∇V v+s(w-v)
ds so providing the constructive form of the discrete gradient

∇V w v = 1 0 ∇V v+s(w-v) ds (4) with v + s(w -v) = col{v 1 + s(w 1 -v 1 ), • • • , v n + s(w n -v n )}.
Analogously, for a given smooth vector function F(•) : R n → R n , one gets

F(w) -F(v) = 1 0 J[F] v+s(w-v)
ds(wv) so providing the constructive forms of the discrete Jacobian

J[F] w v = 1 0 J[F] v+s(w-v) ds (5)
and of the discrete Hessian when

F(•) = ∇V (•) ∇2 V w v = J[∇V ] w v = 1 0 ∇ 2 V v+s(w-v)
ds.

Remark 2.1: With reference to a quadratic function V (v) = 1 2 v Pv with P = P , the discrete gradient takes the form

∇V w v = 1 2 P(v + w) = 1 2 ∇V (v + w). (6)
Remark 2.2: With reference to a separable function

V (v) = ∑ n i=1 V i (v i ), the integral form (3) simplifies for i = 1, • • • , n as ∇i V w v = 1 w i -v i w i v i dV i (ξ ) dξ dξ = 1 0 ∇V i v i +s(w i -v i )
ds.

C. Port-Hamiltonian dynamics

Hamiltonian dynamics were historically introduced over R 2n , as expressed in the canonical generalized position and momenta coordinates (q, p), through a smooth real-valued function H(•) : R 2n → R. In the recent literature, port-Hamiltonian structures are in general defined over R n , with energy as the state variable and the function H(•) : R n → R, catching the energy-like properties (e.g. [START_REF] Van Der Schaft | Port-Hamiltonian systems theory: An introductory overview[END_REF], [START_REF] Duindam | Modeling and control of complex physical systems: the port-Hamiltonian approach[END_REF]). Such forms are briefly recalled in the continuous and discrete-time settings.

Definition 2.3: Given a smooth real-valued function H(•) : R n → R, a continuous-time port-Hamiltonian dynamics is given by ẋ

= f (x) = (J(x) -R(x))∇H(x) (7)
where J(x) = -J (x) ∈ R n×n and R(x) = R (x) ∈ R n×n with R(x) ≥ 0 are the interconnection and damping matrices.

The following comments are in order:

• any equilibrium x e of (7) coincides with a local extremum of H(x) (∇H(x e ) = 0); • provided H(x) is bounded from below the stability of x e follows from the variational inequality

Ḣ(x) = L f H(x) = -∇ H(x)R(x)∇H(x) ≤ 0;
• when R(x) = 0, conservation of H(x) follows;

• when J(x) and R(x) are constant matrices and H(x) is a quadratic function, [START_REF] Ortega | Control by interconnection and standard passivity-based control of port-Hamiltonian systems[END_REF] specifies a linear Hamiltonian dynamics; • canonical Hamiltonian dynamics are referred to R(x) = 0 and J(x) = 0 I -I 0 ;

• when J(x) -R(x) = -I, (7) is called gradient dynamics.

Models employing the discrete gradient of H(•) have been proposed to represent port-Hamiltonian dynamics in discrete time as recalled here below (see e.g. [START_REF] Mclachlan | Geometric integration using discrete gradients[END_REF], [START_REF] Quispel | A new class of energy-preserving numerical integration methods[END_REF], [START_REF] Moreschini | Discrete port-controlled Hamiltonian dynamics and average passivation[END_REF], [START_REF] Aoues | Hamiltonian systems discrete-time approximation: Losslessness, passivity and composability[END_REF]- [START_REF] Yalc ¸in | Discrete-time modeling of Hamiltonian systems[END_REF]).

Definition 2.4: Given a smooth real-valued function H(•) : R n → R, a discrete-time port-Hamiltonian dynamics is described as

x + = x + (J d (x) -R d (x)) ∇H x + x (8)
where

J d (x) = -J d (x) ∈ R n×n and R d (x) = R d (x) ∈ R n×n with R(x) ≥ 0. J d (x), R d (x)
are the interconnection and damping matrices; x ∈ R n is the state at the discrete-time instant k ≥ 0, while x + indicates its value one step ahead, that is at k + 1.

Exploiting the structure [START_REF] Ortega | Putting energy back in control[END_REF], one verifies the expected energetic properties:

• any local extremum x e ∈ R n of H(•) (i.e., ∇H
H(x + ) -H(x) = -∇ H x + x R d (x) ∇H x + x ≤ 0 (9)
so that x e is stable for (8) if H(x) is bounded from below; • when R d (x) = 0, the dynamics ( 8) is energy-conservative

H(x + ) -H(x) = ∇ H x + x J d (x) ∇H x + x = 0.
The representation (8) specifies the state evolution through a set of implicit first order difference equations. This represents the main source of difficulties: recovering an explicit state space representation in the form of a map (say x + = x + F(x)) from ( 8) is not an easy task, except for the case of a quadratic Hamiltonian function.

Remark 2.3: Assuming H(x) = 1 2
x Px, with P = P ≥ 0 and invoking Remark 2.1, the discrete dynamics (8) rewrites in explicit form as

x + = I - 1 2 (J d (x) -R d (x))P -1 I + 1 2 (J d (x) -R d (x))P x.

D. Problem statement

Consider a generic nonlinear dynamics

ẋ = f (x) (10)
with f (•) : R n → R n . Denoting by δ > 0 the sampling period, its equivalent sampled-data dynamics [START_REF] Monaco | From chronological calculus to exponential representations of continuous and discrete-time dynamics: A lie-algebraic approach[END_REF], specifying the one step-ahead evolution at time t = (k + 1)δ starting from t = kδ , gets the form of a map

x + = x + F δ (x) (11)
with x = x(kδ ), x + = x((k + 1)δ ). Whenever f (x) is smooth, F δ (x) admits the asymptotic expansion in powers of δ

F δ (x) = e δ f x -x = δ f (x) + ∑ i≥2 δ i i! L i-1 f f (x). ( 12
)
for all δ ∈]0, T [ with e δ f x the Lie exponential applied to x and T > 0, the upper bound of the convergence interval of the exponential expansion.

Assuming now a port-Hamiltonian continuous-time dynamics [START_REF] Ortega | Control by interconnection and standard passivity-based control of port-Hamiltonian systems[END_REF] with f (x) = (J(x) -R(x))∇H(x), a natural question arises: is the port-Hamiltonian structure preserved under sampling? More precisely, the problem we address is formalized as follows.

Problem 2.1: Consider a continuous-time port-Hamiltonian dynamics [START_REF] Ortega | Control by interconnection and standard passivity-based control of port-Hamiltonian systems[END_REF] in the sense of Definition 2.3 and let [START_REF] Borja | New results on stabilization of port-Hamiltonian systems via pid passivity-based control[END_REF] be the sampled-data equivalent model. Compute, if any, matrices

J δ ( f , x) = -J δ ( f , x) and R δ ( f , x) = R δ ( f , x) ≥ 0 verifying F δ (x) = δ J δ ( f , x) -R δ ( f , x) ∇H| x+F δ (x) x ;
i.e., the corresponding equivalent sampled-data model ( 12) admits a discrete-time port-Hamiltonian structure in the sense of Definition 2.4

x + = x + δ J δ ( f , x) -R δ ( f , x) ∇H| x +
x verifying, at all sampling instants, x = x(kδ ) for all k ≥ 0 when

x 0 = x(0).
The solution of the problem above has two immediate outcomes: (i) it provides a sampled-data Dirac structure; (ii) it proves the preservation of port-controlled Hamiltonian structure under sampling [START_REF] Moreschini | Discrete port-controlled Hamiltonian dynamics and average passivation[END_REF].

We underline that, for guaranteeing both exact sampling and preservation of the Hamiltonian (energetic) structure, the interconnection and damping matrices J δ ( f , x) and R δ ( f , x) are not the same as in continuous time and result to be explicitly parameterized by δ , the sampling period. This requirement is motivated by the LTI case detailed below.

E. The case of LTI dynamics

For Linear-Time Invariant (LTI) dynamics

ẋ = (J -R)∇H(x) (13)
with quadratic Hamiltonian H(x) = 1 2 x T Px, a solution to Problem 2.1 is in [START_REF] Moreschini | Gradient and hamiltonian dynamics under sampling[END_REF]. More in detail, recalling that ∇H| x + x = 1 2 P(x + x + ), a discrete-time port-Hamiltonian representation of the sampled dynamics associated to ( 13) can be computed by comparing the implicit form [START_REF] Ortega | Putting energy back in control[END_REF] with the explicit sampleddata dynamics computed according to [START_REF] Van Der Schaft | Port-Hamiltonian modeling for control[END_REF]. Comparing the two equivalent representations

x + = e δ (J-R)P x ≡ x + = x + δ 2 (J δ -R δ )(x + x + ) (14)
one deduces the following matrix equalities

e δ (J-R)P = (I - δ 2 (J δ -R δ )) -1 (I + δ 2 (J δ -R δ )) (15a) δ (J δ -R δ ) = 2(e δ (J-R)P -I)(e δ (J-R)P + I) -1 P -1 (15b)
with J δ → J and R δ → 0 as δ → 0. The modified structural matrices J δ and R δ are uniquely defined by (15b) and naturally depend on δ , the sampling period. As an example, for the simplest case of a canonical

Hamiltonian dynamics over R 2 with R = 0 and P = I, one computes

e δ J = cos δ sin δ -sin δ cos δ , δ J δ = 0 2 sin δ 1+cos δ -2 sin δ 1+cos δ 0 (16)
so characterizing the discrete-time Hamiltonian form as

x + = x + δ J δ ∇H x+ x = x + 0 sin δ 1+cos δ -sin δ 1+cos δ 0 (x + x + ) (17)
that matches the sampled evolutions of the continuous-time canonical port-Hamiltonian dynamics over R 2 . The implicit representation [START_REF] Itoh | Hamiltonian-conserving discrete canonical equations based on variational difference quotients[END_REF] motivates the need of mapping J → J δ to recover an equivalent sampled-data representation. Note that J δ is not an arbitrary skew-symmetric matrix, but a proper δ -dependent matrix that infinitesimally recasts J.

III. FORMAL INSTRUMENTAL RESULTS

The results proposed in this section exploit the exponential form representation [START_REF] Van Der Schaft | Port-Hamiltonian modeling for control[END_REF] of sampled-data dynamics to describe the discrete gradient function computed over a fixed sampleddata dynamics. They are at instrumental for the results and to further computational aspects.

Given a continuous-time dynamics [START_REF] Brogliato | Dissipative systems analysis and control[END_REF], let [START_REF] Borja | New results on stabilization of port-Hamiltonian systems via pid passivity-based control[END_REF] be its associated sampled-data model described in the form of a map as in [START_REF] Van Der Schaft | Port-Hamiltonian modeling for control[END_REF]. At first, the formal differential operator defined as

D δ f = e δ f -I δ f = I + ∑ i≥1 δ i (i + 1)! L i f ( 18
)
is introduced. The first proposition provides a matrix form with respect to the vector field f (x) for the variation of the sampled-data map F δ (x).

Proposition 3.1: Given a continuous-time dynamics (10) on R n , then for all δ ∈]0, T [, its associated sampled-data equivalent dynamics satisfies the equality below

x + -x = F δ (x) = δ M δ ( f , x) f (x) (19)
with square matrix M δ ( f , x), locally non singular, given by

M δ ( f , x) = 1 δ δ 0 J[x(s)]ds = J[D δ f (x)] (20)
and x(s) = e s f x. Proof: The proof follows from the definition of x + = e δ f x and computing

e δ f x -x = δ f (x) + δ 2 2! L f f (x) + δ 3 3! L 2 f f (x) + . . . = (δ J[x] + δ 2 2! J[ f ] + δ 3 3! J[L f f ] + . . . ) f (x) = J[δ x + δ 2 2! f (x) + δ 3 3! L f f (x) + . . . ] f (x) = J[δ D δ f (x)] f (x) = J[ δ 0 e s f xds] f (x) = δ 0 J[e s f x]ds f (x) = δ M δ ( f , x) f (x)
with M δ ( f , x) as in [START_REF] Hairer | Geometric numerical integration: structure-preserving algorithms for ordinary differential equations[END_REF]. The non singularity of M δ ( f , x) follows by construction for δ small enough.

It is worth to note that M δ ( f , x) coincides with the Jacobian, evaluated at x, of the result of the differential operator D δ f applied to the identity function; it admits an asymptotic expansion in powers of δ of the form

M δ ( f , x) = J[D δ f (x)] = J[ e δ f -I δ f (x)] (21)
= I + δ 2 J[ f (x)] + δ 2 3! J[J[ f (x)] f (x)] + ∑ i≥3 δ i (i + 1)! J[L i-1 f f (x)].
Remark 3.1: According to [START_REF] Mclachlan | Geometric integration using discrete gradients[END_REF], truncating the polynomial expansion M δ ( f , x) in ( 21) at any finite order in δ provides approximate sampled-data dynamics of increasing order. Setting M δ ( f , x) = I, the Euler approximation is recovered.

Remark 3.2: With reference to a LTI dynamics,

f (x) = Ax, one gets D δ Ax (x) = (e δ A -I)(δ A) -1
x and thus, for all δ > 0, a constant matrix M δ = (e δ A -I)(δ A) -1 parameterized by δ and satisfying [START_REF] Mclachlan | Geometric integration using discrete gradients[END_REF]; i.e.

x + -x = δ M δ Ax = δ (I + δ 2! A + δ 2 3! A 2 + • • • )Ax = e δ A x -x.
The next proposition specifies the variation of a real valued function V (•) along the sampled-data dynamics [START_REF] Borja | New results on stabilization of port-Hamiltonian systems via pid passivity-based control[END_REF].

Proposition 3.2: Given a smooth vector field f (•) on R n and a smooth real valued function V (•) : R n → R, then for all δ ∈]0, T [, the variation of the function V (•) along the associated sampled-data dynamics [START_REF] Borja | New results on stabilization of port-Hamiltonian systems via pid passivity-based control[END_REF] satisfies the equality

V (x + ) -V (x) δ = ∇ V δ av ( f , x) f (x) = L f V δ av ( f , x) (22)
with, for x(s) = e s f x,

V δ av ( f , x) = 1 δ δ 0 V (x(s))ds = D δ f (V )(x). ( 23
)
Proof: The proof follows from the definition of V (x + ) = e δ f V (x) when x + = e δ f x, so getting

e δ f V (x) -V (x) = δ L f V (x) + δ 2 2! L 2 f V (x) + δ 3 3! L 3 f V (x) + . . . = δ L f V (x) + δ 2! L f V (x) + δ 3 3! L f V (x) + . . . = ∇ δV (x) + δ 2 2! L f V (x) + δ 3 3! L f V (x) + . . . f (x) = ∇ δ 0 e s f V (x)ds f (x) = ∇ δ 0 V (x(s))ds f (x).
V δ av (•) in ( 23) can be computed through the application of D δ f to V (•) and evaluating the result at x so getting the asymptotic expansion

V δ av ( f , x) = D δ f (V )(x) = V (x) + ∑ i≥1 δ i (i + 1)! L i f V (x). ( 24
)
Remark 3.3: With reference to the LTI case, f (x) = Ax and V (x) = 1 2 x Px, one obtains from (24) V δ av ( f , x) = 1 2 x P δ x and

P δ = 1 δ δ 0 e sA Pe As ds = (e δ A + I)P(e δ A -I)(δ A) -1 = P + ∑ i≥1 δ i (i + 1)! P i
and P i = P i-1 A+A P i-1 . From [START_REF] Le Gorrec | Dirac structures and boundary control systems associated with skew-symmetric differential operators[END_REF], the variation of V (•) along the linear sampled-data dynamics gives

V (x + ) -V (x) = δ x P δ Ax =
x (e δ A + I)P(e δ A -I)x. From the previous Propositions, it is possible to give a constructive characterization of the discrete gradient of any function V (•) along the sampled dynamics (11) associated to any f (•). Such a form is clearly not uniquely defined.

Proposition 3.3: Given a smooth vector field f (•) on R n , then for all δ ∈]0, T [, the discrete gradient of V (•) along the sampled dynamics [START_REF] Borja | New results on stabilization of port-Hamiltonian systems via pid passivity-based control[END_REF] can be computed as

∇ V x + x = ∇ V δ av ( f , x)(M δ ( f , x)) -1 = D δ f (∇V )(x) J[D δ f (x)] -1 . ( 25
)
Proof: From Definition 2.1, Propositions 3.1 and 3.2, one gets the equality

∇ V x + x M δ ( f , x) f (x)=∇ V δ av ( f , x) f (x)= D δ f (∇V )(x) f (x)
which proves that ( 25) is an admissible solution because of invertibility of the matrix M δ ( f , x) for δ small enough. When

δ → 0 and x + = x, one recovers ∇ V x x = ∇V (x).
For the first terms, one computes in

O(δ 3 ) (M δ ( f , x)) -1 = I - δ 2 J[ f (x)] - δ 2 3! J[J[ f (x)] f (x)]+ δ 2 4 J[ f (x)]J[ f (x)]+O(δ 3 ). Remark 3.4: With reference to f (x) = Ax and V (x) = 1 2
x Px, one obtains from ( 25)

∇V x + x = δ A(e δ A -I) -1 P δ x. (26)
Finally, the following relation can be set between the usual gradient of a given function V (•) and its discrete gradient along the sampled dynamics associated to a vector field f (x).

Proposition 3.4: Given a smooth vector field f (•) on R n , then for all δ ∈]0, T [, the discrete gradient of V (•) along the sampled-data dynamics e δ f xx = F δ (x) satisfies the equality

∇V x + x = ∇V (x) + δ Q δ (V, f , x) f (x) (27)
with square matrix Q δ (V, f , x) given by

Q δ (V, f , x)= 1 0 1 0 s 1 ∇ 2 V x+s 2 s 1 F δ (x) ds 2 ds 1 M δ ( f , x). ( 28
)
Proof: The proof follows from Proposition 2.1 as

∇V x + x = ∇V x+F δ (x) x = 1 0 ∇V (x + s 1 F δ (x))ds 1 = = ∇V (x) + 1 0 s 1 J[∇V ] x+s 1 F δ (x) x F δ (x)ds 1 = ∇V (x) + 1 0 s 1 ∇2 V x+s 1 F δ (x) x F δ (x)ds 1 so recovering (27) as ∇2 V x+s 1 F δ (x) x = 1 0 ∇ 2 V x+s 2 s 1 F δ (x) ds 2 and F δ (x) = δ M δ ( f , x) f (x) from Proposition 3.1.
For the first terms one gets

δ Q δ (V, f , x) = δ 2 ∇ 2 V (x) + δ 2 4 ∇ 2 V (x)J[ f (x)] + δ 2 3! ∂ ∇ 2 V (x) ∂ x ( f (x) ⊗ I) + O(δ 3 ).
Remark 3.5: The discrete gradient (27) admits a power expansion in powers of δ of the form

∇H| x + x = ∇H(x) + ∑ i>0 δ i (i + 1)! ∇i H(x) (29)
with, for the first terms

∇1 H(x) =∇ 2 H(x) f (x) ∇2 H(x) = ∂ ∇ 2 H(x) ∂ x ( f (x) ⊗ I) f (x) + 3 2 ∇ 2 H(x)J[ f (x)] f (x).
Remark 3.6: When considering a quadratic function V = x Px and a linear vector field f (x) = Ax, one gets

Q δ ( 1 2 x Px, Ax, x) = 1 2 P(e δ A -I)(δ A) -1 .

IV. GRADIENT DYNAMICS UNDER SAMPLING

Consider the continuous-time gradient dynamics

ẋ = f (x) = -∇H(x) (30)
that satisfies the inequality

H(x + ) -H(x) = - δ 0 ∇ H(x(s))∇H(x(s))ds ≤ 0. ( 31
)
We now address the following question: does the equivalent sampled-data dynamics admit a discrete gradient form? To this end, we first specify Proposition 3.3 when f = -∇H.

Proposition 4.1: Given a smooth gradient vector field f (•) = -∇H(•) on R n , the discrete gradient of H(•), along the sampled equivalent dynamics [START_REF] Borja | New results on stabilization of port-Hamiltonian systems via pid passivity-based control[END_REF] is given for all δ ∈]0, T [ by

∇ H x + x = (32)
∇ H(x)

δ 0 (I -sJ[∇ s av H(x)]) (I -sJ[∇ s av H(x)])ds(δ M δ ( f , x)) -1 .
with, from definition (23) when x(

) = e f x s∇ s av H(x) = s 0 ∇H(x( ))d = s∇H(x) + ∑ i>1 s i i! L i-1 f ∇H(x).
(33) Proof: According to Proposition 3.3, when f = -∇H, the discrete gradient of the function H(•), along the sampled dynamics, must satisfy the equality below

-δ ∇ H x + x M δ ( f , x)∇H(x)=-
∇H(x(s)) = I -sJ[∇ s av H(x)] ∇H(x)
one gets the equality

δ ∇ H x + x M δ ( f , x)∇H(x) = ∇ H(x) δ 0 (I -sJ[∇ s av H(x)]) (I -sJ[∇ s av H(x)])ds∇H(x)
which is solved by the choice [START_REF] Moreschini | Discrete port-controlled Hamiltonian dynamics and average passivation[END_REF], so concluding the proof.

For the first terms, (32) gets the form

∇H x + x = I - δ 2 ∇ 2 H(x) + δ 2 4 ∇ 2 H(x)∇ 2 H(x) + δ 2 3! ∂ ∇ 2 H(x) ∂ x (∇H(x) ⊗ I) ∇H(x) + O(δ 3 ).
On these bases, the following result can be proved.

Theorem 4.1: Given the continuous-time gradient dynamics [START_REF] Kotyczka | Discrete-time port-Hamiltonian systems: A definition based on symplectic integration[END_REF], then for all δ ∈]0, T [, its sampled-data equivalent dynamics [START_REF] Borja | New results on stabilization of port-Hamiltonian systems via pid passivity-based control[END_REF] admits the discrete-time form below

x + -x = -δ I δ (H, -∇H, x) ∇H x + x ( 34
)
with non-singular symmetric positive-definite matrix

I δ (H, -∇H, x) = M δ (-∇H, x)(I -δ Q δ (H, -∇H, x)) -1 = I δ (H, -∇H, x) > 0 ( 35
)
and the function H(•) satisfies the variational inequality

H(x + ) -H(x) = -δ ∇ H x + x I δ (H, -∇H, x) ∇H x + x < 0. ( 36
)
Proof: According to Proposition 3.4 as (Iδ Q δ ( f , x)) is non singular by construction, one rewrites F δ (x) as

F δ (x) = -δ M δ (-∇H, x)(I -δ Q δ (H, -∇H, x)) -1 (I -δ Q δ (H, -∇H, x))∇H(x)
so getting the result when setting I δ (H, -∇H, x) as in [START_REF] Gröbner | Contributions to the method of Lie series[END_REF]. The non singularity of I δ (H, -∇(x), x) follows from the non singularity of M δ ( f , x) and (Iδ Q δ (H, f , x)). Moreover, exploiting Proposition 4.1 and the discrete-gradient [START_REF] Moreschini | Discrete port-controlled Hamiltonian dynamics and average passivation[END_REF], one rewrites [START_REF] Gröbner | Contributions to the method of Lie series[END_REF] as

I δ (H, -∇H, x) =δ M δ ( f , x) δ 0 (I -sJ[∇ s av H(x)]) × (I -sJ[∇ s av H(x)])ds -1 (M δ ( f , x))
which is symmetric and positive definite by construction. The equality [START_REF] Aoues | Hamiltonian systems discrete-time approximation: Losslessness, passivity and composability[END_REF] is obtained by expressing H(x + ) -H(x) either as H(x + ) -H(x) = ∇ H

x +

x (x +x), or equivalently as the integration of the Hamiltonian function along the continuoustime dynamics H(x + ) -H(x) = δ 0 Ḣ(x(s))ds. Both are equal since the sampled-data dynamics matches at the sampling times the continuous-time one by definition.

For the first terms, [START_REF] Gröbner | Contributions to the method of Lie series[END_REF] is given by

I δ (H, -∇H, x) = I - δ 2 ∇ 2 H(x) + δ 2 3! J[∇ 2 H(x)∇H(x)] I - δ 2 ∇ 2 H(x) + δ 2 4 ∇ 2 H(x)∇ 2 H(x) - δ 2 3! ∂ ∇ 2 H(x) ∂ x (∇H(x) ⊗ I) ∇H(x) -1 = I - δ 2 12 ∇ 2 H(x)∇ 2 H(x) + O(δ 3 ).
It is important to stress that the sampled-data equivalent dynamics [START_REF] Moreschini | Gradient and hamiltonian dynamics under sampling[END_REF] to the given continuous-time gradient dynamics does not exhibit a discrete gradient form in general.

When considering quadratic Hamiltonians, Theorem 4.1 recovers the results in [START_REF] Moreschini | Gradient and hamiltonian dynamics under sampling[END_REF]. In detail, when H(x) = 1 2 x Px with positive semi-definite square matrix P, the gradient dynamics ẋ = -∇H(x) = -Px admits the sampled-data representation (34) specified as

x + -x = -I δ P 2 (x + x + )
with x + = e -δ P x and

I δ = 2δ (I -e -δ P )P -1 (I + e -δ P ) -1 . (37)
In addition, the following result can be given. such that the sampled-data equivalent dynamics preserves a discrete gradient form; namely, one gets

x + -x = -∇H δ x + x = - P δ 2 (x + x + ). (38)
Proof: From Theorem 4.1 I δ = (I δ ) > 0 so getting that the so-defined P δ , coinciding with the one in Remark 3.3, is positive definite and symmetric. Also as x + = x and δ → 0 one gets ∇H δ | x x = Px so concluding the result.

V. PORT-HAMILTONIAN DYNAMICS UNDER SAMPLING

The results of the previous section are now generalized to port-Hamiltonian dynamics of the form [START_REF] Ortega | Control by interconnection and standard passivity-based control of port-Hamiltonian systems[END_REF]. To this end, let us extend to this context Proposition 4.1, when setting for compactness S(x) = J(x) -R(x). Proposition 5.1: Given a smooth vector field f (x) = (J(x)-R(x))∇H(x) on R n , then for all δ ∈]0, T [, the discrete gradient of H(•) along its sampled equivalent can be rewritten as

∇ H x + x = ∇ H(x)× δ 0 I + sJ[∇ s av H(x)]S(x) S (x(s)) I + sJ[∇ s av H(x)]S(x) ds × (δ M δ ( f , x)S(x)) -1 (39)
for x(s) = e s f x and s∇ s av H(x) as in [START_REF] Monaco | Nonlinear average passivity and stabilizing controllers in discrete time[END_REF].

Proof:

According to Proposition 3.3, when f = -S(x)∇H, the discrete gradient of the function H(•) along the sampled dynamics must satisfy the equality below

δ ∇ H x + x M δ ( f , x)S(x)∇H(x)= δ 0 ∇ H(x(s))S(x(s))∇H(x(s))ds.
Rewriting ∇H(x(s)) = I + sJ[∇ s av H(x)]S(x) ∇H(x), one gets

δ ∇ H x + x M δ ( f , x)S(x)∇H(x) = ∇ H(x)× δ 0 I+sJ[∇ s av H(x)]S(x) S(x(s)) I+sJ[∇ s av H(x)]S(x) ds∇H(x)
which is solved by the choice (39).

Remark 5.1: On the bases of Propositions 5.1 and 3.4, it is a matter of computation to verify that Theorem 5.1: Given a continuous-time port-Hamiltonian dynamics as in [START_REF] Ortega | Control by interconnection and standard passivity-based control of port-Hamiltonian systems[END_REF], then for any δ ∈]0, T [, its sampled equivalent model [START_REF] Borja | New results on stabilization of port-Hamiltonian systems via pid passivity-based control[END_REF] admits the discrete-time port-Hamiltonian structure

I + δ Q δ (H, f , x)S(x) = (δ M δ ( f , x)S(x)) -× (40)
x + -x = δ S δ J-R ( f , x) ∇H x + x ( 41
)
with f (x) = S(x)∇H(x) and

S δ J-R ( f , x) = M δ ( f , x)S(x) I + δ Q δ (H, f , x)S(x) -1 (42)
that satisfies the energy-balance equality

H(x + ) -H(x) = -δ ∇ H x + x S δ J-R ( f , x) ∇H x + x = - δ 0 ∇ H(x(s))R(x(s))∇H(x(s))ds ≤ 0. ( 43
)
Proof: According to Proposition 3.1, one rewrites

x + -x = F δ (x) = δ M δ ( f , x)S(x)∇H(x)
and the discrete gradient function satisfies

∇H x + x = I + δ 1 0 s ∇2 H x+sF δ (x) x dsM δ ( f , x)S(x) ∇H(x)
so getting [START_REF] Laila | Discrete-time IDA-PBC design for separable Hamiltonian systems[END_REF]. Moreover, by definition of the discrete gradient, the energy-balance equality rewrites as

H(x + ) -H(x) = δ ∇ H x + x S δ J-R ( f , x) ∇H x + x = - δ 0 ∇ H(x(s))R(x(s))∇H(x(s))ds ≤ 0.
so verifying energy dissipation [START_REF] Sümer | A direct discrete-time IDA-PBC design method for a class of underactuated Hamiltonian systems[END_REF].

Based on Remark 5.1, an alternate rewriting of S δ J-R ( f , x) in Theorem 5.1 is deduced by substituting [START_REF] Aoues | Discrete IDA-PBC design for 2d port-Hamiltonian systems[END_REF] to [START_REF] Moreschini | Dirac structures of discrete-time port-hamiltonian systems[END_REF].

Corollary 5.1: Given a continuous-time port-Hamiltonian dynamics as in [START_REF] Ortega | Control by interconnection and standard passivity-based control of port-Hamiltonian systems[END_REF], then for any δ ∈]0, T [, S δ J-R ( f , x) in (42) equivalently rewrites as

S δ J-R ( f , x) = δ M δ ( f , x)S(x)× δ 0 I+sJ[∇ s av H(x)]S(x) S (x(s)) I+sJ[∇ s av H(x)]S(x) ds -1 × S (x)(M δ ( f , x)) . (44)
with x(s) = e s f x, S(x) = J(x) -R(x) and s∇ s av H(x) as in [START_REF] Monaco | Nonlinear average passivity and stabilizing controllers in discrete time[END_REF]. Remark 5.2: The sampled-data structural matrix (42) can be described by its power expansion in δ according to

S δ J-R ( f , x) = S 0 (x) + ∑ i≥1 δ i (i + 1)! S i (x) (45)
with, for the first terms

S 0 (x) = J(x) -R(x) S 1 (x) = ∂ S 0 (x) ∂ x (∇H(x) ⊗ I) S 0 (x) (46)
S 2 (x) = - 1 2 S 0 (x)∇ 2 H(x)S 0 (x)∇ 2 H(x)S 0 (x) - 1 2 S 0 (x)∇ 2 H(x)S 1 (x) - 1 2 S 1 (x)∇ 2 H(x)S 0 (x) + ∂ S 0 (x) ∂ x (∇H(x) ⊗ I)S 1 (x) -∇ 2 H(x) ∂ S 0 (x) ∂ x ( f (x) ⊗ I)S 0 (x) + ∂ ∂ x ∂ S 0 (x) ∂ x (∇H(x) ⊗ I) ( f (x) ⊗ I)S 0 (x).
Remark 5.3: From ( 46), when R and J are constant one has

S 1 =0, S 2 = - 1 2 S 0 ∇ 2 H(x)S 0 ∇ 2 H(x)S 0 .
In the LTI case, the results in [START_REF] Moreschini | Gradient and hamiltonian dynamics under sampling[END_REF] are recovered as specified in the theorem below which generalizes Theorem 4.2 and can be readingly proved with the arguments in Section II-D.

Theorem 5.2: When f (x) = (J -R)Px and H(x) = 1 2 x Px, the sampled-data port-Hamiltonian model (41) admits the structure x +x = δ S δ J-R P(x + + x) with x + = e δ (J-R)P x and S δ J-R = 2(e δ (J-R)P -I)(I + e δ (J-R)P ) -1 (δ P) -1 .

(47) The corollaries below further characterize the structure matrix S δ J-R in (42) when the port-Hamiltonian system (7) is purely conservative or, in the degenerate case, dissipative (i.e., R = 0 or J = 0 respectively).

Corollary 5.2: If J(x) = 0 (i.e., f (x) = -R(x)∇H(x)), the sampled-data representation of the dynamics (7) takes the form

x + -x = δ S δ -R ( f , x) ∇H x +
x with x + = e δ f x and symmetric and negative semi-definite

S δ -R ( f , x) given by S δ -R ( f , x) = -M δ ( f , x)R(x)× δ 0 (I -sJ[∇ s av H(x)]R(x)) R(x(s))(I -sJ[∇ s av H(x)]R(x))ds -1 R(x)(δ M δ ( f , x)) = (S δ -R ( f , x)) ≤ 0.
Accordingly, one gets dissipation

H(x + ) -H(x) = δ ∇ H x+ x S δ -R ( f , x) ∇H x + x = - δ 0 ∇ H(x(s))R(x(s))∇H(x(s))ds ≤ 0.
In conclusion, the purely dissipative structure of a port-Hamiltonian dynamics is preserved by its sampled-data model with symmetric and positive semi-definite dissipation matrix -S δ -R ( f , x). Remark 5.4: In the LTI case (i.e., f (x) = -RPx), one recovers [START_REF] Moreschini | Gradient and hamiltonian dynamics under sampling[END_REF] S δ -R (-RPx, x) = 2(e -δ RP -I)(I + e -δ RP ) -1 (δ P) -1 with symmetric and positive definite -S δ -R (-RPx, x) as proved in Corollary 5.2 and as one might further verify here via easy but nasty computations.

Corollary 5.3: If R(x) = 0 (i.e., f (x) = J(x)∇H(x)), the sampled-data equivalent representation takes the form

x + -x = δ S δ J ( f , x) ∇H x +
x with x + = e δ J∇H x and skew symmetric matrix

S δ J ( f , x) S δ J ( f , x) = -M δ ( f , x)J(x)× δ 0 (I + sJ[∇ s av H(x)]J(x)) J(x(s))(I + sJ[∇ s av H(x)]J(x))ds -1 × J(x)(δ M δ ( f , x)) = -(S δ J ( f , x))
. Accordingly, the sampled equivalent dynamics is conservative

H(x + ) -H(x) = δ ∇ H x + x S δ J ( f , x) ∇H x + x = 0. ( 48
)
One concludes that the purely conservative structure of a port-Hamiltonian dynamics is preserved by its sampled-data model with skew-symmetric interconnection matrix.

Remark 5.5: In the LTI case f (x) = JPx, one recovers [START_REF] Moreschini | Gradient and hamiltonian dynamics under sampling[END_REF] S δ J (JPx, x) = 2(e δ JP -I)(I + e δ JP ) -1 (δ P) -1 where, from Corollary 5.3 and based on easy but nasty computations, S δ J (JPx, x) = -(S δ J (JPx, x)) .

A. The sampled-data structure matrix

Given the port-Hamiltonian representation (41), a unique way of highlighting the dissipating and conservative component into the structure matrix is not an easy task in general. There are several options for decomposing S δ J-R ( f , x) = J δ ( f , x) -R δ ( f , x) with suitably defined interconnection and damping matrices J δ ( f , x) and R δ ( f , x), according to Definition 2.4. Such a choice is unique only in the LTI case, discussed in Theorem 5.2, so defining

R δ = -sym(S δ J-R ), J δ = skew(S δ J-R
). Along these lines, the easiest choice stands in separating S δ J-R ( f , x) into its symmetric and skew-symmetric components

J δ ( f , x) =skew(S δ J-R ( f , x)) R δ ( f , x) = -sym(S δ J-R ( f , x)) 0. (49)
However, the result is rather conservative implying that J δ ( f , x) = 0 when J(x) = 0 or analogously, R δ ( f , x) = 0 when R(x) = 0, in general.

A different and more accurate choice is based on the computation of R δ ( f , x) as the solution to the dissipationmatching equality

δ ∇ H x + x R δ ( f , x) ∇H x + x = δ 0 ∇ H(x(s))R(x(s))∇H(x(s))ds with x(s) = e s f x, given by δ R δ ( f , x) = I + δ Q δ (H, f , x)S(x) δ 0 I + sJ[∇ s av H(x)]S(x) × R(x(s)) I + sJ[∇ s av H(x)]S(x) ds I + δ Q δ (H, f , x)S(x) . ( 50
)
The so-defined dissipation matrix is by construction positive definite and symmetric. Moreover, the energy-balance equality gets the form

H(x + ) -H(x) = δ ∇ H x + x S δ J-R ( f , x) ∇H x + x = - δ 0 ∇ H(x(s))R(x(s))∇H(x(s))ds ≤ 0 with H(x + ) -H(x) = -δ ∇ H x + x R δ ( f , x) ∇H x +
x so verifying the energy dissipation ( 43) by skew-symmetry of the matrix J(x). The advantage of such a choice is to exactly match the continuous-time dissipation through the so defined dissipation matrix R δ ( f , x). Accordingly, one deduces J δ ( f , x) = R δ ( f , x) + S δ J-R ( f , x) preserving exact state sampling but not skew symmetry in general. Moreover, it is guaranteed that R δ ( f , x) = 0 when R(x) = 0 and, analogously, J δ ( f , x) = 0 when J(x) = 0.

B. Approximate sampled-data port-Hamiltonian models

Computing closed-forms of the sampled-data port-Hamiltonian dynamics ( 41) is a difficult task in general and, in most cases, not likely possible. The main issues basically rely upon two aspects: (i) the computation of the structural matrix S δ ( f , x) in ( 42); (ii) the difficulty in computing the discrete gradient (1) itself. Also, the exact inversion of the implicit model [START_REF] Laila | Discrete-time IDA-PBC design for separable Hamiltonian systems[END_REF] for computing the explicit expression for x + , which is the one used in practice, might not be possible, even for simple classes of Hamiltonian functions (e.g., separable).

Still, exploiting the smooth δ -dependence of all mappings and matrices it is possible to naturally define approximations as truncation of the series expansions in powers of δ defining S δ ( f , x) and ∇H| x +

x provided, respectively, by ( 29) and [START_REF] Golo | Hamiltonian discretization of boundary control systems[END_REF]. In detail, the p th -order approximation of the structural matrix ( 42) is defined as

S δ ,[p] J-R ( f , x) := S(x) + p ∑ i=1 δ i (i + 1)! S i (x) (51)
with p ≥ 0. Based on this, one can define the p th -order approximation of the implicit Hamiltonian model ( 41) as

x + -x = δ S δ ,[p] J-R ( f , x) ∇H x + x . (52)
When p = 0, one recovers the usual Euler-like approximate Hamiltonian model of the literature (e.g. [START_REF] Gören-Sümer | Gradient based discrete-time modeling and control of Hamiltonian systems[END_REF]- [START_REF] Laila | Discrete-time IDA-PBC design for separable Hamiltonian systems[END_REF]). The approximation of the implicit port-Hamiltonian model is deduced from ( 41) by considering the truncation of the series expansion (45) at the order p ≥ 0 in powers of δ . Such a form might be of interest from different perspectives when ( 42) cannot be exactly computed as, for instance: when performing control design and one is interested into assigning a given structure up to a desired order of approximation; in implementation and simulation when, still, one is able to perfectly invert (52) to deduce an approximate explicit model. Remark 5.6: When the Hamiltonian function is quadratic, the explicit form associated to (52) is given by

x + = I - δ 2 S δ ,[p] J-R ( f , x)P -1 I + δ 2 S δ ,[p] J-R ( f , x)P x.
which does not correspond to the truncation of the map F δ (x) in ( 12) at the order p ≥ 0.

If the discrete-gradient cannot be exactly computed and the corresponding model ( 52) cannot be inverted exactly, one can define approximate explicit models starting from the q th -order approximation of the discrete-gradient (1) evaluated along the trajectories of [START_REF] Brogliato | Dissipative systems analysis and control[END_REF] as

∇[q] H x + x := ∇H(x) + q ∑ i=1 δ i (i + 1)! ∇i H(x) (53)
with q ≥ 0. Accordingly, we define the approximate (p, q)order explicit form associated to (41) as

x + -x = δ S δ ,[p] J-R ( f , x) ∇[q] H x + x ( 54
)
for p, q > 0. In general, such an approximation does not coincide with the the truncation of the map F δ (x) in ( 12) at the order q + p. However, when p = q = 0, (54) recovers the usual Euler model associated to [START_REF] Ortega | Control by interconnection and standard passivity-based control of port-Hamiltonian systems[END_REF].

VI. PORT-CONTROLLED HAMILTONIAN DYNAMICS

We discuss now port-controlled Hamiltonian dynamics by showing the preservation under sampling of the energybalance equalities and the corresponding use in dampingfeedback design.

Along with the literature (see [START_REF] Van Der Schaft | Port-Hamiltonian systems theory: An introductory overview[END_REF] and the reference therein), let a continuous-time port-Hamiltonian system composed by the dynamics [START_REF] Ortega | Control by interconnection and standard passivity-based control of port-Hamiltonian systems[END_REF] with input-affine controlled port and a conjugate output map; i.e. for f (x) = (J(x) -R(x))∇H(x)

ẋ = (J(x) -R(x))∇H(x) + ug(x) (55a) y = h(x) = g (x)∇H(x) (55b)
where g(•) is a smooth vector field over R n and u ∈ R. The following well know facts are recalled:

(i) the dynamics (55a) satisfies the energy-balance equality (EBE)

H(x(t)) -H(x(0)) = - t 0 ∇ H(x(s)R(x(s))∇H(x(s))ds + t 0 u(s)g (x(s))∇H(x(s))ds; (56)
(ii) the system (55) is passive with storage function H(x) and dissipation rate d(x) := ∇H (x)R(x)∇H(x); lossless when R(x) ≡ 0.

On these bases, stabilizing strategies under output feedback can be developed in terms of PBCs via damping [START_REF] Ortega | Putting energy back in control[END_REF].

A discrete-time port-controlled Hamiltonian structure has been recently introduced by the authors in [START_REF] Moreschini | Discrete port-controlled Hamiltonian dynamics and average passivation[END_REF]. Denoting by for x + and x + (u) the one step ahead unforced and forced evolutions respectively, the following definition can be given. Definition 6.1: A discrete-time port-controlled Hamiltonian system is given by

x + (u) = x + (J d (x) -R d (x)) ∇H x + x + ug d (x, u) (57a)
y = h d (x, u) = g d (x, u) ∇H x + (u) x + (57b)
where g d (•, u) : R n → R n and h d (•, u) : R n → R are smooth functions of the state and the control u ∈ R. By construction, the following holds true (i) the dynamics (57a) satisfies the energy-balance equation (EBE), i.e. for any integer k ≥ 1

H(x k ) -H(x 0 ) = - k-1 ∑ i=0 ∇ H x + i x i R d (x i ) ∇H x + i x i + k-1 ∑ i=0 u i g d (x i , u i ) ∇H x + i (u i ) x + i ; (58)
(ii) the system (57) is passive with storage function H(x)

and dissipation rate d(x) := ∇H

x + x R d (x) ∇H x + x
; it is lossless when R d (x) ≡ 0. Remark 6.1: When compared to the literature (e.g., [START_REF] Aoues | Hamiltonian systems discrete-time approximation: Losslessness, passivity and composability[END_REF], [START_REF] Laila | Discrete-time IDA-PBC design for separable Hamiltonian systems[END_REF]), two main differences hold. The dynamics (57) is defined in terms of the discrete gradient of the Hamiltonian along the free evolution only, the conjugate output is described in terms of the discrete gradient of the Hamiltonian along the controlled part of the evolution only. Accordingly, one gets passivity with respect to the so defined conjugate output that recovers the average passivating output map introduced in [START_REF] Monaco | Nonlinear average passivity and stabilizing controllers in discrete time[END_REF].

A. Sampled-data pcH dynamics

An extension of Theorem 5.1 to controlled dynamics is now possible. Theorem 6.1: Consider a continuous-time port-controlled Hamiltonian system (55) and assume the control variable constant over time intervals of amplitude δ , u(t) = u k , ∀t ∈ [kδ , (k + 1)δ [, then for all δ ∈]0, T [, its sampled equivalent model admits the discrete-time port-controlled Hamiltonian structure below

x + (u) -x = δ S δ J-R ( f , x) ∇H x + x + δ g δ (x, u)u (59a)
y δ = h δ (x, u) = (g δ (x, u)) ∇H x + (u) x + (59b)
with δ ug δ (x, u) = e δ ( f +ug) xe δ f x and S δ J-R ( f , x) given in [START_REF] Moreschini | Dirac structures of discrete-time port-hamiltonian systems[END_REF]. Moreover, the following properties hold:

(i) the dynamics (59a) satisfies the EBE

H(x k ) -H(x 0 ) = -δ k-1 ∑ i=0 ∇ H x + i x i S δ J-R ( f , x i ) ∇H x + i x i + δ k-1 ∑ i=0 u i (g δ (x i , u i )) ∇H x + i (u i ) x + i ; (60)
(ii) the system (59) is passive with storage function H(x)

and dissipation rate d δ (x) := ∇H

x + x R δ ( f , x) ∇H x +
x ; it is lossless when R(x) ≡ 0; (iii) whenever the system is zero-state-detectable, any feedback ū = γ δ (x) solving the algebraic equality ū=-κ g δ (x, ū) ∇H

x + ( ū)

x + , κ > 0 (61)
is a sampled-data PBC making x asymptotically stable with increasing damping; i.e. one gets in closed loop the modified EBE, with ūi = γ δ (x i )

H(x k ) -H(x 0 ) = -δ k-1 ∑ i=0 ∇ H x + i x i S δ J-R ( f , x i ) ∇H x + i x i -δ κ k-1 ∑ i=0 ∇H x + i ( ūi ) x + i [g δ (x i , ūi )][g δ (x i , ūi )] ∇H x + i ( ūi ) x + i .
Proof: (i) and (ii) are an immediate consequence of the fact that the sampled-data form (59) exhibits the same structure as (57). (iii) specifies to the sampled-data form (59), passivity based control strategies developed in [START_REF] Monaco | Nonlinear average passivity and stabilizing controllers in discrete time[END_REF]Theorem 4.1] for nonlinear discrete-time dynamics that can be understood as negative output feedback with respect to the suitably defined passivating output map. Remark 6.2: Under ū = γ δ (x) solution to (61), one gets

x + ( ū) -x = δ S δ J-R ( f , x) ∇H x + x -κδ g δ (x, ū)(g δ (x, ū)) ∇H x + ( ū)
x + that does not properly exhibit a port-Hamiltonian structure of the form (57). Nevertheless, it properly adds damping to the natural one in free evolution through a well structured term so getting in closed loop the energy-balance below

H(x + ( ū)) -H(x) = -δ ∇ H x + x S δ J-R ( f , x)) ∇H x + x -δ κ ∇ H x + ( ū)
x + g δ (x, ū)(g δ (x, ū)) ∇H

x + ( ū)

x + . Remark 6.3: The PBC ū = γ δ (x) is defined as the solution to the nonlinear equality (61). Even though such an equality is solvable in virtue of the Implicit Function Theorem [START_REF] Monaco | Nonlinear average passivity and stabilizing controllers in discrete time[END_REF], exact solutions are tough to compute in practice. However, as the solution can be expressed through its series expansion in powers of δ , computational approximations can be easily implemented (see [START_REF] Monaco | Nonlinear average passivity and stabilizing controllers in discrete time[END_REF] for details).

Let us specify Theorem 6.1 to the LTI case. Theorem 6.2: Consider the LTI port-Hamiltonian system

ẋ(t) = (J -R)Px + Bu y = Cx = B Px
with Hamiltonian H(x) = 1 2 x T Px. Then, the equivalent sampled-data port-controlled Hamiltonian model is given by

x + (u) -x = δ S δ J-R ∇H x + x + δ B δ u (62a)
y δ = [B δ ] Px + + 1 2 [B δ ] PB δ u (62b)
with x + = e δ (J-R)P x, δ B δ = δ 0 e τ(J-R)P Bdτ and S δ J-R as in (47). In addition, the sampled-data PBC

ū = -κ 1 + 1 2 κ(B δ ) PB δ -1 (B δ ) Px + , κ > 0
solution to the damping equality (61) makes the closed-loop dynamics asymptotically stable.

B. The sampled-data Dirac Structure

The energy-balance equation (58) satisfied by the sampled equivalent model to (59) can be recast through a discrete Dirac structure formulation [START_REF]Discrete port-Hamiltonian systems[END_REF]. Let us first recall the definition of Dirac structure in the space of flows and efforts variables. Definition 6.2 ( [START_REF] Van Der Schaft | Port-Hamiltonian systems theory: An introductory overview[END_REF]): Given a finite-dimensional linear space of flows F and efforts E (with f ∈ F and e ∈ E), the space E being the dual of F, then a subspace D ⊂ F × E is a Dirac structure if it satisfies 1) e f = 0, ∀( f , e) ∈ D, 2) dimD = dimF. Accordingly, the Dirac structure associated with the continuous-time port-controlled Hamiltonian dynamics (55) is described [START_REF] Van Der Schaft | Port-Hamiltonian systems theory: An introductory overview[END_REF] through three pairs of port variables representing the energy storage ( f S , e S ), dissipation ( f R , e R ) and interconnection with the environment ( f I , e I ) and satisfying

  f S f R f I   =   -J(x) -g R (x) -g(x) g R (x) 0 0 g (x) 0 0     e S e R e I   with skew symmetric graph over dimD = 2n + 1     - ẋ f R y   ,   ∇H(x) -r(x) f R u     ∈ D, (63)
for r(x) = r (x) 0, g R (•) : R n → R n×p and R(x) = g R (x)r(x)g R (x). Discrete-time Dirac structures can be associated to port-controlled Hamiltonian systems of the form (59) as described in [START_REF] Moreschini | Dirac structures of discrete-time port-hamiltonian systems[END_REF]Theorem 2.1]. Let us now show how the continuous-time Dirac structure is transformed under sampling with suitably defined storing, dissipating, and control ports associated with the sampled-data structure (59). Theorem 6.3: Given a continuous-time dynamics [START_REF] Ortega | Control by interconnection and standard passivity-based control of port-Hamiltonian systems[END_REF] with Dirac structure D of dimension 2n + 1 as in (63), then for all δ ∈]0, T [, its sampled equivalent model (59) admits a discrete Dirac structure D δ of dimension 3n + 1 described in terms of efforts and flow variables defined below

         -(x + -x) f δ R -(x + (u) -x + ) y δ     ,      ∇H| x + x -r δ (x) f δ R ∇H| x + (u) x + u           ∈ D δ where J δ ( f , x) = skew(S δ J-R ( f , x)), R δ ( f , x) = -sym(S δ J-R ( f , x)) = g δ R (x)r δ (x)g δ R (x), for r δ (x) = r δ (x) 0, g δ R (•) : R n → R n×p , with skew-symmetric graph      f δ S f f δ R f δ S u f δ I      =     -J δ ( f , x) -g δ R (x) 0 0 g δ R (x) 0 0 0 0 0 0 -g δ (x, e δ I ) 0 0 g δ (x, e δ I ) 0          e δ S f e δ R e δ S u e δ I     
.

Proof: The proof exploits the splitting of the Hamiltonian variation between two successive states into free and controlled parts as

H(x + (u)) -H(x) = (H(x + (u)) -H(x + )) + (H(x + ) -H(x)).
Accordingly, one splits in the total energy storage the free elements

( f δ S f , e δ S f ) ∈ F δ S f × E δ S f , from the controlled ones ( f δ S u , e δ S u ) ∈ F δ S u × E δ S u by respectively setting -e δ S f f δ S f = ∇ H| x +
x (x +x) and -e δ S u f δ S u = ∇ H|

x + (u)

x + (x + (u) -x + ) so verifying e δ f δ = e δ S f f δ S f + e δ S u f δ S u with -e δ f δ = ∇ H| x + (u) x (x + (u) -x).
Regarding interconnection with the environment through ( f δ I , e δ I ) ∈ F δ I ×E δ I , one sets by definition of the conjugate output y δ , e δ I f δ I = ∇ H|

x + (u)

x + (x + (u)x + ) = uy δ so setting f δ I = g δ (x, e δ I )e δ and e I = u that gives e δ S u f δ S u + e δ I f δ I = 0. Regarding the dissipative elements, (

f δ R , e δ R ) ∈ F δ R × E δ R , setting the dissipating constraints e δ R = -r δ (x) f δ R and f R = g δ R (
x)e δ S f for some r δ (x) = r δ (x) 0 and

g δ R (•) : R n → R n×p such that R δ ( f , x) = -sym(S δ J-R ( f , x)) = g δ R (x)r δ (x)g δ R (
x), one recovers the power balance equality

e δ S f f δ S f + e δ R f δ R + e δ S u f δ S u + e δ I f δ I = 0.
Finally, since x ∈ R n and u ∈ R,

dimD δ = dimF δ S f + dimF δ R + dimF δ S u + dimF δ I = 3n + 1.

VII. ILLUSTRATIVE EXAMPLES

In this section, two physical examples are worked out: the gravity pendulum system with a constant structure matrix and nonlinear Hamiltonian and the controlled rigid body with non constant structure matrix and quadratic Hamiltonian. Simulations are carried out to highlight advantages of the proposed model compared with the one of the literature (e.g., [START_REF] Laila | Discrete-time IDA-PBC design for underactuated Hamiltonian control systems[END_REF], [START_REF] Aoues | Hamiltonian systems discrete-time approximation: Losslessness, passivity and composability[END_REF], [START_REF] Gören-Sümer | Gradient based discrete-time modeling and control of Hamiltonian systems[END_REF], [START_REF] Aoues | Discrete IDA-PBC design for 2d port-Hamiltonian systems[END_REF], [START_REF] Laila | Discrete-time IDA-PBC design for separable Hamiltonian systems[END_REF]). In the lines of Section VI, digital stabilizing controllers are designed to highlight the advantages of the proposed structures in feedback design. The Matlab code generating the simulations can be found at shorturl.at/bAIR8.

A. The Gravity Pendulum

The gravity pendulum described by a separable Hamiltonian is an interesting case study to characterize the series expansion of S δ J-R ( f , x) in [START_REF] Moreschini | Dirac structures of discrete-time port-hamiltonian systems[END_REF]. Setting x = col{x 1 , x 2 } = col{ϑ , ml 2 θ }, where θ is the angle between the vertical axis and the rod of the pendulum, the continuous-time Hamiltonian dynamics is given by

ẋ = 0 1 -1 -r ∇H(x) (64)
with Hamiltonian and gradient functions

H(x) = 1 2ml 2 x 2 2 + mgl(1 -cos(x 1 )), ∇H(x) = mgl sin(x 1 )
1 ml 2 x 2 with damping coefficient r ≥ 0. For notational simplicity we assume ml 2 = 1 and mgl = 1.

According to Proposition 2.1, both the discrete gradient ∇H| x + x and the discrete Jacobian J[∇H]| x + x in (4) and ( 5) respectively can be exactly computed so getting

∇H| x + x =   - cos(x + 1 )-cos(x 1 ) x + 1 -x 1 x + 2 +x 2 2   , J[∇H]| x + x = sin(x + 1 )-sin(x 1 ) x + 1 -x 1 0 0 1 . (65)
From Theorem 5.1 and (52), one computes for p = 2 the approximate system in O(δ 4 ) with matrix for which the sampled-data model yields the dissipation rate

S δ ,[2] J-R ( f , x)= 0 1 -1 -r + δ 2 12 -r (cos(x 1 ) -r 2 ) r 2 -cos(x 1 ) r 3 -r cos(x 1 ) , (66)
H(x + ) -H(x) = - δ 4 r 1 + δ 2 6 (cos(x 1 ) - 1 2 r 2 ) (x + 2 + x 2 ) 2 -r δ 3 12
(cos(x + 1 ) -cos(x 1 )) 2 (x + 1 + x 1 ) 2 + O(δ 4 ) ≤ 0.
From the expressions above, whenever the pendulum is undamped (r = 0), the sampled equivalent dynamics clearly preserves conservation; namely, H(x + ) -H(x) = 0.

The Euler-like model proposed in [START_REF] Aoues | Hamiltonian systems discrete-time approximation: Losslessness, passivity and composability[END_REF], [START_REF] Yalc ¸in | Discrete-time modeling of Hamiltonian systems[END_REF] is recovered by setting p = 0 in (52), so yielding dissipation

H(x + )-H(x) = -δ 4 r(x + 2 + x 2 ) 2 + O(δ 2
). Simulations: Figure 1 shows the root-mean-square errors (RMSE) in the state and Hamiltonian evolutions of the approximate sampled-data model (52) with p = 2 and p = 0 with respect to the continuous-time one (64) at the sampling instants. More in detail, the continuous-time (CT) dynamics (64) is compared with the approximate model (DT O(δ 4 )) given in Theorem 5.1 with S δ , [START_REF] Van Der Schaft | Port-Hamiltonian systems theory: An introductory overview[END_REF] J-R ( f , x) and with the Euler-Like (DT EL) of the literature S δ ,[0] J-R ( f , x), in the dissipative and conservative cases respectively. From Figure 1, the performances improvement is clear. In the conservative case (r = 0), both (DT O(δ 4 )) and (DT EL) preserve the energy conservation property over the function H(x) = 0 although the advantage the (DT O(δ 4 )) model is notable for matching achievement as depicted in Figure 1(b).

Gradient approximation:

In what follows we illustrate relevancy of approximations of S δ ( f , x) and ∇H| x + x when computation of exact solutions is possible. From the approximate discrete gradient in (53) up to q = 2 one gets

∇[1] H| x + x = sin(x 1 ) x 2 + δ 2 cos(x 1 )x 2 -(sin(x 1 ) + rx 2 ) ∇[2] H| x + x = ∇[1] H| x + x - δ 2 4 2 3 sin(x 1 )x 2 2 + cos(x 1 )(sin(x 1 ) + rx 2 ) cos(x 1 )x 2 -r sin(x 1 ) -r 2 x 2 .
In Figure 2, the improvement is clear when considering increasing approximation orders as, in that case, p = 2 and q = 2 versus p = 0 and q = 1.

Digital feedback design: To highlight the improvement under digital damping (performed over the proposed conjugate J-R ( f , x) from (66),

g δ (x, u) = g δ 1 (x, u) g δ 2 (x, u) = δ 0 1 + δ 2 2 1 0 - δ 3 6 0 cos x 1 and discrete gradient evaluated from x + to x + (u) as ∇H| x + (u) x + = sin x 1 x 2 + δ x 2 cos x 1 1 2 u -sin x 1 + δ 2 2 -sin x 1 x 2 2 -cos x 1 (sin x 1 + 1 2 u) -x 2 cos x 1 + O(δ 3 ).
The digital PBC feedback solution to (61), given by ū reported in Figure 3 with respect to the feedback [START_REF] Aoues | Hamiltonian systems discrete-time approximation: Losslessness, passivity and composability[END_REF], [START_REF] Laila | Discrete-time IDA-PBC design for separable Hamiltonian systems[END_REF], [START_REF] Sümer | A direct discrete-time IDA-PBC design method for a class of underactuated Hamiltonian systems[END_REF] provided by

= -κx 2 + δ 2 κ(κx 2 + sin x 1 ) + δ 2 6 κ x 2 cos x 1 - 3 2 κ(κx 2 + sin x 1 ) + O(δ 3 ) (68
u l = -κB ∇H| x + (u l ) x = -κx 2 + δ 2 κ(κx 2 + sin x 1 ) + δ 2 4 κ x 2 cos x 1 -κ(κx 2 + sin(x 1 )) + O(δ 3 ). (69)

B. Controlled rigid body

Consider the dynamics of the angular velocities of a rigid body in absence of gravity [START_REF] Van Der Schaft | Port-Hamiltonian systems theory: An introductory overview[END_REF] given by ẋ

=   -r 1 -x 3 x 2 x 3 -r 2 -x 1 -x 2 x 1 -r 3   ∇H(x) (70)
where x = (x 1 , x 2 , x 3 ) are the components of the angular momentum along the three principal axes, r 1 , r 2 , r 3 ≥ 0 denote the decay of the angular momentum, and H(x) describes the kinetic energy with inertia I x 1 , I x 2 , I x 3 > 0, i.e.

H(x) = x 2 1 2I x 1 + x 2 2 2I x 2 + x 2 3 2I x 3 . (71)
Note that the unforced dynamics (70) with (71) is dissipative for some r i > 0 and, conversely, conservative for all r i = 0. In the uncontrolled case, invoking Theorem 5.1 and Remark 5.3, one computes S δ , [START_REF] Wiggins | Introduction to applied nonlinear dynamical systems and chaos[END_REF] J-R ( f , x) = S(x) + δ 2 S 1 (x) in (52) with The Euler-like model proposed in [START_REF] Aoues | Hamiltonian systems discrete-time approximation: Losslessness, passivity and composability[END_REF], [START_REF] Yalc ¸in | Discrete-time modeling of Hamiltonian systems[END_REF] is recovered again by setting p = 0 in (52), that is S δ ,[0]

J-R ( f , x) = S(x).

Simulations: Simulations have been performed assuming the parameters of the rigid body fixed as in [START_REF] Aoues | Hamiltonian systems discrete-time approximation: Losslessness, passivity and composability[END_REF] (i.e., I x 1 = 1 3 , I x 2 = 1 2 , I x 3 = 1) and initial conditions x 0 = [START_REF] Stramigioli | Sampled data systems passivity and discrete port-Hamiltonian systems[END_REF][START_REF] Stramigioli | Sampled data systems passivity and discrete port-Hamiltonian systems[END_REF][START_REF] Stramigioli | Sampled data systems passivity and discrete port-Hamiltonian systems[END_REF]. The improvement of computing a sampled dynamics in O(δ 3 ) rather than in O(δ 2 ) is given in Figure 4 which depicts the phase portrait and the Hamiltonian evolution. The benefit of our model, with respect to the one with p = 0, stands in a better preservation of the state trajectory and the decay of the dissipation rate as clearly shown by simulations. The improvement is achieved via a better approximation of the structural matrix in (52).

Digital feedback design: To perform the damping obtained under digital feedback with δ = 0.0675, consider the controlled dynamics of the angular velocities of a fully actuated rigid body, spinning around its center of mass in port-Hamiltonian form [START_REF] Van Der Schaft | L2-gain and passivity techniques in nonlinear control[END_REF]

ẋ =   0 -x 3 x 2 x 3 0 -x 1 -x 2 x 1 0   ∇H(x) +   g 1 g 2 g 3   u (72a) y = g 1 I x 1 x 1 + g 2 I x 2 x 2 + g 3 I x 3 x 3 ( 72b
)
where y is the passive output. According to Theorem 6.1, the digital passivity-based feedback is of the form (61) with

g δ (x, u) =   g 1 g 2 g 3   + δ 2    
g 2 I x 2 x 3 +g 3 I x 2 x 2 -g 2 I x 3 x 3 -g 3 I x 3 x 2 I x 2 I x 3 g 1 I x 3 x 3 -g 3 I x 1 x 3 -g 3 I x 1 x 1 +g 3 I x 3 x 1 I x 1 I x 3 g 1 I x 1 x 2 +g 2 I x 1 x 1 -g + O(δ 2 ).

Simulations: The solution to (73) truncated in O(δ 3 ) is injected into the continuous-time dynamics (72) to digitally asymptotically stabilize the equilibria. As in [START_REF] Aoues | Hamiltonian systems discrete-time approximation: Losslessness, passivity and composability[END_REF], we assume g 1 = I x 1 = 1 3 , g 2 = I x 2 = 1 2 , g 3 = I x 3 = 1, κ = 1, and initial conditions x 0 = [START_REF] Stramigioli | Sampled data systems passivity and discrete port-Hamiltonian systems[END_REF][START_REF] Stramigioli | Sampled data systems passivity and discrete port-Hamiltonian systems[END_REF][START_REF] Stramigioli | Sampled data systems passivity and discrete port-Hamiltonian systems[END_REF] with ρ x = x 1 + x 2 + x 3 and s I = I x 1 + I x 2 + I x 3 . We have considered the same simulation in [START_REF] Aoues | Hamiltonian systems discrete-time approximation: Losslessness, passivity and composability[END_REF] with an increased stepsize up to δ = 0.675. In Figure 5 the comparison has been made with respect to the digital control respectively in [START_REF] Aoues | Hamiltonian systems discrete-time approximation: Losslessness, passivity and composability[END_REF] and in [START_REF] Laila | Construction of discrete-time models for port-controlled Hamiltonian systems with applications[END_REF]. Differently from the control considered in the literature, the proposed control (74) shows the preservation of the phase portrait under digital feedback and a decay of the Hamiltonian function at the instant t = kδ .

VIII. CONCLUSIONS

New results for describing sampled-data equivalent models of continuous-time gradient and port-Hamiltonian dynamics have been provided. More in particular, it has been shown that it is always possible to recover a suitably defined discrete-time equivalent model exhibiting a discrete-time port-Hamiltonian structure with respect to the same Hamiltonian function as in continuous time. The deduced model preserves, beyond the structure, the same energetic properties as the continuous-time one at all sampling instants. In addition, the approach is constructive and allows the computation of approximate models. The case of port-controlled Hamiltonian systems has been discussed too to show the benefits of the proposed approach in stabilization through digital damping. As an interesting outcome, we stress that the sampled-data equivalent model we propose evolves over a Dirac structure when properly defining effort and flow variables into the storing and dissipating ports and the environmental interaction through the input. Perspectives concern the use of these models to investigate IDA-PBCs for set point stabilization of port-Hamiltonian systems along the lines of preliminary results set for purely discrete time systems [START_REF] Moreschini | Stabilization of discrete port-Hamiltonian dynamics via interconnection and damping assignment[END_REF]. Further perspectives concern the time discretization of distributed port-Hamiltonian systems described by PDEs (see [START_REF] Golo | Hamiltonian discretization of boundary control systems[END_REF], [START_REF] Kotyczka | Weak form of stokes-dirac structures and geometric discretization of port-Hamiltonian systems[END_REF]).

  e ) = 0) is an equilibrium of (8);• from (8) and Definition 2.1, one gets

δ 0 ∇

 0 H(x(s))∇H(x(s))ds with x(s) = e s f x. Rewriting now H(x + ) -H(x) along the continuous-time dynamics according to

Theorem 4 . 2 :

 42 Given a LTI gradient-dynamics (30) (i.e., f (x) = -Px and H(x) = 1 2 x Px, there exists a new Hamiltonian function H δ = 1 2 x P δ x parameterized by δ > 0 with P δ = I δ P = (P δ ) > 0

δ 0 I

 0 + sJ[∇ s av H(x)]S(x) S (x(s)) I + sJ[∇ s av H(x)]S(x) ds with x(s) = e s f x and s∇ s av H(x) as in[START_REF] Monaco | Nonlinear average passivity and stabilizing controllers in discrete time[END_REF]. The main result below generalizes Theorem 4.1 to port-Hamiltonian dynamics.

5 (b) Undamped r = 0 Fig. 1 .

 501 Fig. 1. Pendulum: RMSE in the state x and Hamiltonian H at the sampling instants δ ∈ [0, π 2 ] with x 0 = col( 3 2 π, 0).

Fig. 3 .

 3 Fig. 3. Pendulum: Stabilization with sampled period δ = π 2 , initial condition x(0) = col( 3 2 π, 0), and κ = 1.

Fig. 4 .

 4 Fig. 4. Rigid Body with δ = 10 -2 , r 1 = r 2 = 0, and r 3 = 0.2.

S 1 (I x 3 x 2 2 +I x 2 x 2 3 I x 2 I x 3 -I x 2 r 2 x 3 3 I x 3 x 2 1 +I x 1 x 2 3 I x 1 I x 3 -I x 3 r 3 x 1 +I x 1 x 2 x 3 I x 1 I x 3 -I x 1 r 1 x 2 +I x 2 x 1 x 3 I x 1 I x 2 I x 2 r 2 x 1 -I x 1 x 2 x 3 I x 1 I x 2 I x 2 x 2 1 +I x 1 x 2 2 I x 1 Fig. 5 .

 1233331331332321321215 Fig. 5. Rigid Body under digital control for δ = 0.0675.

  1 I x 2 x 2 -g 2 I x 2 x 1 I x 1 I x 2 2 x 3 +g 3 x 2 )(I x 2 -I x 3 )(x + 1 ( ū)+x + 1 ) 4I x 2 I x 3 -δ (g 1 I x 3 -g 3 I x 1 )x 3 +g 3 (I x 3 -I x 1 )x 1 (x + 2 ( ū)+x + 2 ) 4I x 1 I x 3 (73) -δ (g 1 x 2 + g 2 x 1 )(I x 1 -I x 2 )(x + 3 ( ū) + x + 3 ) 4I x 1 I x 2

					
					   + O(δ 2 )
	which reduces to the solution to the following equation
	ū =-κ	3 ∑ i=1	g i (x + i ( ū)+x + i ) 2I x i	-	δ (g

ACKNOWLEDGMENT

The Authors wish to thank the Associate Editor and the Reviewers for their valuable comments and suggestions which allowed to improve and clarify the paper.

Partially supported by 2018-Piccoli progetti RP11816436325B63). Alessio Moreschini thanks the Universit é Franco-Italienne/Universit à Italo-Francese (Vinci Grant 2019) for supporting the mobility between Italy and France.

S.