modelTotalHarmonicDistortion

Calculation of total harmonic distortion of voltage

Extends from Modelica.Icons.Example (Icon for runnable examples).

Information

This example compares the result of the total harmonic distortion (THD) with respect to the fundamental wave and with respect to the total root mean square (RMS). In this simulation model a non-sinusoidal voltage wave form is created by the superposition two voltage waves:

  • Fundamental wave with RMS voltage V1 and frequency f1
  • Third harmonic wave with RMS voltage V3 and frequency 3*f1

This simulation model compares numerically determined THD values with results, obtained by theoretical calculations:

  • Compare the numerically determined THD value thd1.y and the theoretical value THD1, both with respect to the fundamental wave; also plot thd1.valid
  • Compare the numerically determined THD value thdRMS.y and the theoretical value THDrms, both with respect to the RMS value; also plot thdRMS.valid

Parameters

TypeNameDefaultDescription
SI.Frequencyf150Fundamental wave frequency
SI.VoltageV1100Fundamental wave RMS voltage
SI.VoltageV320Third harmonic wave RMS voltage
RealTHD1V3/V1Theoretically obtained THD with respect to fundamental wave
RealTHDrmsV3/sqrt(V1^2 + V3^2)Theoretically obtained THD with respect to RMS

Components

TypeNameDefaultDescription
Modelica.Electrical.Analog.Basic.Groundground
Modelica.Electrical.Analog.Sources.SineVoltagesineVoltage3
Modelica.Electrical.Analog.Sources.SineVoltagesineVoltage1
Modelica.Electrical.Analog.Sensors.VoltageSensorvoltageSensor
Modelica.Blocks.Math.TotalHarmonicDistortionthd1
Modelica.Blocks.Math.TotalHarmonicDistortionthdRMS