Control Co-Design of Power Take-Off Systems for Wave Energy Converters Using WecOptTool

Improved power take-off (PTO) controller design for wave energy converters is considered a critical component for reducing the cost of energy production. However, the device and control design process often remains sequential, with the space of possible final designs largely reduced before the controller has been considered. Control co-design, whereby the device and control design are considered concurrently, has resulted in improved designs in many industries, but remains rare in the wave energy community. In this paper we demonstrate the use of a new open-source code, WecOptTool, for control co-design of wave energy converters, with the aim to make the co-design approach more accessible and accelerate its adoption. Additionally, we highlight the importance of designing a wave energy converter to maximize electrical power, rather than mechanical power, and demonstrate the co-design process while modeling the PTO's components (i.e., drive-train and generator, and their dynamics). We also consider the design and optimization of causal fixed-structure controllers. The demonstration presented here considers the PTO design problem and finds the optimal PTO drive-train that maximizes annual electrical power production. The results show a 22% improvement in the optimal controller and drive-train co-design over the optimal controller for the nominal, as built, device design.

Control Co-Design of Power Take-Off Systems for Wave Energy Converters Using WecOptTool Carlos A. Michelén Ströfer , Daniel T. Gaebele , Ryan G Coe , and Giorgio Bacelli Abstract-Improved power take-off (PTO) controller design for wave energy converters is considered a critical component for reducing the cost of energy production.However, the device and control design process often remains sequential, with the space of possible final designs largely reduced before the controller has been considered.Control co-design, whereby the device and control design are considered concurrently, has resulted in improved designs in many industries, but remains rare in the wave energy community.In this paper we demonstrate the use of a new open-source code, WecOptTool, for control co-design of wave energy converters, with the aim to make the co-design approach more accessible and accelerate its adoption.Additionally, we highlight the importance of designing a wave energy converter to maximize electrical power, rather than mechanical power, and demonstrate the co-design process while modeling the PTO's components (i.e., drive-train and generator, and their dynamics).We also consider the design and optimization of causal fixed-structure controllers.The demonstration presented here considers the PTO design problem and finds the optimal PTO drive-train that maximizes annual electrical power production.The results show a 22% improvement in the optimal controller and drive-train co-design over the optimal controller for the nominal, as built, device design.Index Terms-Wave energy converter (WEC), power take-off (PTO), optimization, co-design, optimal control.The authors are with the Sandia National Laboratories, Albuquerque, NM 87123 USA (e-mail: cmichel@sandia.gov;dtgaebe@sandia.gov;rcoe@sandia.gov; gbacell@sandia.gov).

