wecopttool.core
Core functionality for solving the pseudo-spectral problem for WEC.
Contains:
The WEC class
Functions for basic functionality
Note
All contents of this module are imported into WecOpTool and
can be called directly as wecopttool.<function>
instead of wecopttool.core.<function>
.
Classes
A wave energy converter (WEC) object for performing simulations using the pseudo-spectral solution method. |
Functions
Number of Fourier components ( |
|
Construct equally spaced frequency array. |
|
Assemble the time vector with |
|
Assemble the time matrix that converts the state to a time-series. |
|
Assemble the derivative matrix that converts the state vector of a response to the state vector of its derivative. |
|
Assemble the second derivative matrix that converts the state vector of a response to the state vector of its second derivative. |
|
Create a block matrix of the MIMO transfer function. |
|
Convert a vector back to a matrix with one column per DOF. |
|
Flatten a matrix that has one column per DOF. |
|
Convert from two real amplitudes to one complex amplitude per frequency. |
|
Convert from one complex amplitude to two real amplitudes per frequency. |
|
Convert a complex array of Fourier coefficients to a real array of time-domain responses. |
|
Convert a real array of time-domain responses to a complex array of Fourier coefficients. |
|
Read a NetCDF file with possibly complex entries as a |
|
Save an |
|
Ensure that the linear hydrodynamics (friction + radiation damping) have positive damping. |
|
Ensure that the real part of the impedance (resistive) is positive. |
|
Create a force function from its position transfer matrix. |
|
Create a force function from its impedance. |
|
Create a force function from waves excitation coefficients. |
|
Create the inertia "force" from the inertia matrix. |
|
Create functions for linear hydrodynamic forces. |
|
Run Capytaine for a range of frequencies and wave directions. |
|
Change the convention from \(-iωt\) to \(+iωt\). |
|
Add linear friction to BEM data. |
|
Calculate the complex, frequency-domain, excitation force due to waves. |
|
Calculate hydrodynamic intrinsic impedance. |
|
Ensure an array is at least 2D, otherwise add trailing dimensions to make it 2D. |
|
Convert a 1D array of angles in degrees to radians in the range \([-π, π)\) and optionally sort them. |
|
Check if the first set |
|
Create a scaling vector based on a different scale for each DOF. |
|
Split the state vector into the WEC dynamics state and the optimization (control) state. |
|
Return the fundamental frequency and the number of frequencies in a frequency array. |
|
Create a |
|
Sets default properties if not provided by the user: - center_of_mass is set to the geometric centroid - rotation_center is set to the center of mass |