modelDemoSignalCharacteristic

Demonstrate characteristic values of a signal

Extends from Modelica.Icons.Example (Icon for runnable examples).

Information

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

TypeNameDefaultDescription
Realapp1Peak-to-peak value of pulse signal
RealdutyCycle0.5Duty cycle of pulse signal
Realoffset0Offset of pulse signal
Modelica.Units.SI.Frequencyf50Base frequency of pulse signal
Realy_meanoffset + app*dutyCycleMean value
Realy_rectabs(offset + app)*dutyCycle + abs(offset)*(1 - dutyCycle)Rectified mean
Realy_rmssqrt((offset + app)^2*dutyCycle + offset^2*(1 - dutyCycle))Root mean square
Realy1_cos((offset + app)*(sin(dutyCycle*2*pi) - sin(0)) + offset*(sin(2*pi) - sin(dutyCycle*2*pi)))/pi/sqrt(2)First harmonic cosine rms component
Realy1_sin((offset + app)*(-cos(dutyCycle*2*pi) + cos(0)) + offset*(-cos(2*pi) + cos(dutyCycle*2*pi)))/pi/sqrt(2)First harmonic sine rms component
Realy1_rmssqrt(y1_cos^2 + y1_sin^2)RMS value of first harmonic
Realy1_argatan2(y1_sin, y1_cos)Argument of first harmonic

Components

TypeNameDefaultDescription
Realypulse.yInvestigated pulse signal
Sources.Pulsepulse
Math.Meanmean
Math.RectifiedMeanrectifiedMean
Math.RootMeanSquarerootMeanSquare
Math.Harmonicharmonic