NOMENCLATURE
Color versions of one or more figures in this article are available at https://doi.org/10.1109/TSTE.2023 equal to 34% of the 2019 U.S. electricity generation [1], and offers substantial grid services when complementing other renewable energy sources like wind and solar [2].However, wave energy is also the most complex and expensive form of marine energy to extract, with a modeled levelized cost of energy value over $0.50/kWh [3].It is widely believed that improved design of the power take-off (PTO) controller will play a major role in reducing the cost of energy generation to commercially viable levels.However, we argue, current approaches to the design of wave energy converters (WEC), PTOs, and their controllers limit the development of high performing devices.
A common approach for control design for WECs so far has been to maximize the PTO mechanical power (i.e., the product of PTO force and velocity) through impedance matching.In this approach, the PTO impedance producing the largest average mechanical power is the complex conjugate of the intrinsic impedance of the WEC-the impedance relating external forcing (e.g., wave excitation) to the WEC motions.This approach, however, has several shortfalls [4].Two of these issues-(i) not considering the PTO dynamics and electrical power and (ii) designing the WEC/PTO and controller sequentially-are addressed directly in this paper, and a third-(iii) using causal controllers-is discussed.
The first issue with this common current approach for system and control design for WECs is that it does not considers the structure of the PTO-e.g., the drive-train and generator dynamics.Considering the PTO structure and its output electrical power rather than the PTO mechanical power has a significant effect on the power prediction and, therefore, WEC design.The optimal design and the resulting WEC dynamics can be wildly different when considering the PTO structure.For this reason, practice has been shifting to considering realistic PTO dynamics when designing WECs.
The second issue is the sequential design of WEC and PTO hardware followed by the control design, hence the space of possible final designs is largely reduced before the controller has been considered [5].Control co-design, whereby the device and controller design are considered concurrently in the design process, has been widely used in many different applications [5], [6], [7], [8] due to its ability to result in improved performance as compared to a sequential approach.It has been shown that application of co-design to WEC and PTO design could have a similar impact [9], [10], [11], [12].The co-design approach, however, adds an additional complexity to the design optimization process.The optimal controller needs to be found for each design considered in the design optimization, effectively introducing a nested optimization problem.Although optimization is a popular topic in academic research, it's use in industry is limited and there is no commonly applied best practice [13].
To make control co-design and optimization of WECs more accessible to the wave energy community, we recently released the open-source code, WecOptTool1 .
Finally, the third issue with the common control design approach is that it assumes the optimal PTO impedance is achievable.The optimal control, however, is acausal and therefore requires knowledge of the future.Much research has focused on predicting the future wave elevations, through real-time measurements and modeling, for the purpose of optimal PTO control.The difficulty of this problem has lead to somewhat of a roadblock in designing and implementing improved control strategies [14].It has recently been pointed out that due to the band-limited and slow time-varying nature of real sea states, causal, low-order linear controllers that are straightforward to implement can perform nearly as well as the optimal controller [4], [15].For these reasons, it can be expected that considering and optimizing narrow-banded, low-order linear controllers would lead to quicker implementation of high performing control strategies with little loss in performance.One method for designing optimal fixed-structure controllers starts from the optimal unstructured controller solution [16], that is the optimal time-series of the control state trajectory.Implementation in real-time deployments requires a structured controller, i.e. one that can be described by a function with tunable parameters.The method approximates the optimal unstructured solution with a linear feedback controller, followed by handling constraints with the design process inherent to a model predictive controller.The model predictive controller performs like the linear PI controller while the constraints are inactive via inverse matching.For this reason, in this paper we focus on finding the optimal (unstructured) controller and defer to the method in Cho et al. [16] for how to use such results to design a practical causal controller while respecting PTO constraints.
This paper demonstrates the control co-optimization process using WecOptTool.The proposed design approach (i) considers the PTO structure and electrical power, and (ii) uses a control co-design approach.The last step of (iii) designing a realizable fixed-structure controller based on these results is discussed.As the demonstration case, we consider the PTO design problem and find the optimal PTO drive-train to maximize annual electrical power.The PTO drive-train optimization is used as a demonstration, but the methodology can be used for the control co-design of any component of the WEC and PTO.We hope that this tool, together with this demonstration, will accelerate the adoption of control co-design in the wave energy community.

II. METHODOLOGY
The optimal structured or unstructured controller are obtained using a pseudo-spectral method [17], [18], [19].The WEC position time history for a given degree of freedom (DOF) is represented using the components of its Fourier decomposition for a discrete (angular) frequency array ω = [ω 0 , 2ω 0 , . . ., N ω ω 0 ] of length N ω , where ω 0 is the fundamental (angular) frequency.The real and imaginary components of the Fourier coefficients plus the DC (mean) component-2N ω + 1 components per DOF-are stored in the WEC state variable x wec .The optimization variables for the controller are contained in the control state vector x p .For an unstructured controller, each PTO DOF is represented similar to the WEC positions with the Fourier coefficients of the PTO force time-history.For a structured controller, x p consists of structure-specific parameters, e.g., for a PI controller it consists of only two scalar gains for each PTO DOF.The WEC and controller states are combined into a single state variable x = [x wec , x p ] T .The problem of solving the WEC dynamics and of determining the optimal control state x p are combined into a single optimization problem where J(x) is the objective function (e.g., average electrical power), r(x) captures the WEC dynamics in residual form (discussed in Section II-A), and c eq and c ineq are arbitrary equality and inequality constraints (e.g., maximum line tension or maximum PTO force).For the demonstration in this paper, the objective function is the average electric power, and the PTO force is constrained using an inequality constraint.The WEC dynamics consist of the linear excitation, hydrodynamic and hydrostatic forces, and linear PTO force.Each of these components are described in more details next.

