Opened 4 years ago

Last modified 3 years ago

#6040 assigned defect

Output variables changing name in FMU

Reported by: Andreas Heuermann Owned by: Andreas Heuermann
Priority: low Milestone:
Component: FMI Version: v1.16.0-dev
Keywords: fmi-cross-check output Cc:

Description

When declaring a variable as an output and generating a FMU the variable name gets changed.

Run

loadString("
model simpleOutput
  output Real x (fixed=true, start=1);
  Real y (fixed=true, start=2);
  parameter Real a=2;
equations
  der(x) = a*x;
  der(y) = a*y;
end simpleOutput;
"); getErrorString();

buildModelFMU(simpleOutput); getErrorString();

system("unzip -p simpleOutput.fmu modelDescription.xml > modelDescription.xml"); getErrorString();

and than the modelDescription.xml will contain

  <ModelVariables>
  <!-- Index of variable = "1" -->
  <ScalarVariable
    name="_D_outputAlias_x"
    valueReference="0"
    initial="exact">
    <Real start="1.0"/>
  </ScalarVariable>
  <!-- Index of variable = "2" -->
  <ScalarVariable
    name="y"
    valueReference="1"
    initial="exact">
    <Real start="2.0"/>
  </ScalarVariable>
  <!-- Index of variable = "3" -->
  <ScalarVariable
    name="der(_D_outputAlias_x)"
    valueReference="2"
    >
    <Real derivative="1"/>
  </ScalarVariable>
  <!-- Index of variable = "4" -->
  <ScalarVariable
    name="der(y)"
    valueReference="3"
    >
    <Real derivative="2"/>
  </ScalarVariable>
  <!-- Index of variable = "5" -->
  <ScalarVariable
    name="x"
    valueReference="4"
    causality="output"
    >
    <Real/>
  </ScalarVariable>
  <!-- Index of variable = "6" -->
  <ScalarVariable
    name="a"
    valueReference="5"
    variability="fixed"
    causality="parameter"
    >
    <Real start="2.0"/>
  </ScalarVariable>
  </ModelVariables>

This internal name should not be visible outside of the FMU.

Change History (7)

comment:1 by Lennart Ochel, 4 years ago

Usually we hide those internal variables. But in case of states we do expose them to make the start attribute available.

comment:2 by Lennart Ochel, 4 years ago

And for structural reasons, i.e. modelStructure.

comment:3 by Andreas Heuermann, 4 years ago

Owner: set to Andreas Heuermann
Status: newassigned

I'll have a lock at it. It should be possible to have both: Expose start attributes but don't change the name.
But if I can't find a quick solution I will leave it as it is for now and see if I can get around it in my fmi-cross-check tests.

Also this is only a problem for fmi 2.0. For fmi 1.0 this is not a problem.

comment:4 by Andreas Heuermann, 4 years ago

Priority: lowcritical

As mentioned in 5367#comment:13 changing the causality for a state from independent to output changes the behavior at events.
So the problem is way worse than just some changed names.

comment:5 by Andreas Heuermann, 4 years ago

Priority: criticallow

#6050 is fixed, so it's now only the changed names again.

comment:6 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:7 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.