Opened 4 years ago

Last modified 4 years ago

#6181 new defect

Boolean incorrectly evaluated and asserts, implying negative time? — at Initial Version

Reported by: craig.fletcher@… Owned by: somebody
Priority: high Milestone:
Component: Run-time Version: v1.17.0-dev
Keywords: Cc: Karim Adbdelhak

Description

The following asserts time is less than zero. Did not assert in previous versions of OMC

model DebugInitialValue

model BooleanPulse

input Real width(start=0.5);
output Boolean y;

equation

y = time < width;

end BooleanPulse;

class DayNightCycle

parameter Real earth_day_period=24;
Real daylight_ratio;
BooleanPulse daylight(width=daylight_ratio);

end DayNightCycle;

parameter Real ratio_start=0;
Real _ratio;
DayNightCycle cycle(daylight_ratio=_ratio); FAILS. Will work if changed to daylight_ratio=0 here.

algorithm

_ratio := ratio_start;
if not initial() then

assert(cycle.daylight.y==false,"oops",level=AssertionLevel.warning);

end if;

end DebugInitialValue;

Change History (0)

Note: See TracTickets for help on using tickets.