RAO
- class mafredo.Rao[source]
RAO is a data-object for dealing with RAO-type data being:
amplitude [any] and
phase [radians]
as function of:
heading [degrees]
omega [rad/s]
This class is created to provide methods for the correct interpolation of this type of data which means:
the amplitude and phase are interpolated separately (interpolation of complex numbers result in incorrect amplitude)
continuity in heading is considered (eg: interpolation of heading 355 from heading 345 and 0)
An attribute “mode” is added which determine which mode is represented (surge/sway/../yaw) and is needed to determine how symmetry should be applied (if any). Why? Well, for heave it does not matter whether a wave comes from sb or ps, but for roll it does.
The amplitude and phase can physically be anything. But typically would be one of the following:
A motion RAO (result of frequency domain response calculation)
A force or moment RAO (result of diffraction analysis)
A response spectrum with relative phase angles (result of a motion RAO combined with a wave-spectrum)
It is suggested to define the wave_direction as the direction of wave propagation relative to the X-axis. So heading 90 is propagation along the y-axis.
Create:
Modify:
- apply_symmetry_xz()
Properties:
n_frequencies
omega
n_wave_directions
wave_directions
Get data:
['amplitude']to get amplitude as xarray['phase']to get phase as xarray['complex']to get complex rao['complex_unit']to get normalized complex raoPlotting:
For plotting just use xarray:
>>> my_rao['ampltiude'].plot()
others:
for netcdf:
anything from xarray. For example myrao[‘amplitude’].plot() or myrao[‘amplitude’].sel(wave_direction=180).values
Note For ease of interpolation the phase is stored internally as “complex_unit” which equals exp(1j*phase). This is a complex number with angle (phase) and amplitude 1. The relation bewteen these two is:
>>> phase = np.angle(cu) >>> cu = np.exp(phase *1j)