# Calculating kWh from time series of kW

I have a time series of kW where each sample is measured at regular intervals (10 seconds). Could anyone explain to me how could I calculate the total power consumed (kWh) over an hour?

Thanks

• The total kWh is $\frac{1}{360}\sum_{n=1}^{360}p_n$, where the $p_n$ are the kW power measurements for each 10 second increment (assuming you are looking at a 1-hour interval). – DumpsterDoofus Apr 20 '14 at 23:54
• @DumpsterDoofus would this formula work if this is continuous data? – Martynas Apr 20 '14 at 23:59
• What does "continuous data" mean? In your question you said that it is being sampled at 10-second intervals, which is discrete, not continuous. – DumpsterDoofus Apr 21 '14 at 0:01
• @DumpsterDoofus I think it would really be better if you post your answer as an answer, not as a comment. – David Z Apr 21 '14 at 0:06
• @DumpsterDoofus well, what makes something an answer vs. a comment is not whether it's simple or not. It's a matter of whether it answers the question or not. There are many times when a valid answer is simple enough to be written in a comment and yet should still be posted as an answer. Another good rule of thumb: comments are temporary. Anything that is useful in the long term should be either edited into the question or posted as an answer. (BTW I will come back and clean up the comments here after the discussion is over.) – David Z Apr 21 '14 at 0:12

In general, if you have a list of datapoints $p_n$ for $n\in\{1,2,3,...,N\}$ sampled with timestep $\Delta t$, the integrated total $E$ is $$E=\Delta t\sum_{n=1}^{N}p_n.$$
For example, with data spaced 10 seconds apart, $\Delta t$ becomes $\frac{10\text{ sec}}{3600\text{ sec/hour}}\approx 0.0028$ hours. If you take 20 measurements (ie, 200 seconds recording), the integrated power in kWh becomes $$E=\frac{1}{360\text{ samples/hour}}\sum_{n=1}^{20}p_n$$ where $p_n$ are the instantaneous powers in kW.