FMU

class pathsim.blocks.fmu.CoSimulationFMU(fmu_path, instance_name='fmu_instance', start_values=None, dt=None)[source]

Bases: Block

Co-Simulation FMU block using FMPy with support for FMI 2.0 and FMI 3.0.

Deprecated since version 1.0.0: Use pathsim_fmi.CoSimulationFMU() instead. This block has moved to the pathsim-fmi package: pip install pathsim-fmi

This block wraps an FMU (Functional Mock-up Unit) for co-simulation. The FMU encapsulates a simulation model that can be executed independently and synchronized with the main simulation at discrete communication points.

Parameters:
  • fmu_path (str) – path to the FMU file (.fmu)

  • instance_name (str, optional) – name for the FMU instance (default: ‘fmu_instance’)

  • start_values (dict, optional) – dictionary of variable names and their initial values

  • dt (float, optional) – communication step size for co-simulation. If None, uses the FMU’s default experiment step size if available.

fmu_wrapper

version-agnostic FMU wrapper instance providing access to model_description, fmu, and other FMPy objects for advanced usage

Type:

FMUWrapper

dt

communication step size

Type:

float

reset()[source]

Reset the FMU instance.

class pathsim.blocks.fmu.ModelExchangeFMU(fmu_path, instance_name='fmu_instance', start_values=None, tolerance=1e-10, verbose=False)[source]

Bases: DynamicalSystem

Model Exchange FMU block using FMPy with support for FMI 2.0 and FMI 3.0.

Deprecated since version 1.0.0: Use pathsim_fmi.ModelExchangeFMU() instead. This block has moved to the pathsim-fmi package: pip install pathsim-fmi

This block wraps an FMU (Functional Mock-up Unit) for model exchange. The FMU provides the right-hand side of an ODE system that is integrated by PathSim’s numerical solvers. Internal FMU events (state events, time events, and step completion events) are translated to PathSim events.

Parameters:
  • fmu_path (str) – path to the FMU file (.fmu)

  • instance_name (str, optional) – name for the FMU instance (default: ‘fmu_instance’)

  • start_values (dict, optional) – dictionary of variable names and their initial values

  • tolerance (float, optional) – tolerance for event detection (default: 1e-10)

  • verbose (bool, optional) – enable verbose output (default: False)

fmu_wrapper

version-agnostic FMU wrapper instance providing access to model_description, fmu, and other FMPy objects for advanced usage

Type:

FMUWrapper

time_event

dynamic time event for FMU-scheduled events

Type:

ScheduleList or None

sample(t, dt)[source]

Sample block after successful timestep and handle FMU step completion events.

reset()[source]

Reset the FMU instance.