Opened 12 years ago
Closed 12 years ago
#1960 closed defect (fixed)
Modelica.blocks.sources.pulse wrong simulation results
Reported by: | bruno | Owned by: | wbraun |
---|---|---|---|
Priority: | high | Milestone: | 1.9.0 |
Component: | Backend | Version: | trunk |
Keywords: | event handling | Cc: |
Description
In some cases the Modelica.blocks.sources.pulse model has wrong output, the square wave stops evolving after two periods and the output keeps stuck to zero.
See the output "pulse.y" of attached model, the signal should be a square vawe until the end of simulation
Attachments (1)
Change History (6)
Changed 12 years ago by bruno
comment:1 Changed 12 years ago by cschubert
- Owner changed from probably noone to wbraun
- Status changed from new to assigned
It seems to be connected to event handling. Internally the pulse relies on the following when statement
when integer((time - startTime)/period) > pre(count) then count = pre(count)+1; T_start = time; end when;
According to -lv LOG_EVENTS the when condition becomes true but never changes back to false. Thus the when is not fired again.
However, the when condition should become false immediately afterwards, since the variable count is modified inside the when equation.
comment:2 Changed 12 years ago by adrpo
This might also be connected with #1959 where it said that "Yesterday the sawtooth block worked, today it runs amok".
comment:3 Changed 12 years ago by wbraun
- Keywords event handling added
- Status changed from assigned to accepted
comment:4 Changed 12 years ago by wbraun
and both models stopped working with MSL3.2.1, because the models changed from a sample when equation to the one above.
comment:5 Changed 12 years ago by wbraun
- Resolution set to fixed
- Status changed from accepted to closed
fixed in r14197.
Simple model with wrong behaviour