## 3 An Energy-Based Model Relative to the Reversible Hydropump-Turbine System
### A Reversible Hydropump-Turbine System
#### 3.3.6 A Reversible Hydropump-Turbine System (Main Result)  
In this section, we propose the modelling approach of the reversible hydro pump-turbine system connected to the asynchronous machine of Section 3.2. The coupling is performed via an interconnecting shaft between the hydropump and the asynchronous machine. It is assumed here that the rotational inertia of the mechanical domain is a consolidation of both the shaft and the impeller of the pump as well as the shaft and the rotor of the asynchronous machine. The apparent mass inertia and the dissipating elements between the hydraulic and the mechanical domain in (24)-(27) are redefined as follows.  
\[J_{a_{m}} =J_{m_{P}}+J_{m_{M}}+\dfrac{I_{h}}{K_{h}^{2}}, \tag{39}\] \[R_{a_{m}} =R_{m_{P}}+R_{m_{M}}+\dfrac{R_{h}}{K_{h}^{2}},\] (40) \[J_{a_{h}} =I_{h}+(J_{m_{P}}+J_{m_{M}})K_{h}^{2},\] (41) \[R_{a_{h}} =R_{h}+(R_{m_{P}}+R_{m_{M}})K_{h}^{2}. \tag{42}\]  
Now, given the dynamics of the induction motor \(\Sigma_{M}\) as in (14), the dynamics of the hydro pump system \(\Sigma_{P}\) as in (33), and the dynamics of the hydro turbine system \(\Sigma_{T}\) as in (38), and if we defined the switch \(S=1-2s\), where \(s=0\) for pump mode and \(s=1\) for turbine mode, we are able to rewrite \((\Sigma_{M},\Sigma_{P},\) and \(\Sigma_{T})\) in one single system with a new state vector \(\bar{x}\) defined as follows:  
\[\bar{x}=\text{col}\Big{(}\lambda_{s}^{\top},\lambda_{r}^{\top},p_{M},P_{r},Q \Big{)}, \tag{43}\]  
and a Hamiltonian function \(\hat{H}(\bar{x})\) given by the following:  
\[\hat{H}(\bar{x}) =\hat{H}(\bar{x})+\hat{H}(\bar{x})\] \[=\dfrac{1}{2}C_{h}P_{r}^{2}+C_{h}g\rho h_{w}P_{r}+\dfrac{1}{2}I_{ a_{h}}Q^{2}\] \[+\dfrac{1}{2}\lambda^{\top}L^{-1}\lambda+\dfrac{1}{2}(J_{a_{m}})^ {-1}p_{M-P}^{2}, \tag{44}\]with \(\tilde{H}(\tilde{x})\) as in (12) and \(\tilde{H}(\tilde{x})\) as in (28); moreover, \(p_{M-P}\) is the mechanical momentum of the motor-pump rotor. The resulting system takes the following form:  
\[\Sigma_{PT}\begin{cases}\hat{x}=[\tilde{J}(\tilde{x})-\tilde{R}(\tilde{x})] \
abla_{\tilde{x}}\tilde{H}(\tilde{x})+\tilde{g}_{1}(\tilde{x})\tilde{u}_{1}+ \tilde{g}_{2}(\tilde{x})\tilde{u}_{2},\\ \tilde{g}=\text{col}\Big{(}\tilde{g}_{1}(\tilde{x})^{\top}\
abla_{\tilde{x}} \tilde{H}(\tilde{x}),\tilde{g}_{2}(\tilde{x})^{\top}\
abla_{\tilde{x}}\tilde{ H}(\tilde{x})\Big{)}\,,\end{cases} \tag{45}\]  
where the skew-symmetric matrix \(\tilde{J}(\tilde{x})\) is  
\[\tilde{J}(\tilde{x})=\begin{bmatrix}0&0&0&0&0\\ 0&0&\delta n_{P}2\lambda_{r}&0&0\\ 0&\delta n_{P}\lambda_{r}^{\top}J_{2}&0&0&-S\frac{K_{0}\omega_{m}}{J_{a_{h}}} \\ 0&0&0&0&S\frac{1}{C_{h}J_{a_{h}}}\\ 0&0&S\frac{K_{0}\omega_{m}}{J_{a_{h}}}&-S\frac{1}{C_{h}J_{a_{h}}}&0\end{bmatrix} \tag{46}\]  
and the positive semi-definite matrix \(\tilde{R}(\tilde{x})\) is  
\[\tilde{R}(\tilde{x})=\begin{bmatrix}R_{s}I_{2}&0&0&0\\ 0&R_{r}I_{2}&0&0\\ 0&0&R_{a_{m}}&0\\ 0&0&0&0\\ 0&0&0&\frac{R_{a_{h}}}{J_{a_{h}}^{2}}\end{bmatrix}. \tag{47}\]  
and the following, respectively.  
\[\tilde{g}_{1}(\tilde{x})=\begin{bmatrix}I_{2}&0\\ 0&-\delta n_{P}I_{2}\lambda_{r}\\ 0&0\\ 0&0\\ 0&0\end{bmatrix},\text{and }\tilde{g}_{2}(\tilde{x})=\begin{bmatrix}-I_{2} \lambda_{s}&0\\ -I_{2}\lambda_{r}&n_{P}I_{2}\lambda_{r}\\ 0&0\\ 0&0\end{bmatrix},\]  
The inputs vectors of the system (45) result in \(\tilde{u}_{1}=\text{col}(V_{s},\omega_{m})\) and \(\tilde{u}_{2}=\text{col}(\omega_{e},\omega_{m})\). Furthermore, in (45), we consider that for control purposes, the input matrix should be \(\tilde{g}_{1}\) because it naturally provides the input-output port pair for the corresponding input-output, \((V_{s},i_{s})\), \((\omega_{m},\tau)\).  
A modelling of the reversible hydropump-turbine system \(\Sigma_{PT}\) has been presented, as shown in (45). It follows the design and implementation of numerical simulations to validate the performance of our system in an open-loop setting. Control actions in order to optimize the efficiency of the energy extraction and energy generation of the reversible system are out of the scope of this paper.