## 2 Materials and Methods
### WEC-Sim and Gazebo Descriptions
#### 2.1.2 Gazebo  
The _Gazebo_ MBARI-WEC model v1.1.0 [2] used in this study modeled the MBARI-WEC as four rigid bodies plus a tether assembly and is portrayed in Figure 1. One rigid body was the surface buoy which floated on the water surface and was excited by wave action. The PTO device was modeled as two rigid bodies, a larger one that was the size of the main PTO housing and another that was the contained piston which could slide in a single-DOF joint relative to the PTO housing. This joint was subject to pneumatic, hydraulic, and friction forces. The fourth rigid body of the system was the heave cone which hung below the PTO and was connected to the end of the piston by a tether assembly. The heave cone was subject to gravity and hydrodynamic forcing resulting from its motion through the water, which was presumed to be otherwise still at the depth of the heave cone. The tether was modeled as a collection of \"sausage-link\" rigid bodies that were connected end-to-end with rotational joints that imposed some stiffness and damping. A mooring system was not included in the _Gazebo_ version used to produce the results in this study. Each rigid body was characterized by its mass and moment of inertia matrix, as well as an added-mass matrix that depended on each body's shape. Each body was free to move with six degrees of freedom, limited by the constraints imposed by the joints that connected the rigid bodies. Again, since the system was typically excited by plane progressive waves, often, only three degrees of motion were excited (surge, heave, and pitch), but waves not aligned with the x- or y- directions would induce more modes of motion. In addition to the inertial forces acting on the bodies due to their mass, mass distribution, and added-mass characteristics, external forces and forces between the rigid bodies completed the model. Wave forces were only applied to the surface buoy and were modeled using linear wave theory as described above. For this _Gazebo_ model, the wave forcing was computed using a C++ library developed for this purpose that implements efficient computation of the time-domain wave forcing within the fixed-time-step _Gazebo_ solver [12]. Buoyancy forces on the surface buoy were also computed by this library using linear wave theory. Buoyancy forces for the fully submerged rigid bodies (PTO, piston, and the heave cone) along with the viscous drag forces for the rigid bodies were computed by a hydrodynamic forcing plugin that is distributed as part of _Gazebo_. In contrast to the _WEC-Sim_ model, the drag forces on the heave cone were symmetrical: they did not depend on the direction of vertical motion of the heave cone. As shown in the _WEC-Sim_ work [3], this was an approximation as the heave cone drag did in fact have some dependence on vertical direction of motion. Also note that because the PTO piston was entirely enclosed within the PTO housing, no hydrodynamic or buoyancy forces were applied to that rigid body. This resulted in a small amount of buoyancy that was neglected when the piston was extended outside of the PTO housing, but this was considered to be a negligible effect. Like _WEC-Sim_, the piston rod friction and mechanical losses of the motor torque friction in _Gazebo_ were based on models developed during the PTO bench tests [4]. _Gazebo_ also implemented the motor driver default damping relationship described by (3), similarly to _WEC-Sim_. In the air spring chambers, pressure, volume, and temperature of nitrogen also followed the ideal gas law (4), but unlike _WEC-Sim_, spring forces were largely modeled using a polytropic process [2]:  
\[P=P_{0}\left(\frac{V_{0}}{V}\right)^{n} \tag{7}\]where \(P\) [Pa] is the gas pressure, \(V\) [m\({}^{3}\)] the volume, and polytropic indices \(n=n_{1},n_{2}\) represent compression and expansion behavior (determined using a linear regression of the measured pressure vs. volume curves). However, when the piston velocity was slow, the spring forces were modeled with a heat transfer model using [PERSON]'s law of cooling [2].