A. WEC Dynamics
The linear WEC dynamics equations can be written in the time (t) domain in residual form as where M is a mass/inertia matrix, ẍ the WEC acceleration vector, and the different generalized force vectors are the radiation force f r due to wave generation, the hydrostatic force f h , the hydrodynamic frictional force f f , the wave excitation force f e , and any additional forces f a such as PTO force and mooring forces.
Because of the oscillatory nature of waves, it is convenient to write these equations in the frequency domain.For some timedomain response y(t), the frequency-domain response Ŷ(ω) is obtained from the Fourier transform F and is such that y(t) = Re{ Ŷ(ω) exp(jωt)}, where j is the imaginary unit and Re( ) indicates the real component.We define the Fourier transform of the velocity to be F{ ẋ(t)} = Û(ω), thus the position and acceleration in the frequency-domain are F{x(t)} = Û/(ω)(jω) and F{ẍ(t)} = jω Û(ω), respectively.Using this convention, the equation of motion (2) can be written in the frequency domain as Fr where A(ω), B(ω), FFK (ω), and FD (ω) are the added mass, radiation damping coefficient, Froude-Krylov force, and diffraction force which we obtain from solutions of the radiation and diffraction problems using the boundary element method code Capytaine2 [20].The other variables are the hydrostatic stiffness K hs , accounting for buoyancy and gravity, which can be calculated from geometric and mass properties of the WEC, and a linear frictional coefficient B f .The frequency components of the position that compose the state x wec are given by the real and imaginary components of Û/(ω)(jω).The residual form of the dynamics equation should be a function of the state, x, to incorporate into (1) as a constraint, i.e. r(x).The state x contains the Fourier components of the position as x wec , which can be used to determine first the frequency domain forces and then the time domain forces and residuals.The result is N t residual equality constraints, one for each time step considered, where the number of time-steps is

B. PTO Model and Electric Power
The individual heave PTO components of the WaveBot are illustrated in Fig. 1.It includes a belt transmission mechanism that converts the heave motion to rotational shaft motion.This is modeled with an effective gear ratio with units of rad/m.As built, the rotational shaft is connected directly to the generator, but here we consider the addition of a magnetic spring to beneficially alter the dynamics of the system.Following the spring, the shaft is connected to a three-phase permanent magnet synchronous generator, which is modeled with the linear power-invariant Park transform [21].The transform can be applied to any AC electric machine and results in a linear time-invariant system.Since the resulting model is linear it can be represented in terms of an impedance matrix.Although, this is a simplified linear model, it captures the most relevant dynamics for electromagnetic energy conversion including I 2 R losses.Therefore, the model presented in this section is applicable to a wide range of WEC PTOs.
We use 2-port modelling techniques to connect the PTO mechanical and electrical sub-components [22].The linear PTO model can be written as where the PTO impedance is expressed as a matrix relating the flow variables, velocity Û(ω) and current Î(ω), to the effort variables, PTO force Fp (ω) and load voltage V(ω).The components of this impedance matrix, commonly referred to as z-parameters, are obtained under open-circuit conditions, i.e. no load current or no WEC velocity, respectively.The subscripts of the components indicate the combination of effort and flow variable.Using Newton's second law to model the drive-train dynamics and assuming a generator model following a power-invariant Park transform yields where N d is the gear ratio and K τ is the torque constant that relates electrical current to electromagnetic torque.The drive-train impedance Z d and generator winding impedance Z w are given in terms of drive-train inertia M d , resistance B d , and stiffness K d , and winding inductance L w and resistance B w , respectively, as Regardless of whether a structured or unstructured controller is used, we can obtain the WEC motions Û(ω) and PTO forces Fp (ω) from the state x = [x wec , x p ] T .It is then necessary to rewrite the impedance in ABCD form [23]: where Fig. 2. WaveBot device [24] dimensions.

