wecopttool.core.decompose_state

decompose_state(state, ndof, nfreq)[source]

Split the state vector into the WEC dynamics state and the optimization (control) state.

The WEC dynamics state consists of the Fourier coefficients of the position of each degree of freedom. The optimization state depends on the chosen control states for the problem.

Parameters:
  • state (ndarray) – Combined WEC and optimization states.

  • ndof (int) – Number of degrees of freedom for the WEC dynamics.

  • nfreq (int) – Number of frequencies.

Returns:

  • state_wec – WEC state vector.

  • state_opt – Optimization (control) state.

Return type:

tuple[ndarray, ndarray]