Calculation of electricity