Opened 18 years ago
Last modified 18 years ago
#99 closed defect (fixed)
Pb with Simulation of discrete event systems
Reported by: | Adrian Pop | Owned by: | Adrian Pop |
---|---|---|---|
Priority: | critical | Milestone: | |
Component: | Version: | ||
Keywords: | Cc: | Adrian Pop, haklu |
Description
Note:
See TracTickets
for help on using tickets.
block Timer "Timer measuring the time from the time instant where the
Boolean input became true"
extends Modelica.Blocks.Interfaces.partialBooleanBlockIcon;
Modelica.Blocks.Interfaces.BooleanInput u;
Modelica.Blocks.Interfaces.RealOutput y;
protected
discrete Modelica.SIunits.Time entryTime "Time instant when u became true";
initial equation
pre(entryTime)=0;
equation
when edge(u) then
entryTime=time;
end when;
y=if u then time - entryTime else 0.0;
end Timer;
In order to test it, I used the following step at time 6:
model Test_Timer
Modelica.Blocks.Sources.BooleanStep booleanStep(startTime=6);
Timer timer_int;
equation
connect(booleanStep.y,timer_int.u);
end Test_Timer;
The joined picture shows that the model reacted when its input is switched
to true but there is a problem in the result: a time impulse occurred at
time = 6.
Image is present at the URL