Changes between Initial Version and Version 4 of Ticket #2599


Ignore:
Timestamp:
2014-02-21T18:40:24Z (11 years ago)
Author:
Willi Braun
Comment:

Replying to sjoelund.se:

Are you actually allowed to output both a continuous-time and discrete-time expression for the same equation?

Spec 3.8.3 says:

For an equation expr1 = expr2 where neither expression is of base type Real, both expressions must be discrete-time expressions.

Exceptions are only made for records.

That's a really good remark. I changed the model a bit, so that the mode has a discrete change of c while the continues integration.

So I think you are right we need to handle that whole equation as discrete.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2599 – Description

    initial v4  
    1010  for i in {1} loop //prevent inlining
    1111    b := b + sin(a);
    12     c := i;
     12    c := integer(a);
    1313  end for;
    1414end ftest;
     
    1616  Real a;
    1717  Integer c;
    18   Real x;
     18  Real x,z;
    1919equation
    20   der(x) = a;
     20  der(x) = sin(a + time);
    2121  (x,c) = ftest(a);
     22  z = if c>=1 then 10 else 0;
     23  annotation (experiment(StopTime=2));
    2224end TupleNonLinear;
    2325}}}