#2310 closed defect (fixed)
referenced a variable that was not declared as a <variable>
Reported by: | Lennart Ochel | Owned by: | Lennart Ochel |
---|---|---|---|
Priority: | critical | Milestone: | 1.9.0 |
Component: | Code Generation | Version: | trunk |
Keywords: | Cc: | Adeel Asghar, Martin Sjölund |
Description (last modified by )
This model should probably be simulated without errors:
model foo Real a; Real b(fixed=true); initial equation pre(a) = b^2; equation der(a) = time; when initial() then b = pre(a); end when; end foo;
output:
assert | assert | Referenced '$PRE._a' that was not declared as <variable> Process crashed
Change History (10)
comment:1 by , 11 years ago
Description: | modified (diff) |
---|
follow-up: 10 comment:2 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 11 years ago
Description: | modified (diff) |
---|
comment:4 by , 11 years ago
Cc: | added |
---|
comment:5 by , 11 years ago
OMEdit passes the -lv=LOG_STATS flag to the executable by default. This flag is making the executable crash. I will investigate about it a bit more tonight. But perhaps you can have a look at the way flags of the executable are used since you have rewritten them.
comment:6 by , 11 years ago
Cc: | added |
---|---|
Component: | Backend → Code Generation |
A little bit of more debugging shows that the problem is not with simulation flags. The -lv=LOG_STATS enables the measure_time_flag and the process will go onto reading of the model_info.xml file.
In SimCodeDump.tpl we are writing the xml file. Either the equations tag writing should be corrected or we should add the variable that is referenced in the equation to the variables tag.
comment:7 by , 11 years ago
Good hint. I had forgotten that OMEdit passes LOG_STATS per default. Now things make sense again :-)
comment:8 by , 11 years ago
Priority: | high → critical |
---|
comment:9 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed in r16898. I added the $PRE._* variables tot he model_info.xml.
comment:10 by , 11 years ago
Replying to lochel:
With
+d=initialization
I get also:
Assuming fixed start value for the following 1 variables: a:VARIABLE() .foo, .Real type: RealThis is wrong. The initial conditions are already fully specified.
I fixed this already some revision ago.
With
+d=initialization
I get also:This is wrong. The initial conditions are already fully specified.