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

Clarification of alias variables (and variability) #436

Closed
modelica-trac-importer opened this issue Oct 17, 2018 · 14 comments
Closed

Clarification of alias variables (and variability) #436

modelica-trac-importer opened this issue Oct 17, 2018 · 14 comments
Assignees
Milestone

Comments

@modelica-trac-importer
Copy link

Reported by christian.winther on 6 Jun 2018 15:53 UTC
Question about alias variables. Say that I have two ScalarVariables that have the same value reference and the same type and thus are alias variables. Is it then legal for the two variables to have different variability?

I've been looking through the specification (both 1.0 and 2.0) and cannot see anything that specifically says it is illegal and also the compliance checker does not currently report an error for it but to me it seems that it should be illegal.


Migrated-From: https://trac.fmi-standard.org/ticket/436

@KarlWernersson
Copy link
Collaborator

I would not say that its good practice, but the most simple solution would be to assume and define the highest variability in that case, i.e continuous>discrete>tunabel>fixed.
Since they are a subset of each other this should not be an issue.
If one wants to be super safe at import they could assume the lowest variability.

@KarlWernersson
Copy link
Collaborator

Decision: move to 3.0

@chrbertsch
Copy link
Collaborator

FMI Design meeting Regensburg:

First paragraph on p51. of FMI 2.0 spec says that this would not be problem.
Third paragraph creates confusion. Should be clarified.

@t-sommer t-sommer removed the P: minor label Mar 9, 2019
@chrbertsch chrbertsch modified the milestones: v3.0, v2.0.1 May 10, 2019
@chrbertsch
Copy link
Collaborator

@KarlWernersson : Could you have look at it and come up with a proposal? If necessary please create a new ticket for FMI 3.0

@KarlWernersson
Copy link
Collaborator

KarlWernersson commented Jun 19, 2019

So section 3 talks about variablity, and section 1 talks about causality so i dont see the crash.

Basicaly you can only have multiple aliases between local, output and calcualted parameters, A set of aliases can include maximum of one parameter or input.
if you have an input or a parameter, in the set of aliases, the variability must be controlled by the variability of the parameter/input.

If you dont have any input/parameter in the alias group then you can only retrieve values. Then the variability must be governed by the highest variability in this set of aliases, as this would be the lest intrusive option. (since it is always allowed to call get on any variability)

Start Values are coverd by section2.

So new normative text.

In case of different variability among the set of alias variables,
and that set of aliases do not contain a input or parameter,
the variability should be the highest of the variables in the set, e.g. continuous > discrete > tunable >fixed.
If the set includes a parameter or input the aliases will have the stated variability of that parameter or input

KarlWernersson added a commit to KarlWernersson/fmi-standard that referenced this issue Jun 20, 2019
Aded normative text for the issue, corected an eronous != sign
KarlWernersson added a commit that referenced this issue Jul 5, 2019
* #436

Aded normative text for the issue, corected an eronous != sign

* fix #547

explicitly state no backslashes, reference to zip file format specification

* #440 fix

Clarified that input cannot be set before fmi2EnterInitializationMode

* #431 fixed

Clearified text, corected variability = input to causality = input

* #415

Moved section up in text to make it ceared that it applies to both flat and structured

* #413 fix

Clarified that scararVariables can be oredered arbitrary except for array elements

* #409

Clarified that pure discrete time fmu's must be able to run as a continous time fmu

* #407 fix

Removed setConinuousTimeStates form the allowed calls in event mode in the mathematical description

* #405 fix

If pure discrete time fmu has crossing function it need to enter continuous time mode to solve these

* #401 fix

Recomedns that all binares in binary folder is unpacked togheter wiht the dll

* #396 fix

Clarified that the number of continuous time stiates is uniqley defined by the number of derivatives

* #395 fix

Cleard out inconsitency that getEventIndicators can be called duering intializationMode

* #394 fix

setTime is only allowed in eventMode for pureDiscreteTimeFMu's

* #380 fix

aded example for simple case

* #374 fix

* #311

* Fixing small typo

* Fixing typo

* Fix typo

* Replace hard internal reference by ADOC internal reference (with a link)

* Fix #417: add license folder

* fix #95

* Fix #387

* (Following one-sentence-per-line rule)

* fix #338

* fix build error

* corected comment by masoud

* christian comment about clarification 2.0.1

* Aditional fix #395
@chrbertsch
Copy link
Collaborator

Closing as included in PR #579

@nickbattle
Copy link
Collaborator

This rule is now verified in VDMCheck, given that this has appeared in the 2.0.1 standard, Quite a few FMUs in the cross-check repository have issues (unless I have misinterpreted the rules), for example:

------------------------------- ./me/win64/Dymola/2017/CoupledClutches/CoupledClutches.fmu
2.2.7 Aliases of reference 16777252/Real must all be <fixed>, because of "fixed.phi0"
2.2.7 Aliases of reference 637534234/Real must all be <continuous>
2.2.7 Invalid ScalarVariable aliasing

Here, "fixed.phi0" is a fixed parameter, so all its aliases must be, and 637534234/Real aliases are both discrete and continuous, and so should all be continuous.

@nickbattle
Copy link
Collaborator

Looks like 125 of 692 FMUs have some sort of aliasing issue here. The results have been updated on the VDMCheck release page.

https://github.com/INTO-CPS-Association/FMI2-VDM-Model/releases/download/0.0.2-1/vdmcheck.results-191015

@nickbattle
Copy link
Collaborator

Correction: 175 FMUs have errors (the 125 is just for Real aliases, but there are other types).

@nickbattle
Copy link
Collaborator

@t-sommer Are these FMUs also candidates for the "notCompliantWithLatestRules" treatment?

alias_errors.txt

@t-sommer
Copy link
Collaborator

@t-sommer Are these FMUs also candidates for the "notCompliantWithLatestRules" treatment?

alias_errors.txt

Potentially, yes. Please open an issue on modelica/fmi-cross-check.

@nickbattle
Copy link
Collaborator

Done. modelica/fmi-cross-check#76

@HansOlsson
Copy link
Contributor

I think we should revisit this issue for two reasons:

Looking at the new text it says (as non-normative text - so I don't see that it should be checked at all):
"In case of different variability among the set of alias variables, and if that set of aliases does not contain an input or parameter, the variability should be the highest of the variables in the set, e.g. continuous > discrete > tunable >fixed. If the set includes a parameter or input the aliases will have the stated variability of that parameter or input."

I believe this should be reconsidered and reformulated, because:

  • For variables produced by the FMI it should be the least variable that defines the actual variability. The reason is that even though a continuous variable is allowed to change all the time, it doesn't have to change between external events. So if a continuous variable and a tunable are aliases both are consistent with the value not changing between external events, i.e. it is as if it were tunable.
  • The generating tool can, of course, change the variability of these variables, e.g. to make them consistent. If the intention is that all of the alias-variable should have the same variability (which I find excessive - but what the cross-checker seem to check) then the tools should likely also choose the lowest variability - and the specification should just say that all aliases should have the same variability.

@HansOlsson HansOlsson reopened this Oct 17, 2019
@chrbertsch chrbertsch modified the milestones: v2.0.1, v3.0 Oct 18, 2019
@chrbertsch
Copy link
Collaborator

superseded by #807

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants