Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the meaning of Evaluate=true in a type definition? #842

Closed
modelica-trac-importer opened this issue Jan 14, 2017 · 3 comments
Closed
Labels
bug Critical/severe issue wontfix Issue that will not be fixed
Milestone

Comments

@modelica-trac-importer
Copy link

Reported by pharman on 28 Sep 2012 11:25 UTC
In the MSL a number of enumeration type definitions have the annotation Evaluate=true. What is the intention of this?

Affected classes are:
Modelica.Blocks.Types.Init
Modelica.Blocks.Types.InitPID
Modelica.Blocks.Types.SimpleController
Modelica.Blocks.Types.AnalogFilter
Modelica.Blocks.Types.FilterType
Modelica.Mechanics.MultiBody.Types.Axis
Modelica.Mechanics.MultiBody.Types.RotationSequence
Modelica.Mechanics.MultiBody.Types.RotationTypes
Modelica.Media.Interfaces.Choices.Init
Modelica.Media.Interfaces.Choices.ReferenceEnthalpy
Modelica.Media.Interfaces.Choices.ReferenceEntropy
Modelica.Media.Interfaces.Choices.pd
Modelica.Media.Interfaces.Choices.Th


Migrated-From: https://trac.modelica.org/Modelica/ticket/842

@modelica-trac-importer
Copy link
Author

Comment by pharman on 9 Dec 2012 16:25 UTC
Since the specification states Has only an effect for a declaration with the prefix parameter. these have no effect.

Fixed by removing them in 66e1666

@modelica-trac-importer
Copy link
Author

Comment by otter on 9 Dec 2012 22:06 UTC
Please, undo this change, since it will give at minimum disastrous results for MultiBody systems.

The types above with the Evaluate = true annotation are designed to be used in parameter definitions. In order to not repeat this definition at every parameter declaration, the annotation is defined at a type.

For MultiBody systems, the symbolic processing depends heavily on evaluating some key parameters, such as the axis of rotation of a revolute joint. If Evaluate = false is used for such a parameter, the number of operations in the generated code will be a factor of 2-3 larger (so the model evaluation will be about 2-3 times less efficient).

Other cases for Evaluate = true in the types are used since it shall be guaranteed that an if-clause is evaluated at translation time (and the parameter is used as condition in an if-clause).

@modelica-trac-importer
Copy link
Author

Comment by pharman on 10 Dec 2012 09:50 UTC
Reverted changes in 787adf9.

Created new ticket #925 to add unspecified functionality to specification.

@modelica-trac-importer modelica-trac-importer added the wontfix Issue that will not be fixed label Jan 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Critical/severe issue wontfix Issue that will not be fixed
Projects
None yet
Development

No branches or pull requests