Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

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.

Re: FMU and parameter variables

So I was a little ahead of myself. Too bad, I was so excited about this current/smile

What kind of plans there are to support FMI 2.0? I suppose FMI 2.0 will be released pretty soon, since it was planned for March 2012.

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 current/wink

There are 0 guests and 0 other users also viewing this topic