modelMaxTotalHamonicDistortion1

Example for MaxTotalHamonicDistortion 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 from Modelica.Icons.Example (Icon for runnable examples).

Information

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:

Components

TypeNameDefaultDescription
Modelica_Requirements.ChecksInFixedWindow_withFFT.MaxTotalHarmonicDistortionmaxTHD1
Modelica.Blocks.Sources.Sinesine1
Modelica.Blocks.Sources.Sinesine2
Modelica.Blocks.Sources.Constantconst
Modelica.Blocks.Math.MultiSummultiSum
Modelica_Requirements.Sources.BooleanConstantconst1
Modelica.Blocks.Sources.Sinesine3
Modelica.Blocks.Sources.Sinesine4
Modelica.Blocks.Sources.Sinesine5

Revisions

Date Description
Nov. 29, 2015 Initial 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.