Opened 16 years ago

Last modified 14 years ago

#1057 closed defect (fixed)

Implementing else_when (from MathCore)

Reported by: krsta Owned by: krsta
Priority: normal Milestone:
Component: Version:
Keywords: Cc: krsta,

Description

Elsewhen should be implemented. Eg.g. the model below does not instantiate due to elsewhen statement.

model Square
  Real x(start=-1);
  Real y;
  Real z;
  Real q;
  Real w1,w2;
equation 
  when sample(2.5, 0.5) then
    x=-pre(x);
    q = x+1;
  end when;

  when sample(1.5, 0.5) then
   w1 = 4;
   w2 = 1.4;
  elsewhen sample(2.5, 0.5) then
   w1 = 1.2;
   w2 = 2;
  end when;  



  y=if time < 2.5 then 0 else x;
  z = y;
end Square;

Change History (2)

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

Works in trunk

Note: See TracTickets for help on using tickets.