Opened 12 years ago
Closed 9 years ago
#2261 closed defect (fixed)
Problem with initialization of mixed system
Reported by: | Lennart Ochel | Owned by: | Lennart Ochel |
---|---|---|---|
Priority: | high | Milestone: | 1.9.0 |
Component: | Backend | Version: | trunk |
Keywords: | Cc: | fedebergero@…, Willi Braun, Adrian Pop |
Description
Hi all, I have the following model that fails to compile (it generates
the c file but then gcc fails).
The problem is that a discrete variable is involved in a mixed
algebraic loop, appearing as an argument to the pre operator.
Then the initialization code tries to lookup the pre(pre(var))
variable and it fails.
Thanks
Fede
Attachments (1)
Change History (13)
by , 12 years ago
comment:1 by , 11 years ago
Cc: | added |
---|
comment:2 by , 11 years ago
Owner: | removed |
---|---|
Status: | new → assigned |
comment:3 by , 11 years ago
Cc: | added |
---|
Probably the smallest model that is causing the error:
model Unnamed Real a; initial equation pre(a)^2 = 9; equation der(a) = 0; end Unnamed;
Error message:
Unnamed.c: In function 'initializeStaticNLSData3': Unnamed.c:134: error: '$P$ATTRIBUTE$P$PRE$Pa' undeclared (first use in this function) Unnamed.c:134: error: (Each undeclared identifier is reported only once Unnamed.c:134: error: for each function it appears in.) OMDev\tools\MinGW\bin\mingw32-make: *** [Unnamed.o] Error 1
This can be easily fixed by introducing #define $P$ATTRIBUTE$P$PRE$Pa $P$ATTRIBUTE$Pa
for all states (or continuous-time variables?).
If we do so, another error occurs:
Unnamed.o:Unnamed.c:(.text+0x1552): undefined reference to `_$P$PRE$Pa'
The current NLS implementation requires old values for each variable to inter-/extrapolate for some reasons.
follow-up: 9 comment:4 by , 11 years ago
comment:6 by , 10 years ago
Milestone: | 1.9.1 → 1.9.2 |
---|
This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).
comment:7 by , 10 years ago
Milestone: | 1.9.2 → 1.9.3 |
---|
Milestone changed to 1.9.3 since 1.9.2 was released.
comment:9 by , 9 years ago
Owner: | set to |
---|
comment:10 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:11 by , 9 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:12 by , 9 years ago
Milestone: | 1.9.4 → 1.9.0 |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
error message:
generated c-code: