1 Introduction

To ensure the safety of structures, payload, and crew in adverse weather conditions, ships must have good seakeeping, maneuverability, and structural performance. In this regard, commercial and military ships must meet International Maritime Organization (IMO) Guidelines and NATO Standardization Agreements (STANAG). The prediction capability of ship performance in waves, along with the understanding of the physics involved, is of utmost importance. Recent NATO Science and Technology Organization (STO) Applied Vehicle Technology (AVT) task groups, such as AVT-280 “Evaluation of Prediction Methods for Ship Performance in Heavy Weather” (2017–2019) and AVT-348 “Assessment of Experiments and Prediction Methods for Naval Ships Maneuvering in Waves” (2021–2023) have focused on prediction methods for ship seakeeping and maneuvering in waves, respectively.

Recent computational and experimental fluid dynamics studies have demonstrated the maturity of computational tools for the prediction of ship performance in waves, including their assessment in extreme sea conditions (van Walree et al. 2020; Serani et al. 2021). The computational cost associated with the analysis is generally very high, especially if statistical convergence of relevant estimators is sought after and complex hydro-structural problems are investigated via high-fidelity solvers (Diez et al. 2020). In this context, machine learning and reduced-order models can help reducing the computational cost providing fast estimates, as long as they are properly trained and/or calibrated. Certainly, a proper trade-off between the computational cost associated to model training and the computational benefit of executing the desired analysis with machine learning and/or reduced-order models needs to be assessed and identified on a case-by-case basis. Generally, models are trained with a relatively small number of simulations (considering for instance steady and/or dynamic but prescribed motions and maneuvers at given conditions). Once trained, reduced-order models may be used to assess more complex maneuvers, for longer observation periods, including stochastic conditions and significant statistical analyses where appropriate). In addition, the ability of these models to learn from data makes them suitable for use in digital twins platforms. Finally, reduced-order models are generally easier to interpret than machine learning approaches and could help shedding light on the physics involved.

The objective of the present work is to present and discuss a proof-of-concept study on the use of a data-driven and equation-free approach to the forecasting of ships maneuvering in waves, based on the dynamic mode decomposition (DMD). DMD is a dimensionality-reduction/reduced-order modeling method, which provides a set of modes with associated oscillation frequencies and decay/growth rates (Schmid 2010). For linear systems, these modes/frequencies correspond to the linear normal modes/frequencies of the system. More generally, DMD modes/frequencies approximate eigenmodes and eigenvalues of the infinite-dimensional linear Koopman operator, providing a linear finite-dimensional representation of the (possibly nonlinear) system dynamics (Kutz et al. 2016b). This linear representation is entirely derived from available data and does not require the knowledge of the underlying system equations, which are and remain unknown. DMD growing success, especially in the fluid dynamics community (e.g., Rowley et al. 2009; Dogan et al. 2020), is due to this equation-free and data-driven nature. The method is capable of providing accurate assessments of the spatio-temporal coherent structures in complex flows and systems (e.g., Magionesi et al. 2018; Pagliaroli et al. 2022), also allowing short-term future estimates of the system state, which can be used for real-time prediction and control (Kutz et al. 2016a). Furthermore, DMD may serve as an effective model-order reduction methodology in shape optimization studies to speedup the simulation-driven optimization process (Tezzele et al. 2018, 2019).

In the present work, the objective of the DMD is the analysis and forecast of the finite-dimensional set of trajectory/motion/force time histories of ships operating in waves, offering a complementary efficient method to equation-based system identification approaches, e.g., Araki et al. (2012, 2019). The efficiency of the method in this context stems from the finite dimensionality of the set of relevant state variables together with the simplicity of operations required to model the system dynamics (as opposed to more data/resource-consuming machine learning approaches). This offers opportunity for integration into digital twin platforms for the data-driven modeling and prediction of ships in waves.

Results are presented for the course keeping of a free-running naval destroyer (5415M) in irregular stern-quartering waves at target \(\mathrm {Fr}= 0.33\) and sea state 7, using URANS (unsteady Reynolds-averaged Navier–Stokes) computations from Serani et al. (2021). Results are also presented for the free-running KRISO Container Ship (KCS), using experimental data from the University of Iowa IIHR wave basin, focusing on starboard turning circle with rudder angle of 35\(^{\circ }\), target Froude number \(\mathrm {Fr}=0.157\) in regular waves with \(\lambda /L=1\) (wavelength to ship-length ratio) and \(H/\lambda =1/60\) (wave-height to wavelength ratio). The present research is conducted in collaboration with NATO AVT-348 “Assessment of Experiments and Prediction Methods for Naval Ships Maneuvering in Waves”, and AVT-351 “Enhanced Computational Performance and Stability and Control Prediction for NATO Military Vehicles”.

