twinlab.Emulator.fmu#
- Emulator.fmu(file_path, states, type='model-exchange', os='win64', verbose=True)[source]#
Export your emulator as a Functional Mock-up Unit (FMU) following the FMI 2.0 standard.
The FMU will be compatible for the specified operating system (by default, Windows 64-bit).
- Parameters:
file_path (str) – The path to save the exported emulator.
states (dict) – A dictionary mapping each input state to the corresponding output derivative, used to update inputs during simulations post-integration. Keys in the dictionary represent the input state names, while values specify the associated output derivative names. The dictionary length must match the number of emulator outputs, with each output assigned to one unique input. No output should be repeated within the mapping, ensuring comprehensive coverage of emulator outputs.
type (str, optional) – The type of FMU to export. Currently only
"model-exchange"
is supported.os (str, optional) – The operating system to export the FMU for. Currently only
"win64"
is supported.verbose (bool, optional) – Display detailed information about the operation while running.
- Return type:
- Returns:
None
Examples
emulator = tl.Emulator(id="emulator_name") emulator.train(dataset, inputs=["x1","x2","x3","x4"], outputs=["der(x1)","der(x2)"], params) emulator.fmu(file_path="emulator.fmu", states={"x1":"der(x1)", "x2":"der(x2)"})