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


Change History (4)

comment:1 by Adrian Pop, 18 years ago

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

comment:2 by Peter Aronsson, 18 years ago

Håkan, another testcase for events.

comment:3 by haklu, 18 years ago

Changed status on the wrong bug...

comment:4 by haklu, 18 years ago

No, it was the correct one... :)

Note: See TracTickets for help on using tickets.