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
  • Index
  • » Users
  • » w1ldw0lf
  • » Profile

Posts

Posts

Thanks @glang again for the quick response, no bother at all! All knowledge is always very welcome

So, to be clear, when compiled the FMU had fixed parameters? And then the XML was manually changed to set these as tunable?

From my side, I am using CasADi to convert the FMU into an optimization problem.
I am already in contact with the CasADi developers to tackle this issue, so it may take some days to get deep into it. Good to know that at least is not coming from the FMU side. That is clearly shown from your results. Highly appreciated!

Best,

Thanks @glang for the response,

Unfortunately, this workaround will not work for my purpose (parameter estimation through optimization using the FMU). I guess it also needs to be declared somehow within the FMU binaries.

For the record, I also posed the question in the OM github at the Q&A section: https://github.com/OpenModelica/OpenMod … sions/8781

and I was referred to the following ongoing discussion in the Modelica Specification github https://github.com/modelica/ModelicaSpe … ssues/3140

Seems that there is some work to be done to get there!

Best,

Hey @glang

Thanks for the input!
However I downgraded OM to 1.18.1 and used the model you sent me, with unsuccessful results. The compiled FMU still shows:

Code:


  <!-- Index of variable = "4" -->
  <ScalarVariable
    name="gain.k"
    valueReference="3"
    description="Gain value multiplied with input signal"
    variability="fixed"
    causality="parameter"
    >
    <Real start="1.0" unit="1"/>
  </ScalarVariable>
  <!-- Index of variable = "5" -->
  <ScalarVariable
    name="k1"
    valueReference="4"
    description="gain 1"
    variability="fixed"
    causality="parameter"
    >
    <Real start="1.0"/>
  </ScalarVariable>

in the modelDescription.xml file.
In Simulation Setup, at the Translation Flags tab, the 'Evaluate all parameters' checkbox is disabled.

Best,

I want to export a model in OpenModelica to FMU including a 'tunable' input parameter to the parameter. For this, I call

>> translateModelFMU(model)

And in the model I have a set of parameters such as

parameter input Real param;

The resulting FMU modelDescription.xml lists the variable as
 
<ScalarVariable
    name="param"
    valueReference="37"
    variability="fixed"
    causality="input" >
    <Real start="0.0"/>
  </ScalarVariable>

i.e., as a fixed input parameter. I would like to change the Modelica code to obtain a tunable parameter in the resulting FMU.

In Dymola, adding the annotation (Evaluate=false) to the definition of the parameter will do the trick. However, this solution seems to be specific to Dymola. I tried to add the annotation in OM but seems to have no effect regarding the resulting FMU. What would be the way to achieve this in OpenModelica?

  • Index
  • » Users
  • » w1ldw0lf
  • » Profile
You are here: