power consumption calculation