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
Changing parameter values in the modeldescription.xml file #387
Comments
Comment by ottot on 19 Oct 2016 12:51 UTC
|
Comment by cbertsch on 20 Oct 2016 18:51 UTC |
Comment by apillekeit on 26 Oct 2016 13:40 UTC the rules for creating and also the meaning of the GUID are a bit vague in the FMI specification. So far I would agree with the other comments. But I disagree with the conclusion of illegalizing changes to the ModelDescription.xml. From a tool’s perspective regarding start/guess values: The current GUID of the ModelDescription.xml is no proper means for checking the correctness. And providing a kind of hash value based on the GUID in future versions for the ModelDescription.xml is not a good option. Firstly it is unnecessarily complicated (not mentioning that the GUID is actually part of the ModelDescription.xml you like to create a hash value for) as well as a source of importing errors and secondly please see next point. From a user’s perspective: If a model integrator in a company gets an FMU s/he usually has no access to the original model – may it be because it comes from a different department or from a 3rd-party supplier. The process of getting a new version of that FMU is in most cases very cumbersome and expensive and time consuming! Many typical everyday integration problems can be solved straightforwardly by editing the ModelDescription.xml. the FMU can transport the changes to the various importing tools s/he wants to use the FMU with. That is a great feature of the standardized separation of model code and model description! In all the projects that used FMUs I worked in, the possibility to do such changes to the Modeldescription.xml really saved a lot of time and even solved compatibility issues between tools. So I am strongly in favor of exploiting this advantage of FMI instead of eliminating it. If someone changes the original ModelDescription.xml it is in his/her responsibility to check the results. Thus I vote for changing the sentence on page 53 in brackets to [Calling fmi2SetXXX to set start values during initialization is nevertheless recommended for all available start values in the xml file, since these values may have been altered due to user intervention.] Best regards |
Modified by apillekeit on 8 Jun 2017 11:40 UTC |
Comment by cbertsch on 11 Jun 2018 10:45 UTC |
Closing this for FMI 2.0.1 Please reopen for 3.0 if it is relevant there. |
As a lot of tools and users have done this forbidden action of modifying the modeldescription.xml file, I still think that one should add an explicit warning to FMI 2.0.1 not to do so. (Perhaps with a NOTE: as a further non-normative explanation. |
As I have seen many people running in problems modifying start values in the FMU leading to unpredictable behaviour in different importing tools, I still recommend to include non-normative warning in FMI 2.0.1 I would change on p53 of FMI 2.0 |
Your warning text explains this in a round-about way. The reason is that the modelDescription.xml is a way of documenting the C-code, not of influencing it. If we can make clear that, changing start values would be clearly useless. Can we find a good place where this should go? |
I marked my suggested changes in bold. I see this as a recommendation, since nothing has been stated about this before in the documentation. |
Should we really add advertisement for the SSP Standard in a maintenance release? There might be other equally good (or bad) means of managing parameters. |
As this is non-normative text, I do not consider this problematic. I included the version proposed by @APillekeit in @KarlWernersson PR #579 so that it can be discussed there. |
* #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
hi,
Hi Andreas,
what is the use of modelDescription.xml file? i hope that you will reply soon...... thanks, |
I would simply say that it is NOT allowed to make changes in the modelDescription.xml file! The file is generated by the FMU creator and must map to the binary code. Violating this rule causes undefined behaviour! |
As @friedrichatgc says, from the point of view of FMI, the modelDescription.xml is the description of the model for the importer to understand and handle the FMU properly. It is not for user-editing, parameter changes, etc. This should be handled in the way that the importing tool specifies. For cross-platform purposes the SSP standard provides standardized ways of changing FMU parameters and transporting those changes between platforms. While there are tools out there that enable "editing" of FMUs (we do sell such a tool, there are others), they have to support other ways than just editing of the modelDescription.xml to effect changes to FMU start values / parameters. Just changing their value in modelDescription.xml is not enough. And I think that is as it should be, because the FMU as a whole should not be changed just to change parametrization. |
Do have to state this more pronouncedly in FMI 3.0? Currently we have only "WARNING: It is not recommended to change the start values in the modelDescription.xml file of an FMU, as this would break the consistency with the hard-coded start values in the C-Code. This could lead to unpredictable behavior of the FMU in different importing tools, as it is not mandatory to call fmi3Set{VariableType} to set start values during initialization. Instead it is recommended to use the SSP Standard (https://ssp-standard.org/) to handle modified parameters of FMUs or different parameter sets." We could state in https://fmi-standard.org/docs/3.0-dev/#fmu-distribution : Anyway we cannot prevent people from doing forbidden things, but then they have to bear the consequences. |
I agree with Christian´s suggestion. |
This is consistent with the formal modelling. We regard the modelDescription.xml as defining the static semantics of the FMU; the behaviour of the API calls is the dynamic semantics. The expectation is that the static semantics of the FMU does not change, while the dynamic behaviour, of course, is affected by the API call sequence (as well as the static configuration). |
Reported by cbertsch on 15 Oct 2016 11:06 UTC
I would like to clarify, whether it is allowed to change paramter values in the modeldescription.xml file and what the consequences of this are. I know of tools, that do this, and it is unclear to me, what the importing tools shall do with such a modified FMU.
Changing parameters in the modeldescription.xml file could lead to making the GUID invalid (as the 2.0 FMI standard states:
Argument fmuGUID is used to check that the modelDescription.xml file (see section 2.3) is
compatible with the C code of the FMU. It is a vendor specific globally unique identifier of the
XML file (for example it is a “fingerprint” of the relevant information stored in the XML file). It
is stored in the XML file as attribute “guid” (see section 2.2.1) and has to be passed to the
fmi2Instantiate function via argument fmuGUID. It must be identical to the one stored
inside the fmi2Instantiate function. Otherwise the C code and the XML file of the FMU
are not consistent to each other. This argument cannot be null.
Additionally, the parameter values are also stored within the C-Code and/or DLL and I think that it is not specified, that these internal values have to be overwritten with the values from the XML when importing the FMI. Is this correct? I think that some importing tools will do this and other not. Thus a clarificatoin is suggested for FMI 2.0.1
Migrated-From: https://trac.fmi-standard.org/ticket/387
The text was updated successfully, but these errors were encountered: