- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Build problem due to units
Build problem due to units
Build problem due to units
Hello!
I just noticed a weird phenomenon: In a class of mine I use some connectors with variables which have unit attibutes set. When using units from Modelica.SIunits everything works normal. When using units out of my own units library flattening works fine, but an error occures while building the simulator.
Really strange is, that, when I declare the units from Modelica.SIunits within my own units library and use them, the flattened modelica code (fclass) looks exactly like when the units out of Modelica.SIunits are used - not a single byte differs. But (even if the fclasses look like copies) in one case the build fails, in the other it doesn't.
Any ideas?
Regards,
Hannes
EDIT: I must correct that: It does not matter where the units come from (own lib or Modelica libs). Fact is, that input variables within connectors "disappear" as unknown values from the system of equations when an unit attribute is set for them..
Example: A block with 3 causal connector variables (input); all 3 variables DON'T have unit attributes set: Trying to simulate that block leads to an error, because 3 values/equations are missing (model underdetermined by degree 3). Adding a unit attribute to 1 of the connector variables leads to a model which is underdetermined by degree 2. Adding a unit attribute to 2 of the connector variables leads to a model which is underdetermined by degree 1. (Means: with every time a unit attribute is added, one unknown seems to disappear). Finally, when all 3 variables have unit attributes set, the model seems to be balanced (which it obviously is not) and when trying to compile the simulator binary an error occures.
I reported this phenomenon 2 months ago already, with no reaction (http://www.openmodelica.org/index.php/forum/topic?id=66). Am I doing something wrong here, or why doesn't anyone see that problem?
- edes
- 38 Posts
Re: Build problem due to units
Hi,
Can you post a small non-private model that has this behavior?
Otherwise is rather hard to reproduce this issue.
You could also try the latest nightly-build as this problem might be fixed:
http://build.openmodelica.org/omc/builds/windows/
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Build problem due to units