With this test model it is tested how the initialization of an FMU can be changed in the environment where this FMU is used. The FMU is a PI controller that is initialized in steady state which in turn leads to a constraint on the inputs. However, this cannot be directly formulated as FMU. The implementation is performed in the following way:

  1. In order that the causality of the FMU of the input signals does not change during initialization, a dependent parameter "residue" with initialization fixed = false is introduced. In case the inputs follow the constraint of the PI initialization, residue is computed to zero (as it should be).
  2. The FMU initialization is not yet complete, since the PI state is not defined during initialization. Therefore, the PI state is initialized.
  3. When used in the environment without special handling, the PI-controller is initialized so that PI.x has the given start value and the parameter residue = u1 - u2. To formulate the desired steady-state condition, the initial value of the PI state is associated with n parameter x0 with fixed = false (so this parameter is computed). Now, one initial condition is missing and it is introduced by adding the initial equation "residue = 0". Note, when generating the FMU, parameter PI.residue should have "causality = output" and "variability = fixed" (since public, dependent parameter).


 WithFMUsReferenceReference solution in pure Modelica using exactly the same structuring as in Model WithFMUs
 WithFMUsSolution with FMUs
 FMUModelsFor all models in this package an FMU must be generated

Generated at 2024-06-14T18:15:55Z by OpenModelicaOpenModelica 1.22.4 using GenerateDoc.mos