This Mathcad file demonstrates how to calculate the root mean square value (RMS) by formula.
Step 1: Define sampling frequency (multiple of 2) and build a waveform with DC component.
N samples per cycle
Amplitudes, phase angles, and harmonic numbers of component frequencies.
Step 2: Perform the RMS calculation, resulting in amplitude plot.
Russell W. Patterson, P.E.
Manager, System Protection & Analysis
Tennessee Valley Authority
rwpatterson@tva.gov