.Modelica_LinearSystems2.Utilities.Plot.Examples.Utilities.dampedSine

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:

Interface

function dampedSine
  extends Modelica.Icons.Function;
  input Modelica.Units.SI.Frequency freqHz "Frequency of sine wave";
  input Modelica.Units.SI.Damping damping "Damping coefficient of sine wave";
  input Integer nPeriod = 5 "Number of periods to show";
  input Integer nPoints(min = 2) = 500 "Number of points";
  output Real x[nPoints];
  output Real y[nPoints];
end dampedSine;

Generated at 2024-11-21T19:25:40Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos