wecopttool.pto.PTO.post_process

PTO.post_process(wec, res, waves=None, nsubsteps=1)[source]

Transform the results from optimization solution to a form that the user can work with directly.

Examples

The wecopttool.WEC.solve() method only returns the raw results dictionary produced by scipy.optimize.minimize().

>>> res_opt = wec.solve(waves=wave,
                        obj_fun=pto.average_power,
                        nstate_opt=2*nfreq+1)

To get the post-processed results for the wecopttool.pto.PTO, you may call

>>> res_pto_fd, res_pto_td = pto.post_process(wec,res_opt[0],wave)

For smoother plots, you can set nsubsteps to a value greater than 1.

>>> res_pto_fd, res_pto_td = pto.post_process(wec,res_opt,
                                              nsubsteps=4)
>>> res_pto_td[0].power.plot()
Parameters:
Returns:

Return type:

tuple[list[Dataset], list[Dataset]]