How calculate three phase kilowatt hour from time sampled data [closed]

寵の児 提交于 2019-12-04 20:41:57

Numerical calculus to the rescue.


If you have several samples of voltage and current, then you also have that many samples of momentary power: P(t) = U(t) * I(t).

Now you have power and you have time, you can integrate the power with respect to time. A simple numeric approach is the trapezoidal rule. This question is tagged "Arduino" and I know C reasonably well so here's some pseudo-C that illustrates the technique:

int n_samples = 1000; // or however many samples you have
double integral = 0.0;
for (int i = 0; i < n_samples - 1; i++) {
    integral += (samples[i] + samples[i + 1]) / 2;
}

integral *= (t_max - t_min) / n;

Where t_min and t_max are the beginning and ending time of the sampling, respectively, n_samples is the number of samples you got, samples is an array (presumably of double or so) that contains the calculated momentary power values. integral will hold the result.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!