We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 07612fb + 39b0799 commit 7051091Copy full SHA for 7051091
1 file changed
Modelica/Blocks/Discrete.mo
@@ -5,11 +5,11 @@ package Discrete
5
extends Modelica.Icons.Package;
6
7
block Sampler "Ideal sampling of continuous signals"
8
- extends Interfaces.DiscreteSISO;
+ extends Interfaces.DiscreteSISO(y(start=0, fixed=true));
9
10
equation
11
when {sampleTrigger, initial()} then
12
- y = u;
+ y = if time>=startTime then u else pre(y);
13
end when;
14
annotation (
15
Icon(
@@ -44,7 +44,7 @@ via parameter <strong>samplePeriod</strong>.
44
45
46
47
- ySample = u;
+ ySample = if time>=startTime then u else pre(ySample);
48
49
/* Define y=ySample with an infinitesimal delay to break potential
50
algebraic loops if both the continuous and the discrete part have
0 commit comments