TABLE I WAVEBOT DEVICE NOMINAL DESIGN PARAMETERS
Note that the frequency dependency of the individual impedance components is omitted in (12) for brevity.Finally, the electric power can be obtained as the (time-domain) product of the resulting current and voltage.The average electrical power is used as the objective function, where t f and N t are the final time and the number of time-steps in the discretization, respectively.

III. VERIFICATION
The equations from Section II are implemented in WecOpt-Tool, which can be used for control co-design of WECs and their PTOs.The equations presented in the section help to verify that WecOptTool finds the correct solution for some simple cases that have a theoretical optimum.For the demonstration in this paper we use the WaveBot device [24], shown in Fig. 2, in one degree of freedom.The device's nominal (as built) parameters are listed in Table I.For validation we consider no additional constraints on the WEC or PTO dynamics.With no additional constraints, the problem is linear and impedance matching can be used to analytically obtain the optimal control.This is compared to the optimum control obtained numerically from WecOptTool.

A. Impedance Matching: Mechanical Power
The mechanical intrinsic impedance Z i (ω) is defined based on the linear dynamic (3) with no additional forces (F a = 0) as with (15) Considering the PTO force as an additional force and representing it in terms of a PTO impedance as we can write The maximum mechanical power (PTO force × velocity) is obtained when the PTO impedance is set to the complex conjugate of the intrinsic impedance (see, e.g., [25]),

