WithinRelativeDomain1 model

Requirements.Examples.Elementary.ChecksInFixedWindow_withFFT.WithinRelativeDomain1  · source

Icon of WithinRelativeDomain1

Example for RelativeDomain block with one FFT computation (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 %)

Simulating this examples results in

simulation result

As can be seen, the simulation is terminate (via instance terminate1 of block FallingEdgeTerminate) once the FFT has been computed (signaled via the falling edge of FFT_computation). Since all FFT amplitudes between 0 ≤ f ≤ min(f_max, maxAmplitude[end,1]) are below the maximally allowed limit, the block returns Property.Satisfied.

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
fft_relativeDomain1Requirements.ChecksInFixedWindow_withFFT.WithinRelativeDomainFFT of u up to 4 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
multiSumModelica.Blocks.Math.MultiSumSum of offset and sines: the analysed signal
const1Requirements.Sources.BooleanConstantCondition, always true: one FFT at the start
terminate1Requirements.LogicalBlocks.FallingEdgeTerminateTerminates the simulation when the FFT computation has finished