Skip to content

Commit

Permalink
ExpSine is more complicated.
Browse files Browse the repository at this point in the history
  • Loading branch information
HansOlsson committed Jun 13, 2023
1 parent daca39e commit e2d7014
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions Modelica/Blocks/Sources.mo
Expand Up @@ -660,18 +660,11 @@ The Real output y is a sinc signal: <code> amplitude*(sin(2*&pi;*f*t))/((2*&pi;*
parameter SI.Angle phase=0 "Phase of sine wave";
parameter SI.Damping damping(start=1)
"Damping coefficient of sine wave";
parameter Boolean continuous = false "If we want a smooth signal, the output will start at offset + amplitude";
extends Interfaces.SignalSource;
equation
if continuous then
y = offset + amplitude*smooth(1, (if time < startTime then 1 else Modelica.Math.exp(-
(time - startTime)*damping)*Modelica.Math.sin(2*pi*f*(time -
startTime) + phase)));
else
y = offset + (if time < startTime then 0 else amplitude*Modelica.Math.exp(-
(time - startTime)*damping)*Modelica.Math.sin(2*pi*f*(time -
startTime) + phase));
end if;
y = offset + (if time < startTime then 0 else amplitude*Modelica.Math.exp(-
(time - startTime)*damping)*Modelica.Math.sin(2*pi*f*(time -
startTime) + phase));
annotation (
Icon(coordinateSystem(
preserveAspectRatio=true,
Expand Down

0 comments on commit e2d7014

Please sign in to comment.