Root mean square

In mathematics, root mean square (abbreviated RMS or rms), also known as the quadratic mean, is a statistical measure of the magnitude of a varying quantity. It is especially useful when variates are positive and negative, e.g. waves.

It can be calculated for a series of discrete values or for a continuously varying function. The name comes from the fact that it is the square root of the mean of the squares of the values. It is a power mean with the power $$p=2$$.

Definition
$$x_\text{rms} = \sqrt{ \langle x^2 \rangle} \,\!$$ (where $$\langle \ldots \rangle$$ denotes the arithmetic mean)

Calculating the root mean square
The rms for a collection of $$n$$ values $$\{x_1,x_2,\dots,x_n\}$$ is



x_{\mathrm{rms}} = \sqrt {{1 \over n} \sum_{i=1}^{n} x_i^2} = \sqrt {{x_1^2 + x_2^2 + \cdots + x_n^2} \over n} $$

The corresponding formula for a continuous function $$f(t)$$ defined over the interval $$T_1 \le t \le T_2$$ is



f_{\mathrm{rms}} = \sqrt {{1 \over {T_2-T_1}} {\int_{T_1}^{T_2} {[f(t)]}^2\, dt}} $$

The rms of a periodic function is equal to the rms of one period of the function. The rms value of a continuous function or signal can be approximated by taking the rms value of a series of equally spaced samples.

Uses
The RMS value of a function is often used in physics and electrical engineering. For example, we may wish to calculate the power $$P$$ dissipated by an electrical conductor of resistance $$R$$. It is easy to do the calculation when a constant current $$I$$ flows through the conductor. It is simply:


 * $$P = I^2 R\,\!$$

But what if the current is a varying function $$I(t)$$? This is where the rms value comes in. It may be trivially shown that the rms value of $$I(t)$$ can be substituted for the constant current $$I$$ in the above equation to give the average power dissipation:
 * {| border=0 cellpadding=0 cellspacing=0


 * $$P_\mathrm{avg}\,\!$$
 * $$= \langle I^2R \rangle \,\!$$ (where $$\langle \ldots \rangle$$ denotes the arithmetic mean)
 * $$= R\langle I^2 \rangle\,\!$$ (R is constant so we can take it outside the average)
 * $$= I_\mathrm{rms}^2R\,\!$$ (by definition of RMS)
 * }
 * $$= R\langle I^2 \rangle\,\!$$ (R is constant so we can take it outside the average)
 * $$= I_\mathrm{rms}^2R\,\!$$ (by definition of RMS)
 * }
 * $$= I_\mathrm{rms}^2R\,\!$$ (by definition of RMS)
 * }

We can also show by the same method


 * $$P_\mathrm{avg} = {V_\mathrm{rms}^2\over R}\,\!$$

By taking the square root of both these equations and multiplying them together, we get the equation


 * $$P_\mathrm{avg} = V_\mathrm{rms}I_\mathrm{rms}\,\!$$

However, it is important to stress that this is based on the assumption that voltage and current are proportional (that is the load is resistive) and is not true in the general case (see AC power for more information).

In the common case of alternating current, when $$I(t)$$ is a sinusoidal current, as is approximately true for mains power. The rms value is easy to calculate from the continuous case equation above. If we define $$I_{\mathrm{p}}$$ to be the peak amplitude:


 * $$I_{\mathrm{rms}} = \sqrt {{1 \over {T_2-T_1}} {\int_{T_1}^{T_2} {(I_\mathrm{p}\sin(\omega t)}\, })^2 dt}\,\!$$

Since $$I_{\mathrm{p}}$$ is a positive real number:


 * $$I_{\mathrm{rms}} = I_\mathrm{p}\sqrt {{1 \over {T_2-T_1}} {\int_{T_1}^{T_2} {\sin^2(\omega t)}\, dt}}$$

Using a trigonomentric identity to eliminate squaring of trig function:


 * $$I_{\mathrm{rms}} = I_\mathrm{p}\sqrt {{1 \over {T_2-T_1}} {\int_{T_1}^{T_2} \, dt}}$$


 * $$I_{\mathrm{rms}} = I_\mathrm{p}\sqrt {{1 \over {T_2-T_1}} \left [ {{t \over 2} -{ \sin(2\omega  t) \over 4\omega}} \right ]_{T_1}^{T_2} }$$

but since the interval is a whole number of complete cycles (per definition of rms for a periodic function with $$\omega = \frac{2 \pi}{t}$$) the sin terms will cancel


 * $$I_{\mathrm{rms}} = I_\mathrm{p}\sqrt {{1 \over {T_2-T_1}} \left [ \right ]_{T_1}^{T_2} } = I_\mathrm{p}\sqrt {{1 \over {T_2-T_1}}  } = {I_\mathrm{p} \over {\sqrt 2}}$$

The peak amplitude $$I_\mathrm{p}$$ is half of the peak-to-peak amplitude $$I_\mathrm{p-p}$$. To use the peak-to-peak amplitude in the formula above simply replace $$I_\mathrm{p}$$ by $$I_\mathrm{p-p}/2$$.

The RMS value can be calculated using equation (2) for any waveform, for example an audio or radio signal. This allows us to calculate the mean power delivered into a specified load. For this reason, listed voltages for power outlets (e.g. 117 V or 230 V) are almost always quoted in RMS values, and not peak values.

From the formula given above, we can calculate also the peak-to-peak value of the mains voltage which is about 330 volts (USA) and 650 volts (Europe) respectively. For a pure sine wave, the peak voltage is 1.414 x RMS voltage; the peak-to-peak voltage is twice that.

It is possible to calculate the RMS power of a signal. By analogy with RMS voltage and RMS current, RMS power is the square root of the mean of the square of the power over some specified time period. This quantity, which would be expressed in units of watts (RMS), has no physical significance. However, the term "RMS power" is sometimes used in the audio industry as a synonym for "mean power" or "average power". For a discussion of audio power measurements and their shortcomings, see Audio power.

Root mean square velocity
In physics, the root mean square velocity is defined as the square root of the average velocity-squared of the molecules in a gas. The RMS velocity of an ideal gas is calculated using the following equation:


 * $${v_\mathrm{rms}} = {\sqrt{3RT \over {M}}}$$

where $$R$$ represents the ideal gas constant (in this case, 8.314 J/(mol&sdot;K)), $$T$$ is the temperature of the gas in kelvins, and $$M$$ is the molar mass of the compound in kilograms per mole. Note that the unit of mass is in kilograms per mole because the Joule is given in kilogram meters squared per second squared.

Relationship to the arithmetic mean and the standard deviation
If $$\bar{x}$$ is the arithmetic mean and $$\sigma_{x}$$ is the standard deviation of a population (the equation is different when $$\sigma_{x}$$ is for a sample) then:
 * $$x_{\mathrm{rms}}^2 = \bar{x}^2 + \sigma_{x}^2.$$

Here we can see that RMS is always greater than or equal to the average, in that the RMS includes the "error" / square deviation as well.

Indeed, assuming the values to be averaged are Pythagorean Triples (e.g. 3, 4, 5), the RMS value would be close to the arithmetic mean.

N.B.: Physical scientists often use the term root-mean-square as a synonym for standard deviation when they refer to the square root of the mean squared deviation of a signal from a given baseline or fit.