**2. Dynamical Modeling**

To obtain the dynamical representation of the SCES system integrated with VSC, only Kirchhoff's laws and the first Tellegen's theorem is required. Here, we suppose that all the variables were transformed from the *abc* reference frame into Park's reference frame [5].

$$d\frac{d}{dt}\dot{\mathbf{i}}\_d = -r\dot{\mathbf{i}}\_d + \omega l \dot{\mathbf{i}}\_q + \upsilon\_{\text{sc}}\mathbf{u}\_d - \upsilon\_{d\text{-}} \tag{1}$$

$$\ln \frac{d}{dt} i\_{\mathbb{q}} = -r i\_{\mathbb{q}} - \omega \text{li}\_d + v\_{\mathbb{q}\mathbb{q}} u\_{\mathbb{q}} - v\_{\mathbb{q}},\tag{2}$$

$$
\omega\_{\rm sc} \frac{d}{dt} v\_{\rm sc} = -i\_d u\_d - i\_q u\_{q\*} \tag{3}
$$

where *l* and *r* are the series inductance and resistance of the AC filter (transformer), respectively; *csc* is the capacitance value of the SCES system; *id* and *iq* represent the direct- and quadrature-axis currents, respectively, while *vd* and *vq* are their corresponding voltages; *vsc* is the voltage in the terminals of the supercapacitor and, *ud* and *uq* are the modulation indexes of the converter that work as control

inputs. Note that dynamical Model (1)–(3) is a sub-actuate control system because there are *m* = 2 control variables and *n* = 3 states.

**Remark 1.** *The dynamical Model (1)–(3) exhibits a non-affine port-Hamiltonian structure as follows:*

$$\mathcal{D}\dot{\mathbf{x}} = [\mathcal{J}\left(\boldsymbol{u}\right) - \mathcal{R}]\mathbf{x} + \mathcal{J}\_{\prime} \tag{4}$$

*where* D ∈ R*n*×*n is the inertia matrix, which is diagonal and positive definite,* J ∈ R*n*×*n and* R ∈ R*n*×*n are the interconnection and damping matrices, such that* J *is skew-symmetric and* R *is diagonal and positive semidefinite; x* ∈ R*n and u* ∈ R*m are the state and control vectors; and ζ* ∈ R*n corresponds to the external input vector.*

**Lemma 1.** *The dynamical Model (1)–(3) can be transformed into a direct-power control (DPC) model preserving its non-affine port-Hamiltonian structure by defining the following variables as recommended in [2]: p* = *vdid, q* = −*vdiq, and v* = *vdvsc, where vq* = 0 *because the PLL is referred to the direct-axis.*

**Proof.** To obtain a DPC model, let us suppose that the *vd* and *vq* signals are obtained by implementing a phase-looked loop (PLL), such that they (i.e., *vd* and *vq*) are constants and well known. Now, if we derive the active and reactive power components, then,

$$\frac{d}{dt}p = \upsilon\_d \frac{d}{dt}i\_{d\prime} \tag{5a}$$

$$\frac{d}{dt}q = -\upsilon\_d \frac{d}{dt}i\_{\mathfrak{q}}\tag{5b}$$

where, if we substitute Equation (1) and (2) considering that *v* = *vdvsc*, the following result is obtained

$$\ln \frac{d}{dt} p = -rp - \omega lq + vu\_d - v\_{d\prime}^2 \tag{6a}$$

$$d\frac{d}{dt}q = -rq + \omega l \, p - vu\_q. \tag{6b}$$

Note that if we multiply Equation (3) by *vd* and rearrange some terms, then

$$x\_{sc}\frac{d}{dt}v = -pu\_d + qu\_q. \tag{7}$$

Finally, when expressions Equations (5) to (7) are rearranged in the form of Equation (4), the proof is completed with

$$\mathcal{D} = \begin{pmatrix} l & 0 & 0 \\ 0 & l & 0 \\ 0 & 0 & c\_{\rm sc} \end{pmatrix}, \mathcal{J}(u) - \mathcal{R} = \begin{pmatrix} -r & -\omega l & u\_d \\ \omega l & -r & -u\_q \\ -u\_d & u\_q & 0 \end{pmatrix},$$

$$\mathbf{x} = \begin{bmatrix} & p & q & v \end{bmatrix}^T, \quad \mathbb{J} = \begin{bmatrix} & -v\_d^2 & 0 & 0 \end{bmatrix}^T.$$

**Remark 2.** *Considering the advantages of the pH formulation exhibited by the DPC controller, an appropriate controller to alleviate the active and reactive power oscillations with the SCES systems is the passivity-based control approach because it takes advantage of the pH model to design an asymptotically stable controller in the sense of Lyapunov.*
