# Modeling and Simulation of a Wave Energy Converter _Nwave_
## 4 Simulation in the Time Domain  
In this section, simulation of the buoy and PTO combined dynamics is carried out in the time domain under the irregular wave condition with the JONSWAP wave model [16]. For time domain analysis, the Runge-Kutta method was applied for solving the dynamics [17]. We obtained the hydrodynamic parameters of the buoy from AQWA (version 14, ANSYS, Pittsburgh, PE, USA) [18]. In order to calculate kernel function of excitation force \(f_{e}(t)\) and radiation damping \(f_{r}(t)\), the frequency domain responses for excitation forces \(\hat{f}_{e}(\omega)\), radiation \(\hat{R}(\omega)\) and added mass \(\mu(\omega)\) need to be calculated. In the AQWA simulation, the buoy has a \(2R=5\) m for diameter, with 0.5 m of draft, which reflects the actual size of the prototype buoy. It is floating in the ocean cube that has a 500 by 500 m\({}^{2}\) surface and \(h=5\) m of water depth, which is the actual depth of the installation area, and only surge, heave and pitch motions of the body are allowed. The frequency domain response should have a truncation frequency of 5 rad/s with a frequency spacing of 0.05 rad/s [19]. The lines in Figure 11 display the kernel functions of excitation force \(f_{e}(t)\) and radiation damping force \(f_{r}(t)\) from the calculations of (7) and (9), respectively. A JONSWAP wave model is adapted in order to generate irregular waves in the simulation. For time series calculations, the spectral distribution (18) is discretized as the sum of a large number \(M\) of regular waves, written as:  
\[\psi\left(t\right)=\sum_{m=1}^{M}\psi_{m}\cos\left(\omega_{m}t+\theta_{m} \right). \tag{22}\]  
Here, \(\omega_{m}=\omega_{l}+(m-1)\Delta\omega\), where \(\omega_{l}\) is the lowest frequency, \(\Delta\omega\) is a small frequency interval, \(m=1\), \(2\),..., \(M\) and the spectrum does not contain a significant amount of energy outside the frequency range \(\omega_{l}\leq\omega\leq\omega_{l}+(M-1)\Delta\omega\). \(\psi_{m}=\sqrt{2S_{JONSWAP}(\omega_{m})\Delta\omega}\) and \(\theta_{m}\) are the amplitude of the wave component of order \(m\) and the initial phase randomly chosen in the interval \((0,2\pi)\), respectively. With the excitation force vector formed by substituting (22) into (6), the combined dynamics with (11)-(13) and (17) was performed according to the Runge-Kutta method with 0.001 s sampling time [17]. A summary of the parameters and values used in the simulations is given in Table 1. Figure 12 displays the result of wave elevation, the buoy's posture, the angular speed of pulleys, the tension of ropes and the power output from the generator in the time domain when \(T_{p}\) = 4.5 s, \(H_{s}\) = 1 m and \(b_{g}\) = 5 Nm s/rad. In Figure 12, irregular waves yield complex motions of surge, heave and pitch. Furthermore, angular velocities of pulleys connected to the ropes and the generator also have very complex trajectories. The pulley speed \(\omega_{p}\) somewhat tracks the positive max value of \(\omega_{1}\) and \(\omega_{2}\) with small error. Finally, as \(\omega_{p}\) increases, the power from generator \(P_{g}\) also increases. Tensions \(T_{1}\) and \(T_{2}\) are only 0.25 tons of counterweight when power is not transmitted, and \(P_{g}\) is generated as tension increases. During the 30-min duration of the simulation, the average power output is 10.56 kW. The power output varies sensitively in accordance with \(b_{g}\). Figure 13 displays the graphs of \(\bar{P}_{g}^{*}\) with varying \(b_{g}\) under irregular waves with \(T_{p}\) = 4.5 s. Let us define \(\bar{P}_{g}^{*}\) and \(b_{g}\) as \(\bar{P}_{g,opt}^{*}\) and \(b_{g,opt}\), respectively, at the peak of the power output. In Figure 13, it can be seen that \(\bar{P}_{g}^{*}\) rapidly increases when \(b_{g}<b_{g,opt}\), \(\bar{P}_{g,opt}^{*}\) = 33.8 kW at \(b_{g,opt}\) = 3.8 and gradually decreases when \(b_{g}>b_{g,opt}\).