WOLFRAM SYSTEM MODELER

DemoSignalCharacteristic

Demonstrate characteristic values of a signal

Diagram

Wolfram Language

In[1]:=
SystemModel["Modelica.Blocks.Examples.DemoSignalCharacteristic"]
Out[1]:=

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

This example demonstrates how to calculate characteristic values of the pulse signal y

Characteristic quantity Numerically calculated Analytically calculated
Mean mean.y y_mean
Rectified mean rectifiedMean.y y_rect
Root mean square rootMeanSquare.y y_rms
First harmonic harmonic.y_rms
harmonic.y_arg
y1_rms
y1_arg

The output of these blocks is updated after each period of the signal.

Using a simple pulse series, these values can be calculated analytically. Propagating these values as initial values for the output, we can compare the numerical solution with the analytical solution: The output is constant from the beginning.

Parameters (11)

app

Value: 1

Type: Real

Description: Peak-to-peak value of pulse signal

dutyCycle

Value: 0.5

Type: Real

Description: Duty cycle of pulse signal

offset

Value: 0

Type: Real

Description: Offset of pulse signal

f

Value: 50

Type: Frequency (Hz)

Description: Base frequency of pulse signal

y_mean

Value: offset + app * dutyCycle

Type: Real

Description: Mean value

y_rect

Value: abs(offset + app) * dutyCycle + abs(offset) * (1 - dutyCycle)

Type: Real

Description: Rectified mean

y_rms

Value: sqrt((offset + app) ^ 2 * dutyCycle + offset ^ 2 * (1 - dutyCycle))

Type: Real

Description: Root mean square

y1_cos

Value: ((offset + app) * (sin(dutyCycle * 2 * pi) - sin(0)) + offset * (sin(2 * pi) - sin(dutyCycle * 2 * pi))) / pi / sqrt(2)

Type: Real

Description: First harmonic cosine rms component

y1_sin

Value: ((offset + app) * (-cos(dutyCycle * 2 * pi) + cos(0)) + offset * (-cos(2 * pi) + cos(dutyCycle * 2 * pi))) / pi / sqrt(2)

Type: Real

Description: First harmonic sine rms component

y1_rms

Value: sqrt(y1_cos ^ 2 + y1_sin ^ 2)

Type: Real

Description: RMS value of first harmonic

y1_arg

Value: atan2(y1_sin, y1_cos)

Type: Real

Description: Argument of first harmonic

Components (5)

pulse

Type: Pulse

Description: Generate pulse signal of type Real

mean

Type: Mean

Description: Calculate mean over period 1/f

rectifiedMean

Type: RectifiedMean

Description: Calculate rectified mean over period 1/f

rootMeanSquare

Type: RootMeanSquare

Description: Calculate root mean square over period 1/f

harmonic

Type: Harmonic

Description: Calculate harmonic over period 1/f