Which is the correct approach to determine the total power loss in a wire with a given harmonic spectrum:
Approach A:
$$ P = \sum_{i=0}^n (i_{n, RMS}^2 \times R_{n})$$
Approach B:
$$ P = i_{total, RMS}^{2} \times R_{weighted} = \frac 1 {2\pi} \int_{0}^{{2\pi}} (i(t)_{1} + i(t)_{2} + ... + i(t)_{n})^{2}dt \times R_{weighted} $$
where
$$ R_{n} \equiv resistance \space of \space wire \space for \space harmonics \space order \space n $$ $$ R_{weighted} \equiv weighted \space wire \space resistance \space for \space all \space harmonic \space orders $$ $$ i_{n, RMS} \equiv root \space mean \space square \space for \space harmonics \space order \space n $$ $$ i(t)_{n} \equiv sinusoidal \space function \space for \space current \space for \space harmonics \space order \space n $$
I've noticed that approach A is the accepted way to calculate the total power loss from harmonics, however, it seems very wrong. What it's doing is finding the power loss for each frequency individually and then adding them. The problem I see with this is that the total RMS value of current is not the sum of individual RMS current values, but rather the RMS of the sum of individual currents. The RMS of a sinusoidal function is:
$$ i_{RMS} = \sqrt { \frac 1 {2\pi} \int_{0}^{{2\pi}} i(t)^{2}dt } $$
And therefore the RMS of a distorted current would be:
$$ i_{RMS} = \sqrt { \frac 1 {2\pi} \int_{0}^{{2\pi}} (i(t)_{1} + i(t)_{2} + ... + i(t)_{n})^{2}dt } $$
Is approach A used because it's simpler and conservative? It will always return a larger RMS current than approach B. am I missing something here? Every resource, including research papers, use approach A. I'm baffled by this...
Edit
I built a python script of a simple harmonic spectrum. The fundamental frequency is 1 Hz @ 1 A magnitude (blue) and the 2nd order harmonic is 2 Hz @ 0.5 A magnitude (orange). The summation of these two frequencies is the green wave. The script plots the waves, then does a discretized integration to get the RMS value. See the script and results below.
import numpy
import matplotlib.pyplot as plt
def func(t, w, a):
return a*numpy.sin(w*t)
t1 = 0
t2 = 2*numpy.pi
f = 1/(t2 - t1)
# array of time values (from 0 to 2*pi)
t = numpy.linspace(t1, t2, 10000)
# current values # 1 (amplitude = 1, angular freq = 1)
w = 2*numpy.pi*f
a = 1.0
i1 = func(t, w, a)
plt.plot(t, i1)
# current values # 2 (amplitude = 0.5, angular freq = 2) [2nd order harmonic @ 50% fundamental]
w *= 2
a /= 2
i2 = func(t, w, a)
plt.plot(t, i2)
plt.plot(t, i1 + i2)
# dt (time step)
step = (t2 - t1)/10000
# integral of # 1 current squared
int1 = numpy.sum(numpy.power(i1, 2))*step
# RMS of # 1 current
rms1 = numpy.sqrt(int1/(t2 - t1))
print(f'Calc. # 1 current RMS: {rms1:.4f} ... Analytical # 1 current RMS: {1/numpy.sqrt(2):.4f}')
# integral of # 2 current squared
int2 = numpy.sum(numpy.power(i2, 2))*step
# RMS of # 2 current
rms2 = numpy.sqrt(int2/(t2 - t1))
print(f'Calc. # 2 current RMS: {rms2:.4f} ... Analytical # 2 current RMS: {0.5/numpy.sqrt(2):.4f}')
int3 = numpy.sum(numpy.power(i1 + i2, 2))*step
rms3 = numpy.sqrt(int3/(t2 - t1))
rms = numpy.sqrt(numpy.power(rms1, 2) + numpy.power(rms2, 2))
print(f'Calc. total current RMS: {rms3:.4f} ... Analytical total current RMS: {rms:.4f}')
plt.show()
The output:
Calc. # 1 current RMS: 0.7071 ... Analytical # 1 current RMS: 0.7071
Calc. # 2 current RMS: 0.3535 ... Analytical # 2 current RMS: 0.3536
Calc. total current RMS: 0.7905 ... Analytical total current RMS: 0.7905
The calculated RMS currents are equal to the analytical solutions. So it turns out they are both correct. The math works out such that
$$ \sum_{i=0}^{n} (i_{n, RMS}^2) = \frac 1 {T} \int_{0}^{{T}} (i(t)_{1} + i(t)_{2} + ... + i(t)_{n})^{2}dt $$