From daca39efb58e0fc2b22a856b9bdeb3a445d3be54 Mon Sep 17 00:00:00 2001 From: HOS Date: Tue, 13 Jun 2023 14:14:44 +0200 Subject: [PATCH] Add smooth. --- Modelica/Blocks/Sources.mo | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Modelica/Blocks/Sources.mo b/Modelica/Blocks/Sources.mo index c07ca4081d..4a4709796d 100644 --- a/Modelica/Blocks/Sources.mo +++ b/Modelica/Blocks/Sources.mo @@ -122,7 +122,7 @@ variable y is both a variable and a connector. extends Interfaces.SignalSource; equation - y = offset + (if time < startTime then 0 else time - startTime); + y = offset + smooth(1, (if time < startTime then 0 else time - startTime)); annotation ( Icon(coordinateSystem( preserveAspectRatio=true, @@ -207,7 +207,7 @@ The Real output y is a constant signal: extends Interfaces.SignalSource; equation - y = offset + (if time < startTime then 0 else height); + y = offset + smooth(1, (if time < startTime then 0 else height)); annotation ( Icon(coordinateSystem( preserveAspectRatio=true, @@ -296,8 +296,8 @@ If parameter duration is set to 0.0, the limiting case of a Step signal is achie parameter SI.Angle phase=0 "Phase of sine wave"; extends Interfaces.SignalSource; equation - y = offset + (if time < startTime then 0 else amplitude*Modelica.Math.sin(2 - *pi*f*(time - startTime) + phase)); + y = offset + smooth(1, (if time < startTime then 0 else amplitude*Modelica.Math.sin(2 + *pi*f*(time - startTime) + phase))); annotation ( Icon(coordinateSystem( preserveAspectRatio=true,