Opened 18 years ago

Last modified 14 years ago

#102 closed defect (invalid)

Boolean b = noEvent(x > 0) should generate an error.

Reported by: Adrian Pop Owned by: Adrian Pop
Priority: critical Milestone:
Component: Instantiation Version: 1.4.5
Keywords: Cc: Adrian Pop, haklu

Description

See comments.

Change History (2)

comment:1 by Adrian Pop, 18 years ago

assigning noEvent to discrete Boolean variables should generate an error.
--- ShouldFail.mo ---
model ShouldFail

Boolean b(start = false);
Real x(start = 0);

equation

x = time;
b = noEvent(x > 10);

end ShouldFail;

--- script ---
loadFile("ShouldFail.mo");
simulate(ShouldFail, stopTime = 20);
plot({x, b});

The ShouldFail model, should fail because noEvent has the return type
of Real and is assigned to Boolean.

Regards,
Adrian Pop/

comment:2 by Martin Sjölund, 14 years ago

I'm closing this as it is wrong.
noEvent() can return any type. What it does is make sure that any real relations inside this arbitrary expression does not generate events/zero-crossings.

Note: See TracTickets for help on using tickets.