Skip to content

Commit

Permalink
fixes startTime of ZeroOrderHold"
Browse files Browse the repository at this point in the history
This reverts commit e73d709.
  • Loading branch information
dietmarw committed Oct 7, 2022
1 parent e73d709 commit 39b0799
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Modelica/Blocks/Discrete.mo
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ package Discrete
extends Modelica.Icons.Package;

block Sampler "Ideal sampling of continuous signals"
extends Interfaces.DiscreteSISO;
extends Interfaces.DiscreteSISO(y(start=0, fixed=true));

equation
when {sampleTrigger, initial()} then
y = u;
y = if time>=startTime then u else pre(y);
end when;
annotation (
Icon(
Expand Down Expand Up @@ -44,7 +44,7 @@ via parameter <strong>samplePeriod</strong>.

equation
when {sampleTrigger, initial()} then
ySample = u;
ySample = if time>=startTime then u else pre(ySample);
end when;
/* Define y=ySample with an infinitesimal delay to break potential
algebraic loops if both the continuous and the discrete part have
Expand Down

0 comments on commit 39b0799

Please sign in to comment.