# Particle Swarm Optimization of a Passivity-Based Controller for Dynamic Positioning of Ships
## 5 Numerical Simulations
### The Robustness of the Proposed Controller  
A vessel operating in the sea or ocean is subjected to different disturbances due to different sea and ocean states. Such environmental disturbances due to wind, waves, and currents play an important role in the stabilization and performance of the DP system of the vessel which may cause the vessel to drift from the desired position and heading and/or oscillate [50; 51]. Therefore, the disturbance rejection becomes a crucial issue in the design of DP controller. Environmental changes cause changes to the disturbance characteristics (such as the current and wind speed, waves elevation and frequencies) of the controlled system. Such disturbances induced by wind, waves, and currents can be separated into components at lower frequencies (LF) due to the second-order waves also called slow wave drift forces [39], and components at wave-frequency (WF) disturbances due to the first-order waves. LF and WF comprises the main disturbances affecting the ship motion with LF responsible for drifting and WF for oscillation of the vessel [50]. The WF disturbances are typically tackled by wave-filtering techniques in advance [52], and DP systems can then deal with the LF disturbances which can be represented with a series of sinusoidal components with different frequencies, amplitudes and phases [51]. Different disturbances due to different sea states were described in the Code of sea state in Table 4 which are characterized by wave spectra [39]. Mathematically, the vector (\(\mathbf{b}\in R^{3}\)) in Equation (1) denotes the disturbance vector consisting of equivalent LF disturbance forces \(b_{1}(t)\) in surge, disturbance force \(b_{2}(t)\) in sway and disturbance moment \(b_{3}(t)\) in yaw. Here, we show the capability of the proposed dynamic control law, by incorporating the integral action term, in rejecting externally induced disturbance, hence, achieving robust bounded control performance. We demonstrated our proposed design with two sets of simulations for two different scenarios; in the first scenario a vessel has been disturbed (at T = 0 s) by constant wind and current speeds and constant wave height, then being suddenly disturbed by stronger wind and current, and higher wave at (T = 1500 s). Figures 12-14 show the response of the closed-loop system in presence of disturbances which have been induced to the system at time (T = 1500 s). As shown, the proposed controller has rejected the environmental disturbances and forced the ship to return back to its desired position (equilibrium) demonstrating its effectiveness and robustness in spite of disturbances. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Sea State Code** & **Description of Sea** & **Wave Height Observed (m)** & **World Wide Probability (\%)** \\ \hline
0 & Calm (glassy) & 0 & - \\ \hline
1 & Calm (ripples) & 0–0.1 & 11.2486 \\ \hline
2 & Smooth & 0.1–0.5 & - \\ \hline
3 & Slight & 0.5–1.25 & 31.6851 \\ \hline
4 & Moderate & 1.25–2.5 & 40.1944 \\ \hline
5 & Rough & 2.5–4.0 & 12.8005 \\ \hline
6 & Very rough & 4.0–6.0 & 3.0253 \\ \hline
7 & High & 6.0–9.0 & 0.9263 \\ \hline
8 & Very high & 9.0–14.0 & 0.1190 \\ \hline
9 & Extreme & Over 14.0 & 0.0009 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Codes of sea state [39]. Figure 12: The position of ship \(q_{1}\) in the \(x\)-coordinate subject to disturbances. Figure 13: The position of ship \(q_{2}\) in the \(y\)-coordinate subject to disturbances. In the second scenario, the vessel started in the slight sea state (code no. 3 in Table 4) and then environmental changes associated with moderate sea state (code no. 4) disturbed the vessel at time (T = 1200 s). The values of wave height, peak frequency and direction, and wind/current speeds angles and directions have been taken from [51] adopting the Jonswap spectrum which has been discussed in [39].