functiondampedSine

Return a damped sine chracteristic

Information

Syntax

(x,y) = Plot.Examples.Utilities.dampedSine(freqHz, damping, nPeriod=5, nPoints=500);

Description

This function computes nPoints points x[i], y[i] of a sine-curve

   y = exp(-x*damping)*sin(2*pi*freqHz*x)

where the abszissa values x[i] are in the range 0 .. nPeriod*T, where T = 1/freqHz is the period of the sine wave.

Example

With the default options and freqHz=2 Hz and damping=0.8, the following curve is generated:

Inputs

TypeNameDefaultDescription
Modelica.Units.SI.FrequencyfreqHzFrequency of sine wave
Modelica.Units.SI.DampingdampingDamping coefficient of sine wave
IntegernPeriod5Number of periods to show
IntegernPoints500Number of points

Outputs

TypeNameDefaultDescription
Real[nPoints]x
Real[nPoints]y