MaxTotalHarmonicDistortion1 model

Requirements.Examples.Elementary.ChecksInFixedWindow_withFFT.MaxTotalHarmonicDistortion1  · source

Icon of MaxTotalHarmonicDistortion1

Example for MaxTotalHarmonicDistortion block with one FFT computation (a rising condition input triggers an FFT calculation. The Total Harmonic Distortion (THD) of the FFTs must be below the given limit)

Extends Modelica.Icons.Example

Using check block MaxTotalHarmonicDistortion as

The amplitutes of the FFT are dynamically displayed in the icon of the block (in black). The computed amplitude of the base frequency is shown in green:

Simulating this examples results in

simulation result

A plot of the FFT result file is shown in the next figure:

Revisions

DateDescription
Nov. 29, 2015Initial version implemented by Martin R. Kuhn and Martin Otter (DLR Institute of System Dynamics and Control)
The research leading to these results has received funding from the European Union’s Seventh Framework Programme (FP7/2007-2016) for the Clean Sky Joint Technology Initiative under grant agreement no. CSJU-GAM-SGO-2008-001.

Components and variables

NameTypeDescription
maxTHD1Requirements.ChecksInFixedWindow_withFFT.MaxTotalHarmonicDistortionFFT of u with base frequency 2 Hz; the total harmonic distortion must stay below THDmax
sine1Modelica.Blocks.Sources.SineFundamental: sine of amplitude 3 at 2 Hz
sine2Modelica.Blocks.Sources.SineSecond harmonic: amplitude 0.2 at 4 Hz
constModelica.Blocks.Sources.ConstantConstant offset 2.5
multiSumModelica.Blocks.Math.MultiSumSum of offset, fundamental and harmonics: the analysed signal
const1Requirements.Sources.BooleanConstantCondition, always true: one FFT at the start
sine3Modelica.Blocks.Sources.SineThird harmonic: amplitude 0.15 at 6 Hz
sine4Modelica.Blocks.Sources.SineFourth harmonic: amplitude 0.1 at 8 Hz
sine5Modelica.Blocks.Sources.SineFifth harmonic: amplitude 0.08 at 10 Hz