Integrate PD energy into 2d plot

- Also add tests and correction for negative half cycle