modelica / fmi-standard

Specification of the Functional Mock-up Interface (FMI)
https://fmi-standard.org/
Other
269 stars 84 forks source link

Clarify the initialization of input variables #231

Closed modelica-trac-importer closed 6 years ago

modelica-trac-importer commented 6 years ago

Reported by aviel on 15 Apr 2014 09:51 UTC On page 49-50, the initialization of variables with input causality is defined by the initial attribute. This attribute can be absent or set to approx. On page 55-56, it is said that the input variables must have a start value, whatever the initial attribute. This raises several questions and remarks that need to be clarified:

  1. What is the meaning of an approximated input (i.e. with approx initial), especially with respect to the mathematical model of co-simulation that says the at t=t0 the input variables (denoted u0) are provided by the simulation master? The corresponding semantics seems to be exact.
  2. It would more clear to always have an initial attribute set to exact for input variables rather that no initial attribute (case (D) of table on p. 50), since exact means that the value is provided by the environment.
  3. In the two pseudo-code examples for both model exchange (p. 93) and co-simulation (p. 110), the input variable torque.tau does not have a start value, which seems contradictory with the above requirement.

Migrated-From: https://trac.fmi-standard.org/ticket/231

modelica-trac-importer commented 6 years ago

Comment by otter on 23 Apr 2014 10:04 UTC Replying to [ticket:231 aviel]:

On page 49-50, the initialization of variables with input causality is defined by the initial attribute. This attribute can be absent or set to approx. On page 55-56, it is said that the input variables must have a start value, whatever the initial attribute.

This has been clarified in the description of "causality":

"input": The variable value can be provided from another model or slave.initial must be approx or not present(meaning approx).  

This raises several questions and remarks that need to be clarified:

  1. What is the meaning of an approximated input (i.e. with approx initial), especially with respect to the mathematical model of co-simulation that says the at t=t0 the input variables (denoted u0) are provided by the simulation master? The corresponding semantics seems to be exact.
  2. It would more clear to always have an initial attribute set to exact for input variables rather that no initial attribute (case (D) of table on p. 50), since exact means that the value is provided by the environment.

This has been clarified in the specification for attribute "initial":

initial = "approx": For a variable where causality is not ″input″, the variable is an iteration variable of an algebraic loop and the iteration at initialization starts with the start value. For a variable with causality = ″input″, a start value must be provided. The environment decides when to use this value [examples: (a) automatic tests of FMUs are performed, and the FMU is tested by providing the start value as constant input. (b) For a ModelExchange FMU, the FMU might be part of an algebraic loop. If the input variable is iteration variable of this algebraic loop, then initialization starts with its start value.]

Note, initial="exact" is not useful, because this would mean that the variable must have the "start" value after initialization. However, in nearly all cases this will not be the case.

 

  1. In the two pseudo-code examples for both model exchange (p. 93) and co-simulation (p. 110), the input variable torque.tau does not have a start value, which seems contradictory with the above requirement.

This has been fixed.