2 Dynamic mode decomposition

The DMD formulation and nomenclature is taken from Kutz et al. (2016a). Specifically, consider a dynamical system described as

$$\begin{aligned} \dfrac{\mathrm {d}\mathbf {x}}{\mathrm {d}t}=\mathbf {f}(\mathbf {x},t;{\varvec{\alpha }}), \end{aligned}$$
(1)

where \(\mathbf {x}(t)\in \mathbb {R}^n\) represents the system state at time t, \({\varvec{\alpha }}\) contains the parameters of the system, and \(\mathbf {f}(\cdot )\) represents its dynamics. The state \(\mathbf {x}\) is generally large, with \(n\gg 1\) and can represent, for instance, the discretization of partial differential equations at a number of discrete spatial points, or multi-channel/multi-variable time series.

Considering \(\mathbf {f}(\mathbf {x},t;{\varvec{\alpha }})\) as unknown, the DMD works with an equation-free perspective. Thus, only the system measurements are used to approximate the system dynamics and forecast the future states. Equation 1 is approximated by the DMD as a (time) locally linear dynamical system defined as

$$\begin{aligned} \dfrac{\mathrm {d}\mathbf {x}}{\mathrm {d}t}=\mathcal {A}\mathbf {x} \end{aligned}$$
(2)

with solution

$$\begin{aligned} \mathbf {x}(t)=\sum _{k=1}^n \varvec{\varphi }_k \, q_k(t)= \sum _{k=1}^n \varvec{\varphi }_k \, b_k \, \exp (\mu _k t), \end{aligned}$$
(3)

where \(\varvec{\varphi }_k\) and \(\mu _k\) are, respectively, the eigenvectors and the eigenvalues of the matrix \(\mathcal {A}\); \(q_k\) are the time-varying modal coordinates, and \(b_k\) are the modal coordinates associated to the initial condition \(\mathbf {x}_0\), i.e., \(\mathbf {b}=\varvec{\varPhi }^{-1}\mathbf {x}_0\). It may be noted how, clearly, the DMD is based on an equation, namely Eq. 2. Nevertheless, the latter does not need the knowledge of nor use by any means the underlying true system equations, which are and remain unknown. DMD is based on the (time) locally linear dynamical system approximation of Eq. (2), which is derived entirely from the available data, as explained in the following, see Eq. (6). For this reason, DMD may be rightfully seen as an equation-free and data-driven approach.

Sampling the system every \(\Delta t\), the time-discrete state can be expressed as \(\mathbf {x}_k=\mathbf {x}(k\Delta t)\) with \(k=1,\ldots ,m\), representing from now on known system measurements. An equivalent discrete-time representation of the system in Eq. (2) can be written as

$$\begin{aligned} \mathbf {x}_{k+1}=\mathbf {Ax}_k, \quad \mathrm {with} \qquad \mathbf {A}=\exp (\mathcal {A}\Delta t) \end{aligned}$$
(4)

where \(\exp (\mathcal {A}\Delta t)=\sum _{k=0}^\infty \mathcal {A}^k \Delta t^k / k!\), by definition.

Arranging all the m system measurements in the following two matrices

$$\begin{aligned} \mathbf {X}= \begin{bmatrix} | &{} | &{} &{} |\\ \mathbf {x}_1 &{} \mathbf {x}_2 &{} \dots &{} \mathbf {x}_{m-1}\\ | &{} | &{} &{} |\\ \end{bmatrix}, \qquad \mathbf {X}'= \begin{bmatrix} | &{} | &{} &{} |\\ \mathbf {x}_2 &{} \mathbf {x}_3 &{} \dots &{} \mathbf {x}_{m}\\ | &{} | &{} &{} |\\ \end{bmatrix}, \end{aligned}$$
(5)

the matrix \(\mathbf {A}\) in Eq. (4) can be constructed using the following approximation:

