# Calculate power consumption that varies every second

We know that power consumption or Energy is

E = Power x Time


for utility billing, we used

E = kWatt x Hour


But I am not sure how to get the total Energy if we will based it per second having different power over a period of time.

0.5 Watt (time check 5:00:00 AM)
1.0 Watt  (time check 5:00:04 AM)
0.7 Watt  (time check 5:00:07 AM)
and so on.


Let say I wanted to calculate the energy from 5:00:00 AM - 5:00:07 AM

Is this the right calculation?

E1 =  0.5 x 4 = 2.0 Watt-sec
E2 =  1.0 x 3 = 3.0 Watt-sec
E3 =  0.7 x 1 = 0.7 Watt-sec

E1 + E2 + E3
2 + 3 + .7 = 5.7 Watt-sec
= .00158 Watt-Hr


I just want to know if my calculation is right. Thanks

• Yes, in principle, but there are 60 seconds in a minute, and the last minute doesn't exist. – Chu Nov 16 '15 at 17:11
• I was wrong on my previous time check. 5:00-5:07 supposed to be 5:00:00-5:00:07. I updated my post already – Jam Ville Nov 16 '15 at 17:38
• Energy is the area under the power vs. time graph. For example, a constant power of 0.5W for 4s, would give 2W s, or 2 joules. For a series of constant powers you add all the individual areas. If the power graph is not a series of constant-power segments then you can calculate the area by geometry (if the graph is piecewise linear) or by integration (if the equation of the graph is known). – Chu Nov 16 '15 at 18:05

If $P(t)=v(t)\cdot i(t)$ is the power, then the energy is

$E(t) = \int P(t)\,dt = \int v(t)\cdot i(t)\,dt$

The method that you apply is an approximation to the exact energy calculation.It depends on the accuracy you want in your results, if it helps or not.

If you look at integrating, it is formed by the product of voltage and current multiplied by $dt$. The time differential is an infinitesimal increase.
In your case, the time between samples are not infinitesimal, so you can expect an error on the value of energy calculated. If the interval between measurements is kept uniform, you are using the rectangular approximation to the solution of the integral. You should evaluate whether the results you get with the generated error is acceptable.

It is tricky to say as we do not know how your energy usage is being reported. It could be saying 0.5 watts is being used per second up until 5:04AM. Or it could be 0.5 watts being used per second up until 5:00AM. Or it could be 0.5 watts has been used up until then.

I see you have used the first one so following on from that it would be0.5 x 4 x 60 as the time difference is 4 minutes and your rate is per second. Then the final calculation would be as you have done.

As your energy usage is varying per second this will only provide an estimate of the exact amount you would need to use intergration to calculate more acurately.

• Thanks for the correction. I changed the time checked so it will be based on SECONDS – Jam Ville Nov 16 '15 at 17:32
• Then yes it is now correct, though possibly not as accurate as possible. – Stuart Rayner Nov 16 '15 at 17:53