Opened 13 years ago
Last modified 12 years ago
#1734 closed defect (fixed)
Compiler generates bad flattened version of function from MSL
Reported by: | Bill Janssen | Owned by: | Bill Janssen |
---|---|---|---|
Priority: | high | Milestone: | 1.9.0 |
Component: | Frontend | Version: | |
Keywords: | Cc: | Bill Janssen, Per Östlund |
Description
If you flatten the attached model (RC_ideal.RC_driveline), you'll see that it includes a copy of Math.tempInterpol1 from the MSL 3.1. However, it changes the assignment of the result! In the MSL, that assignment is
y := y1 + (y2 - y1) * (u - u1) / (u2 - u1);
In the flattened code, it comes out as
y := y1 + (y2 - y1 * (u - u1)) / (u2 - u1);
Don't know if this is a parser bug or DAE bug.
Attachments (1)
Change History (5)
by , 13 years ago
Attachment: | RC_ideal.mo added |
---|
comment:1 by , 13 years ago
comment:2 by , 13 years ago
This has now been fixed in revision 11885 by the implementation of a shiny new expression dumping module. If you find any other issues with the expression dumping, just open a new ticket and assign it to me.
comment:4 by , 12 years ago
Component: | → Frontend |
---|---|
Milestone: | → 1.9.0 |
This is a bug in the dumping of the flattened code. So it doesn't affect the DAE or simulation, it's just a visual error in the flattened code. It seems to be non-trivial to fix this the way the expression dumping works right now, so it's probably best to just rewrite the expression dumping as a template as planned instead. For now it's safe to use this function though, the bug doesn't change the result.