$$\begin{aligned} \mathbf {A}\approx \mathbf {X}'\mathbf {X}^{\dag }, \end{aligned}$$
(6)

where \(\mathbf {X}^{\dag }\) is the Moore–Penrose pseudoinverse of \(\mathbf {X}\), which minimize \(\Vert \mathbf {X}'-\mathbf {AX}\Vert _F\), where \(\Vert \cdot \Vert _F\) is the Frobenius norm.

The state-variable evolution in time can be approximated by the following modal expansion (as per Eq. 3):

$$\begin{aligned} {\mathbf {x}(t)=\sum _{k=1}^n \varvec{\phi }_k \, q_k(t)= \sum _{k=1}^n \varvec{\phi }_k \, b_k \,\exp (\omega _k t),} \end{aligned}$$
(7)

where the \(\varvec{\phi }_k\) are the eigenvectors of the approximated matrix \(\mathbf{A}\), \(\omega _k=\text {ln}(\lambda _k)/\Delta t\) with \(\lambda _k\) eigenvalues of the same matrix (Kutz et al. 2016a).

In general, the DMD can be viewed as a method to compute the eigenvalues and eigenvectors (modes) of a finite-dimensional linear model that approximates the infinite-dimensional linear Koopman operator (Kutz et al. 2016a), also known as the composition operator. Here, the DMD is applied to inherently finite-dimensional data, i.e., ship trajectories/motions/forces in waves, similarly to DMD applications to power grid load data (Dylewsky et al. 2022; Mohan et al. 2018), financial trading strategies (Mann and Kutz 2016), sales data (Vasconcelos Filho and dos Santos 2019), and neural recordings (Brunton et al. 2016). Furthermore, due to the low dimensionality of data in the current context, Eq. (6) is computed directly, without the need of performing the singular value decomposition of \(\mathbf{X}\) and projecting onto proper orthogonal decomposition modes (Kutz et al. 2016a).

3 Test cases and DMD setup

This section describes the test cases used for demonstration and the DMD setup. It is worth noting that, although the DMD is not a machine learning method in the strict sense, its data-driven nature allows for approaching DMD in a similar way to machine learning. Here the matrix \(\mathbf{A}\) is constructed using observed (past) time histories, which are used as training set. The DMD is then used for the short-term prediction of trajectory/motion/force time histories, which are compared against true observed (future) data used as test set. As comparison metrics, the average normalized mean square error (NMSE) is used. The mean square of the modal coordinates \(\langle q_k^2 \rangle \) is used as a metrics for modal participation.

3.1 Course keeping of the 5415M in irregular waves

The hull form under investigation is the MARIN model 7967 which is equivalent to 5415M, used as test case for the NATO AVT-280 “Evaluation of Prediction Methods for Ship Performance in Heavy Weather” (van Walree et al. 2020). The full-scale ship is assumed \(L = 142 \, {\text {m}}\) long (length between perpendiculars). The model is self-propelled and kept on course by a proportional-derivative controller actuating the rudder angle.

Course-keeping computations are based on the URANS code CFDShip-Iowa V4.5 (Huang et al. 2008). CFD simulations are performed with propeller revolutions per minute fixed to the self-propulsion point of the model for the nominal speed, corresponding to \(\mathrm {Fr} = 0.33\). The simulations are conducted in irregular long crested waves (following a JONSWAP spectrum), with nominal peak period \(T_p = 9.2\) s and wave heading of 300\(^{\circ }\) (see Fig. 1). The nominal significant wave height is equal to 7 m, corresponding to sea state 7 (high), according to the World Meteorological Organization definition. It may be noted that the simulation conditions are close to a resonance condition for the roll. The six degrees of freedom rigid body equations of motion are solved to calculate linear and angular motions of the ship. A simplified body-force model is used for the propeller, which prescribes axisymmetric body force with axial and tangential components. The total number of grid points is about 45M. Further details can be found in Serani et al. (2021) and van Walree et al. (2020) where also potential flow computations and experimental data are presented and discussed.

Fig. 1
figure 1

CFD snapshot of the 5415M test case (left) and a photograph of the IIHR wave basin with the KCS model (right)

Fig. 2
figure 2

DMD complex modal frequencies, modal participation, and two most energetic modes (from left to right, respectively) for the 5415M test case

The state variables used for DMD are the ship six degrees of freedom (surge, sway, heave, roll, pitch, yaw; ship motions in the carriage coordinate system, projected onto the ship axes) plus the rudder angle. In addition, first and second time derivatives of all variables are included in the data set, computed by a fourth-order finite difference scheme (therefore \(n=21\)). The use of derivatives enables a better description of the system dynamics and defines a higher dimensional space potentially more amenable to an accurate linear representation of the nonlinear system dynamics. All variables are standardized, i.e., translated and scaled to have zero mean and unit variance. The matrix \(\mathbf{A}\) is built using about five encounter waves (corresponding to 1766 time steps). The prediction and test sets span the same length. Finally, the prediction is built using all modes/frequencies, leaving reduced-order studies to future research.

3.2 Turning circle of the KCS in regular waves

The second test case is the starboard turning circle of the free-running KCS in regular waves with constant rudder angle of 35\(^{\circ }\). Data are taken from experiments conducted at the IIHR wave basin, which is shown in Fig. 1 and whose characteristics are given in Sanada et al. (2021). The model length is \(L=2.7\) m and the nominal speed corresponds to \(\mathrm {Fr}=0.157\). The propeller RPM are fixed and provide the nominal speed in calm water. The regular wave parameters are \(\lambda /L=1\) and \(H/\lambda =1/60\).

Fig. 3
figure 3

DMD prediction and average error for the 5415M test case (standardized variables)

Fig. 4
figure 4

DMD complex modal frequencies, modal participation, and two most energetic modes (from left to right, respectively) for the KCS test case. Note that here L/U is used as a non dimensionalizing factor for the eigenvalues

The state variables used for DMD are the x, y, and z coordinates (Earth-coordinate system) of a reference point placed amidships, pitch and roll motions, turning rate, u, v, and w component of the ship velocity (projected onto the ship axes), rudder angle, propeller thrust, and torque. As in the previous test case, first and second time derivatives are included in the data set (\(n=36\)) and all variables are standardized. The matrix \(\mathbf{A}\) is built using about four encounter waves (corresponding to 132 time steps), while the prediction and test sets span the same length. Predictions are built using all modes/frequencies.

4 Results

The following subsections describe the DMD results for the test cases, discussing the DMD analysis of the system dynamics (including complex modal frequencies, modal participation, and most energetic modes) and the future prediction of the system state.

4.1 5415M course keeping in irregular waves

Figure 2 presents the DMD results for the system dynamics. Specifically, the left figure shows the complex modal frequencies provided by DMD. For the sake of clarity of representation, only a subset with the most energetic frequencies is depicted. For the same subset, the center figure shows the modal participation as a function of the frequency imaginary part. Finally, the right figure presents the magnitude of components for the two most energetic couples of complex-conjugate modes, where for the sake of clarity and simplicity derivatives are not shown. It may be noted how the dynamic is dominated by one couple only (see Fig. 2 center, namely represented by the modes \(k=6,7\)). This couple presents a frequency close to the roll resonance frequency (see, e.g., van Walree et al. 2020) and mainly involves roll, pitch, yaw, rudder, and to a lesser extent heave (see blue line in Fig. 2, right). The second couple is significantly less energetic and has a smaller frequency (slower dynamics). It mainly involves planar motion variables, i.e., surge, sway, yaw, and to a lesser extent rudder (see black line in Fig. 2, right). It is worth noting that here frequencies and eigenvectors are ordered by the absolute value of the complex frequency imaginary part, in ascending order. Alternatively, frequencies and eigenvectors may be ordered by their modal participation or energy, in descending order, which is a natural choice if model-order reduction is sought after. This is not needed here as a full-order expansion is used.

Fig. 5
figure 5

DMD prediction and average error for KCS test case (standardized variables)

The short-term prediction of the system dynamics by DMD is shown in Fig. 3. The observed (past) time histories are depicted in black, the predicted (future) time histories are in blue, while the true observed (future) time histories are presented with a dashed black line. All variables are shown in their standardized form and time values are normalized with the average encounter period. The NMSE of the prediction is shown at the bottom in red. Roll, pitch, and rudder present the most accurate prediction, whereas sway is found the most difficult variables to forecast. On average, variables are reasonably predicted upto two encounter periods. After, the prediction becomes less accurate especially for sway and yaw.

4.2 KCS turning circle in regular waves

Figure 4 presents the results of the DMD of the system dynamics. Again, the left figure shows the complex modal frequencies provided by DMD. As in the previous case and for the sake of clarity of representation, only a subset with the most energetic frequencies is depicted. For the same subset, the center figure shows the modal participation as a function of the frequency (imaginary part), while the right figure presents the two most energetic couples of complex-conjugate modes (magnitude of components shown; derivatives not shown). It may be noted how the dynamic is dominated by one mode with zero frequency (see Fig. 4 center; the real part, not shown, is also zero), setting an offset for the data. The first most energetic couple of complex-conjugate modes (\(k=2,3\)) correspond to a quite slow dynamics and mainly involves trajectory and planar motion variables, i.e., x, y, v and to a lesser extent z, rate of turn, and u. The second couple presents a larger frequency (faster dynamics, due to the waves). It mainly involves z, roll, pitch, rate of turn, u, v, w, thrust, and torque. It may be noted how the rudder does not participate in these dynamics, which may appear unexpected: in this demonstration, the rudder is kept fixed at 35\(^{\circ }\). Certainly, the ship dynamics depends on the rudder angle, but here the rudder is fixed (see the rudder time history in Fig. 5) and therefore no rudder dynamics is observed. The same considerations made for frequencies/eigenvectors order of the 5415M apply here.

Figure 5 shows the results of the DMD in producing the short-term prediction of the system dynamics, where the observed (past) time histories are depicted in black, the predicted (future) time histories in blue, the true observed (future) time histories are presented with a dashed black line. All variables are standardized and time values are normalized with the average encounter period. The NMSE of the prediction is shown at the bottom in red. The trajectory (x and y) is very well predicted, also due to its slow dynamics. Pitch, u, thrust, and torque presents a faster dynamics (due to the waves) and are also reasonably predicted. Roll, turning rate, and v are found the most difficult variables to forecast. Also in this case, variables are reasonably predicted upto two encounter periods. After, the prediction becomes overall less accurate.

5 Conclusions and future work

A proof-of-concept study on the use of a data-driven and equation-free approach to forecast responses of ships maneuvering in waves was presented and discussed, based on the dynamic mode decomposition of ship trajectory/motion/force time histories. The DMD provides a data-driven and equation-free approach to the linear representation of the system dynamics, allowing for (a) extracting knowledge on the system dynamics and (b) forecasting the system state in the near future. Results were shown for course keeping data of the self-propelled 5415M in irregular waves and turning-circle data of the self-propelled KCS in regular waves. Time histories were provided by CFD and EFD for 5415M and KCS, respectively.

Results are overall promising. The analysis is very efficient and suitable for real-time predictions. The DMD model is able to extract the most important modes and forecast with reasonable accuracy the system state upto two wave encounter periods. After this time horizon, the prediction is no longer accurate and the methodology needs improvements. The system nonlinearity plays certainly an important role in the DMD capability of predicting longer time horizons. Moreover, the overall analysis setup (such as the number of observed input waves and the number of time derivatives included in the data matrix) is also deemed to affect the DMD forecasting capabilities, thus requiring deeper investigations.

For these reasons, future research directions include systematic studies of observed data size, time step, and time-derivative order along with the most effective choice of the variable set and possibly coordinate systems, including whenever appropriate dimensional analysis (Dogan et al. 2020). Ongoing work is focusing on the statistical assessment of DMD performance using multiple time series, studying the effects of the number of input/output waves, time steps, derivatives, along with the use of time-shifted copies of the available data, i.e. using the Hankel matrix (Vasconcelos Filho and dos Santos 2019) of the time histories. The assessment is performed considering several performance metrics, such as the normalized root mean squared error, the Pearson correlation coefficient, the average angle measure (Hess et al. 2006), and the normalized average minimum/maximum absolute error (Diez et al. 2022). Parametric analysis of the DMD forecasting capabilities conditional to operating and environmental conditions is also of interest and will be assessed within the activity of the NATO AVT-348.

Methodological advancements that are expected to provide benefits include DMD with control (Proctor et al. 2016), DMD with time delay embedding (Kamb et al. 2020), and multi-resolution DMD (Kutz et al. 2016b). Finally, the combination of DMD with artificial neural network approaches (D’Agostino et al. 2021) is expected to overcome some of the limitations of the DMD (i.e., its linearity) providing more flexible architectures (Diez et al. 2022) to address highly-nonlinear system dynamics.