wecopttool.WEC.post_process
- WEC.post_process(wec, res, waves, nsubsteps=1)[source]
Post-process the results from
wecopttool.WEC.solve().- Parameters:
wec (WEC) –
wecopttool.WECobject.res (OptimizeResult | Iterable) – Results produced by
wecopttool.WEC.solve().waves (DataArray) –
xarray.DataArraywith the structure and elements shown bywecopttool.waves.nsubsteps (int | None) – Number of steps between the default (implied) time steps. A value of
1corresponds to the default step length.
- Returns:
results_fd – Dynamic responses in the frequency-domain.
results_td – Dynamic responses in the time-domain.
- Return type:
tuple[Dataset, Dataset]
Examples
The
wecopttool.WEC.solve()method only returns the raw results dictionary produced byscipy.optimize.minimize().>>> res_opt = wec.solve(waves=waves, obj_fun=pto.average_power, nstate_opt=2*nfreq+1)
To get the post-processed results we may call
>>> res_wec_fd, res_wec_td = wec.post_process(wec, res_opt,wave)
Note that
wecopttool.WEC.solve()method produces a list of results objects (one for each phase realization).