API documentation

Otfmi facilitates the analysis of FMUs at a given time step and/or over time (static versus dynamic analyses).

Static analysis

The class FMUFunction wraps the FMU in an openturns.Function. Its output corresponds to the FMU’s output at its last simulation time. When the FMU is static (i.e. its output is time-independent), the value of the last simulation time is indifferent.

FMUFunction([path_fmu, inputs_fmu, ...])

Define a Function from a FMU file.

Its lower-level counterpart is OpenTURNSFMUFunction, closer to PyFMI’s methods but not directly usable with OpenTURNS.

OpenTURNSFMUFunction(path_fmu[, inputs_fmu, ...])

Define a Function from a FMU file.

Dynamic analysis

The class FMUPointToFieldFunction wraps the FMU in an openturns.PointToFieldFunction. Its output is a openturns.Field gathering the outputs as function of time.

FMUPointToFieldFunction(mesh[, path_fmu, ...])

Define a PointToFieldFunction from a FMU file.

Its lower-level counterpart is OpenTURNSFMUPointToFieldFunction, closer to PyFMI’s methods but not directly usable with OpenTURNS.

OpenTURNSFMUPointToFieldFunction(mesh, path_fmu)

Define a PointToFieldFunction from a FMU file.

Common low-level functions

The submodule otfmi.fmi gathers a set of useful functions, employed by the (higher-level) classes mentionned above.

fmi.load_fmu(path_fmu[, kind])

Load and FMU.

fmi.simulate(model[, initialization_script, ...])

Simulate an FMU.

fmi.parse_kwargs_simulate([value_input, ...])

Parse simulation keyword arguments and feed the simulate method of pyfmi's object.

fmi.apply_initialization_script(model, ...)

Apply an initialization script to a model.

fmi.get_name_variable(model, **kwargs)

Get the list of variable names.

fmi.get_causality_str(model, name)

Get the causality of a variable (input, output, or other).

fmi.get_variability(model)

Get the variability of the variables (constant, discrete, continuous, or other).

fmi.get_fixed_value(model)

Get the values of the variables with 'fixed' variability, ignoring aliases.

fmi.get_start_value(model)

Get the values of the variables with a start value ignoring aliases.

fmi.set_dict_value(model, dict_value)

Set values from a dictionary with variable names as keys.

From OpenTURNS to FMI

OTFMI can also export an OpenTURNS function in a Modelica source model (.mo) or Functional Mock-up Unit (.fmu).

FunctionExporter(function[, start])

Fonction export.