Simulation Compiler Code Generation for Real-Time HIL

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing simulation models struggle to execute in real-time on hardware-in-the-loop (HIL) simulations due to computational overhead, leading to potential overruns and suboptimal performance, especially when dealing with complex physical component models.

Innovation Solution

A system and method that transforms an acausal simulation model into a causal form suitable for real-time execution by using a simulation model compiler that includes an equation generator, partitioning engine, discretizer, and optimizer, which generates machine instructions for efficient execution on target hardware.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If acausal physical component models are used for simulation, then modeling flexibility and ease of use are improved, but computational overhead increases leading to real-time execution failures

Engineering Contradiction:
Improvemodeling flexibilityVSAvoidreal-time execution capability
Core Design Contradiction:
Ease of operationVSProductivity

Solution Approach 1:

The patent segments the acausal model execution into distinct phases: symbolic manipulation phase for model compilation and numerical evaluation phase for real-time simulation. By separating these phases, the computationally intensive symbolic manipulation is performed offline to generate optimized code, while the online phase only requires lightweight numerical evaluation, enabling real-time execution while maintaining modeling flexibility.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary symbolic manipulation and code generation during the model compilation phase before real-time simulation begins. This preliminary action pre-computes the execution plan and generates optimized machine code, so that during real-time execution, only straightforward numerical evaluation is needed, eliminating the computational overhead during critical real-time operation.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If complex physical component models are executed on target hardware, then model fidelity is improved, but computational overhead causes overruns and performance degradation

Engineering Contradiction:
Improvemodel fidelityVSAvoidcomputational overrun
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent creates an optimized copy of the acausal model in the form of machine code during the compilation phase. This generated code replicates the model's computational logic but in a highly optimized form tailored to the target hardware architecture, allowing faithful reproduction of model behavior with minimal computational overhead during real-time execution on hardware-in-the-loop systems.

Inventive Principle:
Principle #26Copying

3Productivity

If acausal models are transformed to causal form for real-time execution, then real-time performance is improved, but model complexity and transformation overhead increase

Engineering Contradiction:
Improvereal-time execution efficiencyVSAvoidmodel transformation complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent introduces an intermediary code generation step that translates acausal model definitions into optimized causal execution code. This intermediary process acts as a mediator between the high-level acausal model specification and the low-level real-time execution requirements, automatically handling the complex transformation logic through symbolic manipulation and code synthesis rather than requiring manual model restructuring.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS11354463B1Systems and methods for generating code for computer-based physical models
Publication Date: 2022.06.07 MATHWORKS INC
  • US11354463B1 patent drawing
  • US11354463B1 patent drawing
  • US11354463B1 patent drawing

AI summary

A solver may generate a system of equations for an acausal model. A partitioning engine may transform at least some of the equations into groups of equations whose inputs/outputs are connected directly. The partitioning engine may transform at least some of the equations into groups of linear equations and/or groups of switched linear equations that are connected through nonlinear functions. The solver may determine input-output relationships of the groups of equations. A simulation model generator that may include a library of types of model elements may construct a causal simulation model.