- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Semantic meaning of -fill(...)
Page Start Prev 1 Next End
Semantic meaning of -fill(...)
Semantic meaning of -fill(...)
Feb-03-12 11:42:26
Hello,
I have a question regarding the difference between fill(-a,N) and -fill(a, N).
If I have the following model
Code:
model Test
parameter Integer N = 1;
Real a[N];
Real b[N];
equation
a = fill(-1, N);
b = -fill(1, N);
end Test;
the flattend code is the following:
Code:
class Test
parameter Integer N = 1;
Real a[1];
Real b[1];
equation
a[1] = -1.0;
b[1] = DAE.CAST(/tp:T_REAL[1]/, -{1})[1];
end Test;
This appears more or less equal to me, however, I have a more complex model where using fill(-1,N) simulates correctly and -fill(1,N) leads to a simulation error.
Code:
warning | Error solving nonlinear system SES_ALGORITHM 0 at time 0
In my opinion the two solutions should be equal.
Best regards,
Michael
Re: Semantic meaning of -fill(...)
Feb-03-12 11:48:33
This now works in r11010 (the compiler simplifies the second expression to -1.0).
- sjoelund.se
- 1700 Posts
Page Start Prev 1 Next End
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Semantic meaning of -fill(...)
There are 0 guests and 0 other users also viewing this topic