Main Content

Harmonic Analysis of a Three-Phase Rectifier

This example shows how to use functions which analyze Simscape™ logging data to get harmonic magnitudes, calculate total harmonic distortion percentage and plot harmonic magnitudes. The model to which this analysis is applied is of a three-phase rectifier. The functions demonstrated are:

  • ee_getHarmonics

  • ee_calculateThdPercent

  • ee_plotHarmonics

Open Model

Open the model.

Specification of Parameters


  • Rated AC voltage, $V_{Rated} \rm{V}$

  • Rated AC frequency, $F_{Rated} \rm{Hz}$

  • AC real power load, $P_{AC} \rm{W}$

  • DC real power load, $P_{DC} \rm{W}$

  • Total apparent power, $S_{Rated} \rm{VA}$

For the test circuit, the AC load is set to consume 5MW, and the DC load is set to consume approximately 5MW.

Calculate Source Impedance


  • X/R Ratio, $XR$

  • Per-unit impedance, $Z_{pu}$

  • Per-unit base impedance, $Z_{base}$

  • Per-unit base inductance, $L_{base}$

  • Source series resistance, $R_{series} \rm{\Omega}$

  • Source series inductance, $L_{series} \rm{H}$

Calculate DC Resistance


  • Average DC voltage calculated neglecting losses, $V_{DC} \rm{V}$

  • DC resistance, $R_{DC} \rm{\Omega}$

(Consult appendix for derivation of equations)

DC resistance required to draw 5000000 W on DC side = 6.3123 Ohm

Use Parameters in Simscape Model

The parameters calculated can now be used in a Simscape model, SixPulseHarmonics. Once simulated, the model is set to create a Simscape logging variable, simlog_SixPulseHarmonics.

Obtain Harmonic Data

Details of harmonic order, harmonic magnitude and fundamental frequency can be obtained from a Simscape logging variable using the ee_getHarmonics function.

Calculate Peak Fundamental Value

The peak value of fundamental can be extracted.

Peak value of fundamental = 1945.806 A

Remove Small Harmonics

Find and keep harmonics which are greater than one thousandth of fundamental.

Display Tabular Harmonic Data

Harmonic data can be contained in a MATLAB® table.

harmonicTable =

  10x4 table

    Order    Magnitude     RMS      Percentage
    _____    _________    ______    __________

      1       1945.8      1375.9         100  
      5       218.86      154.75      11.248  
      7       105.83      74.835       5.439  
     11       85.135        60.2      4.3753  
     13       57.599      40.729      2.9602  
     17       50.417       35.65      2.5911  
     19       37.612      26.596       1.933  
     23       33.859      23.942      1.7401  
     25       26.507      18.743      1.3622  
     29       23.979      16.955      1.2323  

Total Harmonic Distortion

Calculate Total Harmonic Distortion (THD) percentage from harmonic data using the ee_calculate_ThdPercent function.

Total Harmonic Distortion percentage = 14.1721 %

Plot Harmonics

The harmonic data could be plotted from the harmonic data using the MATLAB bar function. For convenience the ee_plotHarmonics function plots a bar chart directly from the Simscape logging variable.


This example shows how to use three functions which are callable from the MATLAB command line. The functions analyze Simscape logging data to get harmonic magnitudes, calculate total harmonic distortion percentage and plot harmonic magnitudes.

Results from Real-Time Simulation

This model has been tested on a Speedgoat Performance real-time target machine with an Intel® 3.5 GHz i7 multi-core CPU. This model can run in real time with a step size of 20 microseconds.

Appendix - Equations for Calculation of DC Resistance Value

The relationship between peak AC input, $V_P$, and average DC output, $V_{DC}$, of a three-phase rectifier, neglecting losses, can be calculated as follows:

$V_{DC}=\frac{1}{2\pi/6} \int_{2\pi/3}^{\pi/3} \sqrt{3} V_P \,\mathrm{sin}(\omega t) \,\mathrm{d}(\omega t)$

$V_{DC}=\frac{3\sqrt{3}}{\pi} V_P$

As the relationship between the rated voltage (line-line RMS), $V_{Rated}$, and peak phase voltage, $V_P$, is:

$V_P = \frac{\sqrt{2}}{\sqrt{3}} V_{Rated}$

The relationship between rated AC voltage and average DC voltage is:

$V_{DC}=\frac{3\sqrt{2}}{\pi} V_{Rated}$

The resistance, $R$ required to draw a particular power, $P$, is:

$R = \frac{V_{DC}^2}{P}$