2

I have the following Modelica code

model RocketCar
  Real x;
  Real v;
  input Real u(min = -1, max = 1);
  parameter Real h;
equation
  der(x) = h*v;
  der(v) = h*u;
end RocketCar;

meant to model the infamous rocket car problem, which I would like to transform into an FMU. I transform the file using OMShell:

>>> loadFile("RocketCar.mo")
true 
>> translateModelFMU(RocketCar)
"/path/to/RocketCar.fmu"

The resulting FMU lists the variable as

<ScalarVariable
  name="h"
  valueReference="10"
  variability="fixed"
  causality="parameter"
  initial="exact">
  <Real start="0.0"/>
</ScalarVariable>

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

Note that a similar question has been asked and answered already. The suggested solution was to add annotation (Evaluate=false) to the definition of the parameter. However, this answer seems to be specific to Dymola. The suggested annotation seems to have no effect regarding the resulting FMU. Is there an OpenModelica variant of the annotation to achieve the same effect?

hfhc2
  • 4,182
  • 2
  • 27
  • 56

0 Answers0