Fast Simulation Code – MapleSim – Modeling and Simulation

Fast Simulation Code

With blazingly fast simulation code, MapleSim models are ideal for testing high-fidelity and hardware-in-the loop applications, and for creating datasets used to train neural networks and autonomous vehicles.

Add model complexity without compromising simulation speed

Whether you are working on hardware, software, or operator-in-the-loop applications, it is critical that your system models have the fidelity to provide accurate results but can still run on a real-time platform within the simulation time step.

With MapleSim, you do not have to choose between model fidelity and real-time performance. 

  • Develop code with the fastest possible execution time for your model. 
  • Maintain model integrity throughout the code optimization process using MapleSim's lossless equation simplification.  
  • Tune your model with domain-specific components and specialist applications from the MapleSim add-on libraries
  • Integrate the MapleSim simulation code into popular real-time toolchains and other target destination applications, royalty-free. 
  • Replace the physical components of Hardware-in-the-Loop (HIL) simulations with a virtual HIL model when testing and designing vehicle control systems.

With MapleSim or MapleSim with a connectivity add-on, engineers have many options for compatible code generation targets. Learn more about optimized code generation in MapleSim.

Learn more about optimized code generation in MapleSim.


vehicle suspension testing example image
Reduce computational effort using fast, royalty-free code

Reduce computational effort using fast, royalty-free code

MapleSim’s simulation code is fast, royalty-free and computationally efficient, making it perfect for a wide range of applications in new product development.

To achieve the fastest possible simulation run times, MapleSim makes use of  next-generation symbolic computation techniques developed over 30+ years of research and development, and applied in a 2-step process.

MapleSim applies symbolic simplification, including index reduction, differential elimination, separation of independent systems, and elimination of redundant systems and complexities that would cause other tools to fail during numerical simulation.  These simplifications do not cause any change in the fidelity of the model

MapleSim next performs symbolic optimization, using the compact, internal structure of these equations to generate highly efficient code – identifying common expressions and sub-expressions and ensuring they are only computed once.

This leads to computationally efficient models and generates faster code.  This is particularly important for Hardware-in-the-Loop (HIL) applications because it allows an engineer to develop higher fidelity models while maintaining real-time performance.

The powerful symbolic modeling engine in MapleSim provides many advantages most other simulation tools simply cannot match, from automatically generated system equations to real-time product testing for complex systems.

MapleSim's optimization in action

The following chart, which includes data from automotive use cases, shows dramatic improvements in computational efficiency following MapleSim’s simplification and symbolic optimization steps.

MapleSim's optimization in action

As an example, design engineers used MapleSim to develop a full-vehicle multibody model of a new Chevrolet sports utility vehicle with pneumatic tires (22 degrees-of-freedom and 26 state-space variables) and export the model to a dSpace simulator (using third-party tools). Even a modest performance simulator (a 1 GHz PowerPC) achieved model update rates of 63 µs. This was at least 16 times faster than the most popular existing tools.

Generate testbed data to train neural networks

The latest wave of smart products and machines are built to make use of large quantities of sensor data as they operate. When training the AI responses, the product needs to be exposed to a vast number of scenarios which are time consuming to manage.

MapleSim models can speed up the testing and training of neural networks by efficiently generating subsets of data to use as inputs during product testing.

  • Rapidly produce training data for test scenarios across different machine configurations.
  • Generate test data for “what if” scenarios where real-world data is difficult to collect.
  • Produce data in a virtual environment representing systems operating in extreme conditions without harming hardware or operators.
  • Add multiple engineering domains to the simulation to capture additional dynamics in the training data.

The test data generated with MapleSim is being used across many different industries. Examples include:

  • Vehicle ride comfort – simulate suspensions when travelling over custom terrain scenarios by using the MapleSim Tire and MapleSim Driveline add-on component libraries.
  • HEV and EV battery state – incorporate physics-based predictive models of battery cells into system level models using the MapleSim Battery Library.

Industry Examples:

AISIN AW – Hardware-in-the-loop applications for transmission testing

At AISIN AW, hardware-in-the-loop (HIL) simulation is extensively used to accelerate the development of automatic transmissions. The plant models for HIL simulations require sufficiently high fidelity to accurately represent the aspect of the system dynamics important to the designers. At the same time, these models required a low calculation cost to enable real-time execution. After a formal evaluation of available software, MapleSim modeling and simulation software together with the Driveline Component Library was chosen by AISIN AW to create real-time capable gear train plant models for their HIL simulations.

The MapleSim Driveline Component Library provided a specialized set of components designed to help transmission manufacturers – as well as other automotive developers – to conveniently create plant models for control and simulation. The model was created to include clutches, brakes, and various gear sets. Benefiting from the power of symbolic computing, MapleSim generated extremely fast code that is critical when simulating a complex system with a large number of interactions in real-time.

The optimized c-code generated by MapleSim from transmission plant models enabled AISIN AW to perform more detailed HiL simulations. In a sample case study, it was shown that the s-function code generated by MapleSim ran twice as fast as the s-function generated by a similar tool. In addition to making use of MapleSim’s built-in component library, custom components were also easily developed. MapleSim allowed the team to create high fidelity models in a short period of time and played a key role in the project success.

AISIN AW – Hardware-in-the-loop applications for transmission testing
Creating High Fidelity Physical Models of Hybrid and Electric Vehicle Batteries
NSERC/Toyota - Creating High Fidelity Physical Models of Hybrid and Electric Vehicle Batteries

One of the most important components of a hybrid-electric or fully electric vehicle is the battery. Having a good virtual model of the battery is essential so that both battery behavior and the physical interaction of the battery with all the other components are properly reflected in the model.

The research by NSERC/Toyota (with support from Maplesoft) required a detailed model of the vehicle including the battery that would respond to changes in motor conditions with different terrain and power controllers. They chose MapleSim because the symbolic approach in MapleSim allowed creation of simulation models that have fast real-time speeds for hardware-in-the-loop (HIL) testing and very high fidelity compared to models created in conventional modeling tools.

MapleSim was also used to develop a multi-domain model of a Hybrid-Electric Vehicle (HEV), including an automatically generated optimized set of governing equations. The HEV model consists of a mean-value internal combustion engine (ICE), DC motors driven by a chemistry-based NiMH battery pack, and a multibody vehicle model. Simulations were then used to demonstrate the performance of the developed HEV system.

Simulation results showed that the model was viable and, as a result of MapleSim’s lossless symbolic techniques, the number of governing equations was significantly reduced, resulting in a computationally efficient system. This HEV model can be used for design, control, and prediction of vehicle handling performance under different driving scenarios. The model can also be used for sensitivity analysis, model reduction, and real-time applications such as HIL simulations.

“With the use of MapleSim, the development time of these models is significantly reduced, and the system representations are much closer to the physics of the actual systems,” said Dr. John McPhee, the NSERC/Toyota/Maplesoft Industrial Research Chair for Mathematics-based Modeling and Design.

Services and Solutions

Expand your modeling capabilities into specialist fields with the MapleSim add-on libraries

Maplesoft Engineering Solutions can provide you with expertise and technology to meet your project requirements quickly. Professional services include product design validation and optimization; code development for in-the-loop simulations; analysis & design calculation tools; and customized training.

Turnkey solutions from Maplesoft Engineering Solutions offer a low-effort way to test out virtual commissioning for your own projects by fast-tracking delivery of an initial model – no previous modeling expertise is required.