# Enhancing Unmanned Marine Vehicle Security: A Periodic Watermark-Based Detection of Replay Attacks
## 2 Problem Formulation and Preliminaries
### UMVs System Modeling  
It follows from [33; 34; 35] that the equations describing dynamics and kinematics of the UMVs shown in Figure 2 are depicted as follows:  
\[ \begin{split}&\mathbb{M}\tau(t)+\mathbb{N}\tau(t)+\mathbb{O}\varphi(t )=u(t)+\theta(t)\\ &\dot{\varphi}(t)=\mathbb{Z}(\omega(t))\tau(t)\end{split}  \tag{1}\]  
where \(\tau(t)=\big{[}\tau_{\text{surge}}(t)\ \tau_{\text{surge}}(t)\ \tau_{\text{surge}}(t) \big{]}^{T}\) denotes the vector of body-fixed linear and angular velocities, where \(\tau_{\text{surge}}(t)\) stands for surge velocity, \(\tau_{\text{sway}}(t)\) for sway velocity, and \(\tau_{\text{sway}}(t)\) for yaw velocity. \(\varphi(t)=[x(t)\ y(t)\ \omega(t)]^{T}\) indicates the earth-fixed orientation vector, where \(x(t)\) and \(y(t)\) are positions, and \(\omega(t)\) denotes the yaw angle. Control inputs are given by \(u(t)=[u_{1}(t)\ u_{2}(t)\ u_{3}(t)]^{T}\). \(\theta(t)=[\theta_{1}(t),\theta_{2}(t),\theta_{3}(t)]^{T}\) encapsulates wave-induced disturbances. \(\mathbb{O}=\text{diag}\{O_{11},O_{22},O_{33}\}\) stands for mooring forces. Figure 1: The UMVs diagram. Figure 2: Reference Reference frames fixed to the Earth and the body. Next, the UMVs system can be described as:  
\[\tau(t)=\mathbb{A}\varphi(t)+\mathbb{B}\tau(t)+\mathbb{D}u(t)+\mathbb{D}\theta(t) \tag{2}\]  
where \(\mathbb{A}=-\mathbb{M}^{-1}\mathbb{O},\mathbb{B}=-\mathbb{M}^{-1}\mathbb{N}, \mathbb{D}=\mathbb{M}^{-1}\). In constructing the fuzzy dynamic model of the UMVs system, the yaw angle serves as the premise variable. In this case, Three pivotal yaw angle points \(\omega(t)\) are selected at the origin and \(\pm\pi/6\), respectively, and linearize the system at those three operating points, the fuzzy model of UMVs is given as follows:  
\(R^{1}:\) IF \(\omega(t)\) is about 0 THEN  
\[ \begin{cases}\dot{x}(t)=A_{1}x(t)+Bu(t),\\ y(t)=Cx(t).\end{cases}  \tag{3}\]  
\(R^{2}:\) IF \(\omega(t)\) is about \(\pi/6\) THEN  
\[ \begin{cases}\dot{x}(t)=A_{2}x(t)+Bu(t),\\ y(t)=Cx(t).\end{cases}  \tag{4}\]  
\(R^{3}:\) IF \(\omega(t)\) is about \(-\pi/6\) THEN  
\[ \begin{cases}\dot{x}(t)=A_{3}x(t)+Bu(t),\\ y(t)=Cx(t).\end{cases}  \tag{5}\]  
where  
\[A_{p}= \begin{bmatrix}0_{3\times 3}&Q_{i}\\ \mathbb{B}&\mathbb{A}\end{bmatrix} ,\ B= \begin{bmatrix}0_{3\times 3}\\ \mathbb{D}\end{bmatrix} ,\ C= \begin{bmatrix}I_{3\times 3}&0_{3\times 3}\end{bmatrix} ,Q_{1}=I_{3 \times 3},\ Q_{2}= \begin{bmatrix}\frac{\sqrt{3}}{2}&-\frac{1}{2}&0\\ \frac{1}{2}&\frac{\sqrt{3}}{2}&0\\ 0&0&1\end{bmatrix} ,\ Q_{3}= \begin{bmatrix}\frac{\sqrt{3}}{2}&-\frac{1}{2}&0\\ -\frac{1}{2}&\frac{\sqrt{3}}{2}&0\\ 0&0&1\end{bmatrix} .\]  
Given that the position and angle can be measured with relative ease, the output matrix \(C\) is selected accordingly. Furthermore, the membership functions for the three rules are illustrated in Figure 3.  
The global T-S fuzzy model of the UMVs is derived using a singleton fuzzifier, product inference, and center average defuzzifier as described below:  
\[ \begin{cases}\dot{x}(t)=\sum_{p=1}^{3}\hbar_{p}(\varrho(t))(A_{p}x(t)+D_{p}u( t)+\theta(t))\\ y(t)=Cx(t)+v(t)\end{cases}  \tag{6}\]  
where  
\[\hbar_{p}(\varrho(t))=\frac{v_{p}(\varrho(t))}{\sum_{p=1}^{3}v_{p}(\varrho(t ))},v_{p}(\varrho(t))=M_{p1}(\varrho_{1}(t))M_{p1}(\varrho_{2}(t)),\hbar_{p}( \varrho(t))\geq 0,\sum_{p=1}^{3}\hbar_{p}(\varrho(t))=1.\]  
Figure 3: Membership functions. The discrete-time fuzzy system results from the periodic sensor sampling with a period of \(T_{z}\) and the application of the ZOH input mechanism:  
\[\left\{ \begin{aligned} x(k+1)=&\sum_{p=1}^{3} \hbar_{p}(\varrho(k))(A_{dp}x(k)+B_{dp}u(k)+\theta_{dp}(k)),\\ y(k)=& Cx(k)+v(k)\end{aligned} \right. \tag{7}\]  
where \(A_{dp}=e^{A_{p}T}\), \(B_{dp}=\int_{0}^{T}e^{A_{p}T}B_{n}\,dt\), and \(C\) are defined as in Equation (6). The function \(\hbar_{p}(\varrho(k))\) represents the value of \(\hbar_{p}(\varrho(t))\) at the sampling instance \(t=k\). The variables \(\theta_{dp}(k)\) and \(v(k)\) represent process noise and measurement noise, respectively.