How to calculate the battery discharge power diagram