B. Impedance Matching: Electrical Power
Similar to the mechanical power case, we can find the optimal PTO force time history that results in the maximum average electrical power absorption, when considering the overall PTO.For this we consider the Thèvenin equivalent circuit [26], [27], [28], shown in Fig. 3, with voltage and impedance given by In analogy to the optimality conditions for mechanical power ( 16)-( 18), following the 2-port convention of power flow for the Thèvenin equivalent circuit yields the optimal current and voltage, Finally, the optimal velocity and force are given by We may also derive the upper bound for electrical power as For a structured PTO, we will consider a PI controller.The state x p consists of two gains, B p and K p and the PTO force is given by the impedance which in general cannot capture the optimal force in (23).For a regular wave of frequency ω i , however, a PI controller can provide the optimal PTO force with the gains derived from the real and imaginary components of the optimal PTO impedance Z i (ω) as In general, the (time-averaged) electric power contained in a single frequency component ω i is given by As a first verification case we use a regular wave with frequency 0.3 Hz and amplitude 0.0625 m.WecOptTool is used to obtain trajectories for the optimal unstructured and PI controllers.Fig. 4 shows that the electric power time-series of both the unstructured and PI controller match the theoretical optimal solution based on impedance matching from (23).Additionally, for the PI controller the optimal gains obtained by the code are the same as those obtained from impedance matching ( 27)-( 28 As a second verification we simulate an irregular wave, based on sea state A in Table II (an irregular wave with a JONSWAP spectrum, significant wave height of 1.5 m, energy period of 7.62 s, and γ = 3.3), and compare the unstructured controller results from WecOptTool with the analytically calculated theoretical optimum using ( 21)- (22).Fig. 5 shows that the electrical power results from the code exactly matches the theoretical optimum.Fig. 4. Electrical power for a regular wave case used as verification of the code implementation.For a regular wave, both the unstructured and PI controller can exactly match the optimal control.Note that negative power is power extracted from the device while positive power is actuation power put into the device.

TABLE II REPRESENTATIVE SEA STATE PARAMETERS AND WEIGHTS (LEFT) AND THE AVERAGE ELECTRICAL POWER RESULTS (RIGHT)
Fig. 5. Electrical power for an irregular wave case used as verification of the code implementation.For a irregular wave, the unstructured controller can exactly match the optimal control.Note that negative power is power extracted from the device while positive power is actuation power put into the device.

IV. RESULTS
To demonstrate one application of WecOptTool, we consider the case of a control co-design of a WEC's PTO drive-train.All the results presented are available as an interactive Jupyter Notebook 3 .The demonstration case uses the same device as the validation cases, the WaveBot [24] in one degree of freedom, but includes additional constraints that make the problem non-linear and the problem must be solved numerically.The cooptimization problem demonstrated here is the following: design the optimum PTO drive-train that maximizes annual electrical power production using the unstructured optimal controller.The drive-train design is parameterized by the drive-train stiffness (K d ) and the drive-train inertia (M d ).These drive-train physical components are optimized to maximize the annual electrical power production, while considering the optimal control trajectory for each design and for each sea-state.Additionally, the PTO force is constrained to a maximum of 8 kN in either direction, which is formulated as the inequality constraint Realistically, the system has additional constraints such as the generator's operational speed and torque ranges specified by the manufacturer.We use PTO force as a simplified example for including general non-linear constraints in the optimization.

A. Sea State Discretization
We consider the WaveBot deployed at the PacWave [29] location off the coast of Oregon, and use sea-state data from the National Oceanographic and Atmospheric Administration (NOAA) National Data Buoy Center (NDBC) buoy 46050 near that location [30].We obtain hourly omnidirectional spectra for full year periods from 1997-2021.This data was obtained and preprocessed using the MHKiT toolbox [31].To discretize the space of possible sea-states we first describe each spectrum S(ω) by its energy period T e and significant wave height H m0 .These statistical parameters are calculated for each 1-hour spectrum using the spectral moments, and removing outliers and corrupt data, as where m i is the i th spectral moment.The H m0 -T e space is divided into distinct sub-spaces using k-means clustering to group sea states with the same variance around a central sea state [32].The cluster center is used as representative sea-sate for the sub-space and the relative proportion of number of sea state samples in the sub-space is used as the probability associated with that subspace.For this demonstration we use ten sub-spaces to represent the sea-state, but for a more realistic study finer discretization is likely needed.The different sea state sub-spaces, their representative sea-state, and associated probability are shown in Fig. 6 and Table II.
For each representative sea state, a JONSWAP spectrum with a peak enhancement factor γ = 3.3 is generated and used to create a wave elevation time series.These spectra are illustrated in Fig. 7.The number of frequencies N ω = 127 and the largest frequency of 0.42 Hz were chosen as a compromise between resolution for the 10 wave spectra and computational speed.
For a given WEC and PTO design, the average annual power is obtained as a weighted average of the average electrical power P elec = v(t)i(t) from each sea state, as where s = (H m0 , T e ) is a specific sea state, v i (t) and i i (t) are the voltage and current for the specific case from (11), L and w i are the continuous and discrete probability associated with each sea state, and Δt, N t , T are the time step length, the number of time steps, and the simulation time, respectively.

B. Optimal PTO for Annual Power
A brute optimization study was done with the following 14 values of drive-train inertia and seven values of drive-train stiffness (98 designs total): The parameter space was refined after an initial, coarser, brute force optimization that covered a larger space.All other drivetrain parameters were kept as the nominal values shown in Table I.For each drive-train design and for each sea state, the optimal unstructured controller trajectory is found using the pseudo-spectral method as described in Section II using WecOptTool.The annual average power was then calculated for each drive-train design using (33).The resulting annual average powers for each design are shown in Fig. 8.The optimal configuration is achieved with M d = 24 kg m 2 , K d = −10 N m/rad, highlighted with the orange square in Fig. 8.The annual average electrical power generation for this optimal PTO design configuration with the optimal unstructured control is 1249 W. This is 22.0% greater than the nominal PTO design configuration (with optimal control for each sea state), for which the electrical power is 1024 W-this case is illustrated with a green square in Fig. 8.
In this study, we considered fixed inertia and fixed stiffness designs and allowed for negative stiffness.While negative stiffness is achievable in practice [33], [34], the requirement of additional components could be undesirable, e.g.under a more detailed study that optimizes for cost of energy.The results in Fig. 8 show that the nominal design can be significantly improved by simply increasing the drive-train inertia.Going in the other direction, tuneable rather than fixed inertia [35] and stiffness [33], [34] might provide sufficient improvement in power performance to be worth the additional components and complexity.
1) Time Series Results: In this section we present time domain results for Sea State A to illustrate the optimal state trajectories for electrical power for both the nominal and optimal designs.The graphs in Fig. 9 are shown over the first one minute for readability, but the pseudo-spectral method uses Fig. 10.Normalized excitation spectra (top) and (time-averaged) electrical power frequency components (bottom) for the optimal and nominal design configurations for sea state A. T = 2π/ω 0 ≈ 302 s as simulation end-time.Fig. 9(a) shows the wave excitation force (dotted) on the left y-axis and the WEC velocities for both the nominal and optimal PTO configurations on the right y-axis.In the optimal case, the velocity amplitude is generally higher compared to the nominal case, indicating that more wave energy is converted to kinetic energy.We also note that WEC velocities and excitation force are not in phase, as would be expected if we were optimizing for mechanical rather than electrical power.
Looking at Fig. 9(b) (optimal PTO) and Fig. 9(c) (nominal PTO) it becomes evident that instead the Thèvenin voltage (left y-axis, dotted) is mostly in phase with the PTO current (right y-axis).This is expected since the objective is to maximize the electrical, rather than mechanical, power.Although, the Thèvenin voltage is not directly implemented in the residual form in (1), it represents the excitation seen by the electric load.The phase matching for the optimal configuration is imperfect due to the PTO force constraint, which is met regularly as illustrated in Fig. 9(d).This effect is better illustrated in the frequency domain in the following section.In Fig. 9(b) (optimal PTO) and Fig. 9(c) (nominal PTO) we can also see that the amplitude of the Thèvenin equivalent voltage is generally higher for the optimal PTO design, demonstrating that by modifying the physical components of the PTO we can increase the excitation seen by the electric load.This is also better illustrated in the frequency domain.The bottom subplot in Fig. 9 shows the PTO forces for both the optimal PTO and nominal PTO, together with the PTO force limit which can be seen to be active frequently for the optimal PTO.
2) Frequency Domain Results: To comprehend how the altered PTO configuration impacts the full system response, it is convenient to illustrate the excitation spectra.Fig. 10 (top) shows the normalized excitation spectra, normalized by each spectrum's maximum, at different stages of the power conversion.First, the wave elevation variance spectrum (JONSWAP Fig. 11.Phase difference between Thèvenin voltage and the PTO current for the optimal and nominal design configurations for sea state A. spectrum) of sea state A is shown (dotted) which represents the sea state environment independent of the WEC device.Next, the excitation force spectrum (dash-dotted) is shown, which depends on both the incident waves and the hydrodynamic properties of the WEC, but is still independent of the PTO.Finally, the excitation as seen by the load can be represented by the Thèvenin voltage, which is shown for both the nominal (dashed) and optimal (solid) PTO configurations.We can see that through each energy conversion stage the excitation spectrum is widened (peak is less dominant), due to the frequency response of each conversion stage, which means that the available energy is spread over the frequency components.At first, this might seem counter-intuitive, since there is a trade-off between the accuracy of the impedance matching and the bandwidth to match.However, for the optimal PTO configuration the efficiency from wave to electromagnetic power is improved around the wave energy frequency, resulting in a higher absolute excitation for the load.The second excitation peak at higher frequency is not the reason for improved average electrical power.Fig. 10 (bottom) shows the average electrical power extracted at each frequency using (29) and compares it to the theoretical upper limit for the electrical power (24).The electrical power components for the nominal PTO match the theoretical maximum nearly perfectly.The electrical power components for the optimal PTO can be seen to often be lower than it's theoretical limit.This is due to the PTO force constraints being frequently active for the optimal PTO, as was shown in bottom subplot of Fig. 9.This is shown more clearly in Fig. 11, which shows the phase difference between Thèvenin voltage and PTO current.For the nominal configuration, these are nearly in phase, which results in the theoretical optimum power, while for the optimal PTO they are clearly somewhat out of phase.Even with a worse performance relative to it's theoretical limit, it is clear from Fig. 10 (bottom) that the optimum PTO significantly out-performs the nominal PTO.This improvement in extracted power over the nominal design was achieved by configuring the PTO so that it is better suited for the transfer of wave energy to electrical power, based on its intrinsic dynamics, using co-optimization.

