Ebook

Chapter 3

Using AI for Reduced-Order Modeling of Complex Systems


System complexity is increasing. Autonomous systems enable vehicles to navigate unpredictable environments. Wind turbines monitor themselves via digital twins for maintenance needs. Personal smart devices measure sleep activity, label photos, and even plan workouts. Medical devices monitor patients, diagnose disease, and predict personalized outcomes.

In these applications, AI-based algorithms are often part of a larger complex system.

The AI model is sometimes intended to be deployed as part of that system, but it can also be used for reduced-order modeling (ROM). ROM is a means of reducing complexity or storage requirements of a virtual model of a system while preserving the expected fidelity within a controlled error.

Engineers often start modeling components of their system using first principles. The real value of a first-principles model is that results typically have a clear, explainable physical meaning. In addition, behaviors can often be parameterized.

In many cases, however, a high-fidelity model is too computationally intensive to be used for system-level design, especially using HIL or PIL testing that requires a model to run in real time. High-fidelity models may also be time-consuming to derive.

In these cases, consider creating an AI-based reduced-order model.

A high-fidelity model of a car is part of a simulation that includes controllers, environment, and driver blocks that make up a complex, slow-running simulation. Also shown is an alternative A I-based reduced-order model that replaces the car.

Create a ROM by replacing a first-principles model of a car’s engine with a fast, AI-based algorithm. ROM simulations will run faster while still providing acceptable accuracy for system-level testing of control algorithms.

section

Developing AI-based reduced-order models

There are several approaches to creating ROMs, including AI:

  • Physics-based reduction models
  • Model-based techniques
  • Nonlinear Simulink models that are linearized at certain operating points
  • Data-driven approaches, including:
    • Static approaches such as curve-fitting and lookup tables
    • Dynamic approaches such as AI-based models

A ROM can serve as a valuable tool. You can use it to:

  • Accelerate Simulink desktop simulation affected by a third-party high-fidelity model.
  • Enable hardware-in-the-loop (HIL) testing by reducing complexity of a high-fidelity model.
  • Bring 2D and 3D models from other tools into system-level simulation models in Simulink.
  • Develop an AI-based virtual sensor model for use in control software, fault detection, or predictive maintenance.
  • Perform control design.
  • Speed up finite element analysis (FEA) or computational fluid dynamics (CFD) software calculations or optimizations.

AI-based ROMs come with design considerations. It takes a lot of high-quality data to create an accurate AI model. Even when accurate, AI models tend to be likened to a “black box” or, in some cases, a “gray box.” That is, the model’s output might not always be explainable or parameterizable. An AI model also does not enable an engineer to easily incorporate knowledge about the physics of the machine into the model.

Models fall along a spectrum of explainability from so-called black boxes that provide no visibility into output decisions to gray boxes that provide some insights to the full transparency of a first-principles model.

Models fall along a spectrum of explainability from so-called black boxes that provide no visibility into output decisions to gray boxes that provide some insights to the full transparency of a first-principles model.

section

Replace a third-party first-principles engine model with an AI-based ROM

Suppose you are part of a team working on a new vehicle design. You need to simulate a vehicle’s speed based on several inputs and conditions. You will want to create a model that includes components representing the driver, road conditions, controllers, and car engine.

A colleague has provided a vehicle engine subsystem modeled using third-party tools. The resulting simulation will match the real-world system with high fidelity. However, it is running slower than you expected.

A high-fidelity model includes a driver, an environment, controllers, and a car with a complex engine model.

A simulation of vehicle speed will be slow to run if the engine model is a complex model based on first principles.

To speed up your simulations while developing and refining other system components, you can replace that costly third-party engine model with a surrogate or reduced-order model. This may be developed using various techniques, including physics-based (e.g., using Simulink and Simscape) or AI-based methods. In the case of an AI model, the inputs would include engine speed, ignition timing, throttle position, and wastegate valve values, while the output would represent the engine torque.

You can easily switch between components built with different techniques using variants.  With variants you can compare design options, balancing accuracy and performance, without having to comment out parts of your model. This helps you understand the differences and inform your decision on component selection.

section

Generating Data and Training the AI Model

To create the AI model, you’ll need to train it using a data set that varies the relevant inputs and produces the desired output. You can use a public data set or experimental data from your own physical system setup.

You can also use your high-fidelity simulation to generate data. To do this, first design a set of experiments by picking the model parameters and varying their ranges. For instance, speed, ignition timing, and throttle position will each have varying ranges. Use design of experiments (DoE) to create a table listing the possible combinations of parameters, then run the simulation and collect the data.

The complex engine model in the system simulation is replaced by an A I model that takes the same inputs of engine speed, ignition timing, throttle position, and wastegate valve and produces the same output of engine torque.

Replace a high-fidelity model with an AI model.

You can use a range of techniques to create your AI model. For instance, you can use MATLAB to apply machine learning methods or deep learning methods such as LSTMs (long short-term memory networks, recurrent neural networks capable of learning order dependence in sequence prediction problems), neural ODEs (deep learning operations defined by the solution of an ordinary differential equation), or nonlinear ARX models (models that use flexible nonlinear functions, such as wavelet and sigmoid networks, to model complex nonlinear behavior).

You can also interoperate with other open-source frameworks used to train an AI model.

section

Deploying an AI ROM for system-level testing

Once you have created your AI-based ROM, you can deploy it for system-level testing.

If your goal is to test the design and performance of the other components in your system, you may want to run the components you are designing on the target hardware and run the AI model on the desktop. A potential hardware-in-the-loop (HIL) setup involves:

  • Deploying your components onto target hardware platforms
  • Running your AI model on a real-time computer system
  • Linking the systems together and running the simulation, monitoring signals, and adjusting parameters

Once developed, the AI model is modular and reusable. Your colleagues, whether local or in other locations, can also use your AI model in their simulations and component tests, potentially accelerating parallel design and development of the system.

Embedded systems are deployed on target hardware. The A I based R O M is deployed on a real-time computer. The systems interoperate in Simulink for system-level testing.

Perform system-level testing and simulation with the controllers you are testing that run on target hardware and the AI-based ROM that supports the plant model—in this case the car—running on a computer.

section

Selecting an AI Technique

If time permits, you can create several AI models using different techniques and use Simulink to refine them. For instance, you can use Simulink Profiler to see how fast each model runs on a desktop computer. You can also compare outputs from the high-fidelity model with the AI models to gauge accuracy.

To determine the best model for your application, you’ll need to deploy the models and collect all the metrics.

Choosing a model is not always about accuracy. You may need to consider training speed, interpretability, inference speed, or model size. Different methodologies will produce different results—and each specific ROM will produce different pros and cons.

A chart comparing the performance of L S T M, Neural O D E, and two nonlinear A R X models. The nonlinear A R X model has very good inference speed, model size and accuracy, good interpretability, and slower training speed compared to the others.

Different AI models of the vehicle engine ROM have different performance profiles.

Test Your Knowledge