calculate electricity consumption