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.WEC
object.res (OptimizeResult | Iterable) – Results produced by
wecopttool.WEC.solve()
.waves (Dataset) –
xarray.Dataset
with the structure and elements shown bywecopttool.waves
.nsubsteps (int | None) – Number of steps between the default (implied) time steps. A value of
1
corresponds 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[list[Dataset], list[Dataset]]
Examples
The
wecopttool.WEC.solve()
method only returns the raw results dictionary produced byscipy.optimize.minimize()
.>>> res_opt = wec.solve(waves=wave, 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).