Simulation Topology

Overview

The Dynamic Simulation Environment provides several simulation topologies, all of which support distributed simulations, that may incorporate models running on multiple OS/Arch combinations or running in multiple simulation environments.

These topologies include:

  • Model Runtime - Stacked model instance (single process) / Loopback SimBus
  • Stacked w. Redis - Stacked model instance (single process) / Redis SimBus
  • Distributed w. Redis - Distributed model instances (process per model) / Redis SimBus
  • Gateway - Remote simulation systems are connected with a gateway model / Redis SimBus
  • MCL - Foreign models are imported via a Model Compatibility Library / Loopback SimBus
  • Realtime - Distributed and Stacked model instances / Loopback & Redis SimBus
  • Embedded - External models and sensors and connected with a POP model / TCP

These topologies are supported by the Simer docker appliance (Linux) and ModelC runtime (Linux/Windows). The underlying messaging protocol used by the Dynamic Simulation Environment is implemented with Flatbuffers and may be implemented in any programming language or operating system.

Model Runtime

Several Models are stacked in a single model runtime. For example, the runtime may be packaged as an FMU using the FMI ModelC FMU wrapper.

Stacked w. Loopback

Characteristics:

  • Single Process - Sequential execution of models within a single process using the ModelC model runtime. Performance limited by CPU clock speed.
  • Co-Simulation - Phase shift for signal exchange between model steps (i.e. output to input). Phase shift is equal to one simulation step.
  • Loopback SimBus - Low latency execution with no external/network signal exchange.
  • Limited deployment - Use of Loopback SimBus means that only single process deployment is possible.

Note: Models may be stacked in any deployment topology (i.e. with Redis).

Sequence Diagram

topology-stacked-loopback

Configuration

CLI / Environemnt
VariableCLI Option (ModelC/Simer)Value
SIMBUS_TRANSPORT--transportloopback
SIMBUS_URI--uriloopback
Simulation Stack
simulation.yaml
---
kind: Stack
spec:
  connection:
    transport:
      loopback:
        uri: loopback

Stacked Sequential Co-Sim

Note: This is a future/planned development.

Characteristics:

  • Single Process - Sequential execution of models within a single process using the ModelC model runtime. Performance limited by CPU clock speed.
  • Co-Simulation - Sequential-Co-Simulation resulting in no phase shift between the stacked models.
  • Limited deployment - Used to compose models from several “component” models where the resultant model does not exhibit phase shift between its input and output signals for any simulation step.

Sequence Diagram

topology-stacked-sequential

Configuration

TBD

Stacked w. Redis

Several Models are stacked in a single model runtime and connect to a Redis based SimBus.

Distributed w. Redis

Models are distributed in several instances of a model runtime. Model runtimes may run on several computers, use different operating systems, and execute in other Simulation Environments.

Native w. Redis

Characteristics:

  • Multi Process - Parallel execution of models using a Simer/ModelC model runtime. Performance limited by number of CPU Cores and Processing Nodes (e.g. VMs/Workstations).
  • Co-Simulation - Phase shift for signal exchange between model steps (i.e. output to input). Phase shift is equal to one simulation step.
  • Redis w. SimBus - Low latency signal exchange when running with a Simer deployment, medium latency when operating cross-platform simulation (latency depends on network performance).
  • Flexible deployment - The Simer Container Runtime can be used for high performance, scaled, Linux deployments. The underlying model runtime ModelC is available for Windows deployments. Both can be combined to create distributed simulations.

Sequence Diagram

topology-distributed-redis

Configuration

CLI / Environment
VariableCLI Option (ModelC/Simer)Value
SIMBUS_TRANSPORT--transportredis
SIMBUS_URI--uriredis://localhost:6379

Note: There are several variations of Redis transports, redispubsub being the most common (and original). The newer redis transport has the best performance and is suggested for new simulation projects.

Simulation Stack
simulation.yaml
---
kind: Stack
spec:
  connection:
    transport:
      redis:
        uri: redis://localhost:6379

Gateway

Remote systems are connected to a simulation using a Gateway model. The Gateway model is implemented in the remote systems operating framework and may use either existing integrations (i.e. the ModelC Library) or a direct implementation of the Flatbuffer based DSE messaging protocol.

MCL

Foreign models are imported to a simulation using a Model Compatibility Library which may be implemented for any model standard (e.g. FMI MCL).

Realtime

A simulation is deployed in a realtime simulation environment (e.g. HIL) with a combination of distributed and stacked model instances, using a Redis based SimBus, to ensure consistent realtime operation.

Embedded

External models, sensors and ECUs are connected via native protocols (e.g. TCP) to a Point-of-Presence model running within a Simer based simulation.