Highlighted

FMU multiplier for step size: divide step size instead of multiply?

Experimenter
Experimenter

I'm using Amesim 16 and trying to set up a simulation that includes some FMU blocks.

 

When you load an FMU, there is an option in FMU parameters called comNbStepSize that is defined as follows:

The actual co-simulation step size is obtained by taking the product of this parameter with the fixed step size of the numerical integrator.

 

With this parameter, I can only set the fixed step size to a value and then multiply the FMI step size by a number greater than 1.

For example:

* Master step size set to 0,001

* comNbStepSize in FMU set to 10, so the step size for this FMU is 0,01

 

What if I want to set up the FMU to a step size lower than the master step size? (if I try to set up the multiplier parameter to 0.5 for example, the compilation fails) Is there a way to achieve that?

 

Thanks

1 REPLY 1

Re: FMU multiplier for step size: divide step size instead of multiply?

Siemens Experimenter Siemens Experimenter
Siemens Experimenter

Hi Rick,
The co-simulation we use implies that the Simcenter Amesim model (the master) and the FMU (the slave) are simulated using their own solvers, and are communicating at fixed time steps. Communication between them takes place only at fixed time steps. This is why each model is seen as discrete by the other one, the two models being coupled through invisible zero order samples and holds. See below:

Cosim1.png

Note that the fact that the simulations communicate at fixed time steps does not imply that fixed-step solvers have to be used by the Simcenter Amesim model, or the FMU. Depending on available software capabilities, the four master/slave solver associations are supported, namely:

  • Fixed-step / fixed-step
  • Variable-step / variable-step
  • Variable-step / fixed-step
  • Variable-step / variable-step

At each “rendez-vous point”, the FMU slave needs to receive updated inputs that have been calculated by the Simcenter Amesim master model (and conversely). As a consequence, selecting a fixed-step solver for the master imposes that the co-simulation time step (also called “macro-step”) be a multiple of the master solver’s time step (the master solver’s “micro-step”).

The below figure illustrates the relationship between micro-steps (solver steps) and the macro-step (co-simulation time step):

Cosim2.png

It cannot be the other way around since at least one solver iteration needs to take place precisely at the rendez-vous point. So, specifying a macro-step that would be smaller than the master’s fixed micro-step would not make sense (no updated inputs would be available for each model). It would also put additional constraints on the FMU’s micro-steps. More detail can be found in section 3.4.2 of the FMI manual.
May I ask you what was your initial motivation?

Regards,

-- 

Bruno