- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » FMU and parameter variables
FMU and parameter variables
FMU and parameter variables
Hello all!
I have modified FMU SDK http://www.qtronic.de/en/fmusdk.html and use it to run models exported as .fmu using OpenModelica. During my testing, I ran into a problem, which is more of a philosophical problem than a software problem. Let's say I have the following model:
Code:
model FMITest
Real stock(start=0.0, fixed=true);
parameter Real par = 4;
parameter Real valve = par;
equation
der(stock) = valve;
end FMITest;
The export produces model description containing:
Code:
<ScalarVariable
name="par"
valueReference="2"
variability="parameter"
causality="internal"
alias="noAlias">
<Real start="4.0" fixed="true" />
</ScalarVariable>
<ScalarVariable
name="valve"
valueReference="3"
variability="parameter"
causality="internal"
alias="noAlias">
<Real start="4.0" fixed="true" />
All good in there. But let's say that during simulation, I change the value of "par" to 2. In my case, I would like that the value of "valve" is also changed. Currently this does not happen and there is no alias reference between"par" and "valve", which I could follow in my software. Is there a specification that says this is the way the software should work or could it be changed? I know that leaving the "parameter" keyword out from "valve" and specifying "valve = par" in equation block would probably fix this, but I would like to leave my model as it is for other reasons.
-Teemu
Re: FMU and parameter variables
Look into the FMI 2.0 beta specification, which includes "tunable" parameters. It is not yet released and OpenModelica does not support it.
- sjoelund.se
- 1700 Posts
Re: FMU and parameter variables
beta3 was released. And beta4 was supposed to be released a few months before the release... In my opinion the language in the document needs to be quite heavily revised. I also do not know about any plans to support FMI 2.0 although it should not be that hard to add since most of the additions are optional. Supporting tunable parameters is trivial: just export all of them non-tunable
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » FMU and parameter variables