added method to calculate instantaneous power