Opened 4 years ago

Last modified 3 years ago

#6259 new defect

Free parameters mess up FMI model structure

Reported by: Rüdiger Franke Owned by: Karim Adbdelhak
Priority: high Milestone:
Component: Backend Version: v1.17.0-dev
Keywords: Cc:

Description

See the following example:

model SI1 "Single Integrator with fixed parameter"
  parameter Real p = 1 "gain for input";
  input Real u(start = -2);
  output Real y(start = p);
equation
  der(y) = p * u;
end SI1;

for which FMI 2.0 export generates the following reasonable Outputs and Derivatives structure in modelDescription.xml. InitialUnknowns appears a bit "over-engineered" (y alias, der(y) and y unknown; der(y) depending on u and p):

  <ModelStructure>
    <Outputs>
      <Unknown index="4" dependencies="1" dependenciesKind="dependent" />
    </Outputs>
    <Derivatives>
      <Unknown index="2" dependencies="3" dependenciesKind="dependent" />
    </Derivatives>
    <InitialUnknowns>
      <Unknown index="1" dependencies="" dependenciesKind="" />
      <Unknown index="2" dependencies="3 5" dependenciesKind="dependent dependent" />
      <Unknown index="4" dependencies="" dependenciesKind="" />
    </InitialUnknowns>
  </ModelStructure>

Now see a model with slight modification (free parameter):

model SI2 "Single Integrator with free parameter"
  parameter Real p(fixed = false) "gain for input";
  input Real u(start = -2);
  output Real y(start = p);
initial equation
  p = 1;
equation
  der(y) = p * u;
end SI2;

Outputs and Derivatives loose their dependencies. The now more interesting InitialUnknowns disappear completely:

  <ModelStructure>
    <Outputs>
      <Unknown index="4" dependencies="" dependenciesKind="" />
    </Outputs>
    <Derivatives>
      <Unknown index="2" dependencies="" dependenciesKind="" />
    </Derivatives>
  </ModelStructure>

What happens to dependencies of Outputs and Derivatives?

Change History (4)

comment:1 by Francesco Casella, 4 years ago

@rfranke, is this really urgent or can we keep it for 1.17.0?

comment:2 by Francesco Casella, 4 years ago

Milestone: 1.16.21.17.0

comment:3 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:4 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.