wecopttool.frequency

frequency(f1, nfreq, zero_freq=True)[source]

Construct equally spaced frequency array.

The array includes 0 and has length of nfreq+1. f1 is fundamental frequency (1st harmonic).

Returns the frequency array, e.g., freqs = [0, f1, 2*f1, ..., nfreq*f1].

If zero_freq = False (not default), the mean (DC) component 0 is excluded, and the vector length is reduced by 1.

Parameters:
  • f1 (float) – Fundamental frequency f1 [\(Hz\)].

  • nfreq (int) – Number of frequencies.

  • zero_freq (bool | None) – Whether to include the zero-frequency.

Return type:

ndarray