WithinRelativeDomain1 model
Requirements.Examples.Elementary.ChecksInFixedWindow_withFFT.WithinRelativeDomain1
· source
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
| 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. |
Components and variables
| Name | Type | Description |
|---|---|---|
fft_relativeDomain1 | Requirements.ChecksInFixedWindow_withFFT.WithinRelativeDomain | FFT 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 |
sine2 | Modelica.Blocks.Sources.Sine | Base frequency: sine of amplitude 3 at 2 Hz |
sine3 | Modelica.Blocks.Sources.Sine | Sine of amplitude 1.5 at 3 Hz |
const | Modelica.Blocks.Sources.Constant | Constant offset 3 |
multiSum | Modelica.Blocks.Math.MultiSum | Sum of offset and sines: the analysed signal |
const1 | Requirements.Sources.BooleanConstant | Condition, always true: one FFT at the start |
terminate1 | Requirements.LogicalBlocks.FallingEdgeTerminate | Terminates the simulation when the FFT computation has finished |


