statemachine instantiate/initialize

1 post / 0 new
smatti
Offline
Joined: 2017-07-18
statemachine instantiate/initialize

Hello, I just started looking into pyFMI. I am wondering how the pyFMI functions correspond to the FMU state machine and what they are exactly doing !?

In various examples I found and tested it myself that the following works:

myModel = load_fmu(someModel.fmu)
myModel.simulate(params)

So I don't have to explicetly instantiate and initialize the FMU because it is done by those two methods.

My questions are:

  1. Is pyfmi.fmi.load_fmu() already calling fmi2Instantiate and results in an instantiated FMU ?  According to http://www.jmodelica.org/assimulo_home/pyfmi_1.0/pyfmi.html the function returns an model instance, but I guess in terms of python class object.
  2. Is pfmi.fmi.simulate() only initializing or instantiating and initializing the FMU? I think the first is the case

Reason why I am asking is that when I inspect with a debugger the python object that is returned calling load_fmu there is no information stored in the object: the cache dict is empty, other variables are filled with None.

Calling

myModel.get_model_variables()

however returns the variables of the model and the cache of the python fmu-model object ist filled.

Is there a link to some documentation in the web explaining these issues that I missed when searching for it?