WithinRelativeDomain2 model

Requirements.Examples.Elementary.ChecksInFixedWindow_withFFT.WithinRelativeDomain2  · source

Icon of WithinRelativeDomain2

Example for RelativeDomain block with two FFT computations (a rising condition input triggers an FFT calculation. The amplitudes of the FFTs must be below a frequency dependent limit that is defined relative to the amplitude of the base frequency)

Extends Modelica.Icons.Example

Using check block WithinRelativeDomain as

The amplitutes of the FFT are dynamically displayed in the icon of the block (in black), as well as the maximume amplitudes maxAmplitude (in red). The computed amplitude of the base frequency is shown in green (so this amplitude is 100 %). At the end of the simulation, one of the amplitudes is larger as allowed:

Simulating this examples results in

simulation result

As can be seen, the first FFT fulfills the check (scaledDistance = 0), whereas the second FFT has amplitudes that are larger as allowed (scaledDistance = -0.1).

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
fft_relativeDomain1Requirements.ChecksInFixedWindow_withFFT.WithinRelativeDomainFFT of u up to 6 Hz, resolution 0.2 Hz; the amplitudes relative to the 2 Hz base amplitude must stay below the maxAmplitude curve
sine2Modelica.Blocks.Sources.SineBase frequency: sine of amplitude 3 at 2 Hz
sine3Modelica.Blocks.Sources.SineSine of amplitude 1.5 at 3 Hz
constModelica.Blocks.Sources.ConstantConstant offset 3
sine5Modelica.Blocks.Sources.SineSine of amplitude 2 at 5 Hz, starting at 7 s
multiSumModelica.Blocks.Math.MultiSumSum of offset and sines: the analysed signal
booleanTableModelica.Blocks.Sources.BooleanTableCondition with rising edges at 1 s and 9 s: two FFT computations