C. Comments on Practical Control Implementation
One limitation of the practical applicability of the PTO codesign study with additional constraints is the non-causality of the optimal unstructured controller.A causal PI controller cannot be guaranteed to match the optimal solution for the irregular sea states but, over the limited frequency band of interest, a PI controller can be good approximation with about 90% efficiency for the linear case [4], [15].However, taking the PTO force constraint into account requires additional action.If the annual power study would have been performed with a prescribed PI-controller, the constant controller gains would have been optimized to respect the force constraint, by limiting the motion amplitude at all times and consequently negatively impacting the PI's performance.One practical approach, to utilize the results we gained on the optimal unstructured controller, while achieving causality, is to design a model predictive controller (MPC) that performs like the linear PI controller while the constraints are inactive via inverse matching, not requiring wave prediction [16].This approach is especially useful if the maximum power transfer is well-understood (i.e., the optimal unstructured controller can be found) to apply linear control theory and analysis for the unconstrained case and then simplify the MPC tuning and weight matrix calculation, informed by the optimal solution.The MPC design process accounts for constraints from the beginning and when the constraints are applied the MPC retains the impedance matching dynamics, while avoiding constraint violation, using short prediction horizons.Designing and implementing such a controller in WecOptTool is outside the scope of this study, but part of future work.

