anorlunda said:
I think you want RMS root mean square. ... RMS works for any wave shape. Based on the original question, that is what you need.
I think the formula OP uses IS to calculate the mean power by finding the mean of the square of the current.
Because it is mean power being calculated, there is no root - P = R( I^2 ) or (V^2)/R
RMS voltage and current (not squared) are calculated from the root of the mean power.
Marvin94 said:
You have understood what is my problem. I don't get why I "only have to do 1/2 of a complete square wave or 1/4 of a triangle wave to get the correct result". Can you make this point clear to me?
With your AC wave, the instantaneous power in the resistance is varying as the voltage and current are varying - peak power when voltage or current are peak and zero power when they are zero. To find the DC equivalent - which is a constant voltage and current - we need to average over the whole cycle. Each complete cycle will be the same, because the variations in voltage and current are the same in each cycle.
So the general rule is to integrate the square of the voltage or current over one complete cycle. This will work for any wave shape. The squaring ensures that the positive and negative parts of the cycle do not cancel each other. Since power is proportional to the square of the current or voltage, we just divide by the length of the cycle to get the average power. And if you want the equivalent DC current or voltage, you need to take the square root of that average (mean) - what people call the root mean square or RMS value.
Now for waves with symmetry you MAY integrate over less than the whole cycle and average that.
##(\int_0^{360} \! sin^2(x) \, \mathrm{d}x)/1 = ## ##(\int_0^{180} \! sin^2(x) \, \mathrm{d}x)/2 = ## ##(\int_0^{90} \! sin^2(x) \, \mathrm{d}x)/4 ##
In fact you can do 1/4 cycle of sine, square or triangle wave and the average of the squared values is the same as over a complete cycle. So for these 3 waves it does not matter whether you use 1/4 , 1/2 or a complete cycle *provided* you start at the beginning of a cycle (or any 1/4 cycle) and the wave is symmetric with no DC component. This would not be true for less symmetric waves, such as a sawtooth or a mixture of harmonics.