Ebook

Chapter 1

Why Use AI for Simulation and Model-Based Design?


Using Simulink® models throughout your development process, an approach called Model-Based Design, is a proven way to develop complex systems with efficiency and reduced risk. Adding AI techniques to your workflow can save time and improve your designs—and you don’t need to be an AI expert to do it.

There are four main reasons for using AI for simulation and Model-Based Design:

  1. Improve Accuracy: Improve algorithm accuracy by using high-quality training data to build an AI algorithm.
  2. Tame Complexity: Use AI to replace algorithms that would be computationally complex or impossible to model with other methods.
  3. Save Time: Use AI to create reduced-order models of systems when high-fidelity models derived from first principles would take too long to build or simulate.
  4. Work together: Integrate AI models developed in open-source frameworks or MATLAB into system-level designs using Simulink.
section

Use cases of AI in simulations

In this ebook, we’ll cover two main use cases for integrating trained AI models into Simulink:

  • Develop an AI model for an algorithm that will eventually be deployed on an embedded system. For a deep dive into an example, see Chapter 2.
  • Use AI for data-driven plant or environment modeling. The data used to train the AI model could come from hardware or from a high-fidelity simulation model that is too computationally intensive for system-level simulation. For a deep dive into an example of how AI can be used to create a reduced-order model of a high-fidelity component, see Chapter 3.

Embedded algorithm development: This use case includes AI-based controllers, sensors, sensor fusion, image processors, and object detectors that are eventually deployed on an embedded system.

Reduced-order models: Use AI to create a reduced-order model of a complex system that can be used by many engineers to refine and validate system components.

In many instances, an AI model can be used for both use cases. Another option is to leverage Simulink as a dynamic environment for reinforcement learning, a branch of machine learning (ML).

Integrating AI into Model-Based Design for embedded algorithm development enables you to:

  • Experiment with multiple AI models of an algorithm and rapidly compare tradeoffs in accuracy and on-device performance.
  • Evaluate AI models of algorithms for compliance with system requirements before they are deployed.
  • Run your AI models alongside other models within a simulated environment to uncover system integration issues.
  • Test scenarios that would be difficult, expensive, or dangerous to run on hardware or in a physical environment.

Using AI for data-driven reduced-order modeling, you can:

  • Speed up slow high-fidelity model simulations.
  • Accelerate the design using the AI-based reduced-order model early in the design process and use a high-fidelity simulation model later in the design process to validate the results.
  • Perform hardware-in-the-loop testing by verifying your controller design without the complete system hardware.
  • Spend more time exploring edge cases, iterating on the design, and evaluating alternatives.
section

How will you use AI in your system-level design work?

Engineers in every industry can use AI without being AI experts. MathWorks provides easy-to-use interfaces, apps, and examples to make AI approachable.

You can use AI techniques for machine learning and deep learning within familiar vertical applications and learn how to apply these techniques to industry-specific problems.

section

Which user success story would you like to explore?

In this case, a team created an AI-based controller for closed-loop powertrain control.

A Simulink model with three boxes. The middle box is a Simulink model for training an A I-based reinforcement learning controller. The right box models engine dynamics. The left box contains components for reinforcement learning controller.

A reinforcement learning controller for closed-loop powertrain control. (Image credit: Vitesco Technologies)

In this case, a team created a Simulink model of an entire fleet of aircraft to reduce lifecycle costs and increase readiness. The model depends on accurate predictions of fleet performance and maintenance downtime. The team developed a high-fidelity Simulink model of the fleet and then trained an AI model using output data from the Simulink model across a range of scenarios to enable fast analysis.

A row of fighter jets with cabins open and pilots preparing for flight.

An aircraft ready for flight. (Image credit: Lockheed Martin)

In this case, a team created a dynamic shaker rig to help racecar teams make pre-race, track-specific adjustments to improve racing performance. AI models are part of a complex virtual model used to simulate shaker rig performance.

A racecar on a shaker rig.

A dynamic shaker rig helps teams make pre-race performance adjustments. (Image credit: Penske Technology Group)

In this case, a team developed an algorithm that uses AI to automatically detect seizures in video data of patients with epilepsy. Physicians typically monitor patients using electroencephalogram and visual cues, but the approach is labor-intensive and inconvenient for patients.

“We expect to process three times as many patients without expanding our staff. When used in home monitoring, the new technique will further reduce costs by eliminating expensive hospital admissions and clinical observation.”

An array of computer screens showing images of hospital rooms and data.

Detecting epileptic seizures with video. (Image credit: Dutch Epilepsy Clinics Foundation)

To support smart manufacturing using robotic systems, such as a robotic welding system, a team developed an AI algorithm for estimating the position and orientation of the piece to be welded. The algorithm was used in a simulation alongside other algorithms to create a digital twin of the robotic system.

A digital rendering of a robot arm next to an image of the real-world robot arm.

A digital twin helps design, build, and validate a robotic welding system. (Image credit: Hong Kong Applied Science and Technology Research Institute)

“The MBSE digital twin approach reduced integration time by 40% and development time by 30%.”

In this case, an AI model predicts the power demand placed on the fuel cell system. The team used this and other algorithms together to build a system-level simulation of a next-generation fuel system.

“We can simulate our ideas, find errors or inefficiencies, and correct them before testing the algorithm on the system. In other words, MathWorks tools help us take preventative action.”

A gray container the size of two large refrigerators contains foil-wrapped components and other fuel cell systems.

A fuel cell system. (Image credit: Plug Power)

In this case, a team used AI to analyze onboard camera and sensor data for navigation and farm management decisions in a smart electric tractor.

“We’re doing mobility, energy, hydraulics, mechanical power—when you have these very complex systems, it’s hard if you just stick to in-field testing or just the simulation testing. We really needed all of those systems to be synchronized.”

A driverless electric tractor with sensors onboard navigates through a field of grape vines.

A driver-optional smart electric tractor. (Image credit: Monarch Tractor)

In this case, a team created and trained a neural network that implements digital predistortion in a communication system. They also simulated the algorithm with the analog part of the system to understand overall system performance before deploying it.

 Spectrum analyzer graph comparing signals with no D P D, neural network D P D, and memory polynomial D P D.

Apply neural network-based digital predistortion (DPD) to offset the effects of nonlinearities in a power amplifier (PA).