Closed modelica-trac-importer closed 6 years ago
Modified by fcasella on 27 Jan 2010 22:10 UTC
Comment by HansOlsson on 15 Sep 2010 14:54 UTC Seems to be corrected in MSL 3.2 (clearly for 'Inline=true and LateInline=false').
Comment by dietmarw on 15 Sep 2010 15:16 UTC Hans, for me it looks like an Modelica Specification issue. So how can this be resolved in the Standard Library?
Comment by HansOlsson on 15 Sep 2010 16:06 UTC Meant 'Modelica Specification 3.2' and not 'MSL 3.2'.
Modified by dietmarw on 15 Sep 2010 16:47 UTC
Reported by fcasella on 27 Jan 2010 22:07 UTC I have tried to understand exactly how the caching of function calls works in the Modelica.Media IF97 medium model, using the Inline=false, LateInline=true annotations. I attach the results of my analysis to this ticket.
As far as I understand, the sought after result (i.e., avoiding multiple calls to functions computing thermodynamic properties at the same values of p,h) is obtained if LateInline = true means that the function is inlined *after* common subexpression evaluation is applied, not before as stated by the Modelica specification 3.1, section 17.3 p.181.
Also, it is not too clear what is the semantics if Inline = true and LateInline = false. Is the function inlined or not in this case?
This annotation is crucial for efficient performance of the IF97 water model in Modelica.Media, which is now going to be supported by several tool vendors. It would be nice to clarify this in Modelica 3.2.
Migrated-From: https://trac.modelica.org/Modelica/ticket/263