## 2 Materials and Methods
### WEC-Sim and Gazebo Descriptions
#### 2.1.1 WEC-Sim  
Figure 2 presents the _WEC-Sim_ Simulink model v5.0.1 designed for the MBARI-WEC. The device was represented as three rigid bodies: the surface buoy, the PTO housing, and the heave cone. Each body was characterized by its mass, moment of inertia, quadratic drag, and displaced volume. These values were identical to those used in the _Gazebo_ model. The rigid bodies were subject to the aforementioned hydrodynamic and hydrostatic forces with the exception of the PTO housing, which was treated as a thin vertical cylinder well approximated by drag and static inertia terms. Because the simulated sea states were plane waves in the x-direction and the rigid bodies were axisymmetric, no sway, roll, or yaw motion was expected. Thus, the rigid bodies were confined to motion in three DOFs only: surge, heave, and pitch. The MBARI-WEC PTO system was integrated as a distinct Simscape model, and its resultant force applied to a joint positioned between the surface buoy and tether. This joint operated in a single translational DOF relative to the orientation of the PTO housing. The PTO housing and heave cone were connected together by the tether assembly comprised ofa string of rigid bodies connected by three joints that had stiffness and damping and were subject to quadratic drag forces. The choice of three joints represented the minimum number required to simulate a flexible cable without compromising computational speed [11]. The catenary mooring system used with the MBARI-WEC was incorporated in this model as the force derived from a mooring matrix, parameterized with stiffness and damping values corresponding to each DOF, fitted from a higher-fidelity catenary mooring model as described in [3]. An additional direction-dependent quadratic drag, stemming from the asymmetric shape of the heave cone, was introduced as an external force dependent upon its heave motion. The coefficients of drag were determined from the research conducted in [3]. The _WEC-Sim_ model incorporated the MBARI-WEC PTO using blocks from the Simscape library, as illustrated in Figure 3. The model was compartmentalized into distinct subsystems for the PTO, including air spring, piston, hydraulic, electric, friction, and controller feedback. The model's input parameters were derived from the work presented in [4], in which the Simulink PTO model was developed and validated against the physical PTO through experimental bench testing. In the PTO subsystem, the system took the PTO piston velocity, denoted as \"PTO Velocity\", as an input, and the resultant force was the output, referred to as \"Total PTO Force\". These variables are also illustrated in Figure 2, where they interact with the hydrodynamic model. The MBARI-WEC power electronics  
Figure 2: _WEC-Sim_ model of MBARI-WEC. Labeled from top to bottom are the surface buoy, PTO (PTO Simscape model, actuation force, and housing), tether, and heave cone. included a 4-quadrant driver with field-oriented control that related motor speed to torque by a default damping relationship:  
\[ \begin{split}\text{Speed [RPM]}&=[0,300,600,1000,1700,4400,6790]\\ \text{Torque [Nm]}&=[0,0,0.8,2.9,5.6,9.8,16.6]\end{split}  \tag{3}\]  
The torque could be adjusted further by a scaling factor ranging from 0.5 to 1.6 depending on sea state conditions. Moreover, when the piston retracted, characterized in this context as a positive motor speed, the torque was reduced by an additional factor of 0.6. The motor driver default damping relationship as outlined in (3) is evident in Figure 3, where \"Electric Motor Torque\" is correlated with \"Motor Speed\" through an external function. Some features within the PTO subsystems were similar in both the _WEC-Sim_ and _Gazebo_ models. These included the piston rod friction model and the motor friction loss model (established through bench tests) (see [4]). Key differences between the _WEC-Sim_ and _Gazebo_ models were how the air spring dynamics were modeled, efficiencies concerning the hydraulic motor, and the computation of electrical losses.