FMPy icon indicating copy to clipboard operation
FMPy copied to clipboard

Setting stepwidth of single FMUs that are part of an Container FMU

Open Matthias776 opened this issue 3 years ago • 2 comments

Knowing that I can adjust the step width when simulating single FMUs by using simulate_fmu(filename, step_size=args.step_size) I'd like to know if there is also a possibility to set up different step sizes for FMUs that are within an FMU which have been created by create_fmu_container.

Since a variable for setting up a step size has to be set up in the Configuration() for the create_fmu_container function I looked for a similar variable in the ModelVariables of the single FMUs which I want to include but without success.

As an example FMUs that were imported into Dymola and builded as Container FMU have a variable fmi_NumberOfSteps that could be tuned.

</TypeDefinitions>
[<DefaultExperiment tolerance="0.0001" stopTime="1.0" startTime="0.0"/>]()
-[<ModelVariables>](path_to_fmu/DymolaFMU/modelDescription.xml#)
<!-- Index for next variable = 9 -->
-[<ScalarVariable name="reference_fmu.fmi_NumberOfSteps" variability="tunable" causality="parameter" valueReference="16777222">](file:///C:/Users/DEMAWEI2/Documents/Dymola/Models/ControlledDrivetrain/DymolaFMU/modelDescription.xml#)
[<Real start="500"/>]()

Matthias776 avatar Feb 09 '22 13:02 Matthias776

Can you describe a use case for this feature?

t-sommer avatar Feb 17 '22 13:02 t-sommer

I am thinking of a simulation with a model that has a significant sluggishness with respect to the dynamics of the other models. For example, a thermal model of an enclosure that experiences a heat flux due to the friction of a gearbox or the winding losses of a motor. My guess is that this can save computation time in the case of co-simulations.

Matthias776 avatar Feb 17 '22 14:02 Matthias776