FMU generated by SM does not run in Simulation Center

I exported a model to FMU that depends on external files to work, but when I run it
the simulation center does not compute variables, it just show parameters. If I run
normally the modelica file it runs fine, but when I load the FMU generated by the same
System Modeler the problem occurs. I’ve put the external files in system modeler working directory.

The model represents a Hybrid Electric Vehicle and it comes inside a package with a library.
The Package comes with many other models. I simulated and exported the “SHEVpowerFiltSocOO” model. I modified it a little bit so that it have a real output now (outputs battery SOC variable).
The picture below shows the expected result (run normally):

But when I load the FMU version and run it shows:

The SOC variable was just for example, but other variables have the same issue.

The FMU is the 2.0 version for Co-Simulation.
I’ve attached the package, lib and external files (.txt).

The original package is here:

The only modification was the SOC_Output variable, which is just a Real Output interface with causality as output.

SHEVmaps.txt (1.51 KB)
Sort1.txt (257 Bytes)
wbEHPTLib.mo (264 KB)
wbEVPkg.mo (100 KB)

Hi,

I cannot reproduce your issue, for me it works (tested with 12.2). Perhaps it’s best if you publish the actual model that you used (including the modification).

Otto

I’m suspecting you are simulating the imported FMU with useTriggerInput_=true, but without anything connected to the trigger. You could connect it to a BooleanPulse or SampleTrigger, but the easiest solution is to simply set the useTriggerInput_=false and specify a step_ size.

I hope that helps.

Otto

Hi Otto,
Thanks for the response, I’ve attached the files that I modified and used.
the difference is highlighted on the image below.

I’m using System Modeler 12.1, where can I find those simulation options?

I’m using System Modeler 12.1, where can I find those simulation options?

It’s a parameter in the model that is generated when you import the FMU. So you should get that Co-simulation tab when you open the generated model.

Otto

I found the tab here, set the parameters as you said and it worked! My bad! Thanks for the help Otto!

Michel

Hi again,
I was wondering what the

useTriggerInput_

parameter means? is it a kind of enable signal
generator for the solver?

in the FMU that I generated in systemModeler there is a variable:

Interfaces_.Boolean_DiscreteInput stepTrigger_ if useTriggerInput_  >>;

I noticed that SM just generate it if the FMU is for Co-Simulation. So if I’m correct it
is a synchronization mechanism for other programs or process that simulate other part of the system.

For a co simulation FMUs the FMU and Modelica model exchange input/outputs at discrete communication points. The FMU wrapper in System Modeler offers two ways of controlling that, using an externa trigger signal (useTriggerInput_=true) or periodically with the step size given by step_ (useTriggerIntput_false).

For a co simulation FMUs the FMU and Modelica model exchange
input/outputs at discrete communication points. The FMU wrapper in
System Modeler offers two ways of controlling that, using an externa
trigger signal (useTriggerInput_=true) or periodically with the step
size given by step_ (useTriggerIntput_false)

Got it, but are the “step_” and “stepTrigger_” variables that appear in
modelica code of the imported FMU created by SM at the time it opens or are
they in some “hidden place” in the FMU?
I’m asking because I’m developing an application where I execute SM FMU’s.

Got it, but are the “step” and “stepTrigger” variables that appear in modelica code of the imported FMU created by SM at the time it opens or are they in some “hidden place” in the FMU? I’m asking because I’m developing an application where I execute SM FMU’s.

No they are not part of the FMU, they are part of the Modelica wrapper that is generated when you import an FMU into System Modeler. So you would get them for every imported co-simulation FMU regardless of the tool used to produce the FMU.

Otto