V. CONCLUSION
WecOptTool is a recently released code for control cooptimization of WECs and their PTOs with arbitrary constraints.This paper details the addition of PTO dynamics to the code and demonstrates a practical application of the tool.A case-study is performed to co-optimize mechanical parameters of the Wave-Bot PTO (drive-train inertia and stiffness) and the unstructured controller to maximize average annual electrical power.The power is investigated for all combinations of inertia and stiffness in relevant sea states for a potential deployment location.Time domain results are presented for the optimal mechanical PTO configuration in the most occurring sea state.
The optimal PTO design configuration improves electrical power absorption by 22% versus the nominal PTO design.This performance improvement is achieved using the numerical optimal control trajectory for drive-train with increased inertia and a negative finite stiffness, while limiting the PTO force via a constraint.The results give direct insights into the optimal PTO configuration, as well as more general understanding of design trade-offs, such as the balance between force magnitudes and power generation, that can be used by a designer.
WecOptTool is not limited to the specific problem of drivetrain co-optimization in a single degree of freedom, but can be applied to a wide range a WEC control co-design problems, including geometry optimization, kinematic optimization for multi degree of freedom simulations, PTO (e.g., generator winding impedance) optimization, array layout, and deployment location selection.Similarly, the code can handle arbitrary nonlinear constraints, and general non-linear forces, kinematics, and generator dynamics.This is achieved through a modular code architecture that implements the hydrodynamic forces and allows the user to supply their own arbitrary, linear or non-linear, additional forces and constraints directly.For instance, in this study we used a linear model, written as a matrix multiplication, for the additional PTO force.Similarly, the code constructs and solves the control (inner) optimization problem, but the user is free to specify the design (outer) optimization loop, which in this study was for the PTO drive-train parameters.

Fig. 1 .
Fig.1.Wave-to-wire model of the WaveBot illustrating the energy conversion chain and the main parameters driving the dynamics.The drive-train parameters are printed in black font and drive the mechanic power conversion.The generator and load parameters are printed in grey font and drive the electromagnetic and electrical energy conversion, respectively, with Z L as the load impedance.

Fig. 3 .
Fig.3.Thèvenin equivalent circuit for the two port combined WEC and PTO system.The equivalent circuit includes the buoy, drive-train, and generator.

Fig. 6 .Fig. 7 .
Fig. 6.Discretized sea state space using k-means clustering.All 1-hour sea states are shown for the 25 a period from 1997-2021.The center of each cluster is indicated with an 'x' mark.

Fig. 8 .
Fig.8.Annual electrical power generated with the WaveBot for different values of drive-train inertia and stiffness.The optimal configuration is the square with the solid orange edge with 1249 W annual average electrical power and the nominal configuration is the square with the dashed green edge with 1024 W annual average electrical power.

Fig. 9 .
Fig. 9. Time series results for optimal (M d = 24 kg m 2 , K d = −10 N m/rad) and nominal design configuration for sea state A.