From c02e180bc614d91af4610cdcad7eafb57c200068 Mon Sep 17 00:00:00 2001 From: Anton Haumer Date: Wed, 14 Dec 2022 20:12:12 +0100 Subject: [PATCH] enhanced documentation --- Modelica/Blocks/Sources.mo | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Modelica/Blocks/Sources.mo b/Modelica/Blocks/Sources.mo index 7d7f4c8253..5ef93247fe 100644 --- a/Modelica/Blocks/Sources.mo +++ b/Modelica/Blocks/Sources.mo @@ -768,7 +768,9 @@ by a falling exponential signal: count := integer((time - startTime)/period); T_start := startTime + count*period; equation + //The following formulation causes a state event //when integer((time - startTime)/period) > pre(count) then + //A formulation causing a time event is more efficient: when time >= (pre(count) + 1)*period + startTime then count = pre(count) + 1; T_start = time; @@ -824,7 +826,9 @@ The Real output y is a pulse signal: count := integer((time - startTime)/period); T_start := startTime + count*period; equation + //The following formulation causes a state event //when integer((time - startTime)/period) > pre(count) then + //A formulation causing a time event is more efficient: when time >= (pre(count) + 1)*period + startTime then count = pre(count) + 1; T_start = time; @@ -890,7 +894,9 @@ The Real output y is a saw tooth signal: count := integer((time - startTime)/period); T_start := startTime + count*period; equation + //The following formulation causes a state event //when integer((time - startTime)/period) > pre(count) then + //A formulation causing a time event is more efficient: when time >= (pre(count) + 1)*period + startTime then count = pre(count) + 1; T_start = time;