Electric motor design is a complex dance of trade-offs. Engineers are constantly striving to create motors that are not only powerful and efficient but also lightweight, compact, and cost-effective. Finding the perfect balance between these competing objectives is a monumental task, often requiring thousands of simulations to explore the vast design space. This is where powerful simulation tools like Ansys Motor-CAD come in, allowing for detailed multiphysics analysis of motor designs. However, the challenge remains: how do we efficiently navigate this complex landscape to find the optimal design?
We will first look at the conventional workflow using Ansys optiSLang and then introduce a more efficient and powerful alternative using Bayesian optimization with the Python library Stochos.
The traditional method for optimizing electric motors with Motor-CAD and optiSLang is a multi-stage process that, while effective, can be incredibly time-consuming and computationally expensive. We covered this in greater detail in these previous blogs:
Understanding Sensitivity Analysis in optiSLang: A Deep Dive into Sampling Methods
Building a Robust Metamodel for Electric Motor Optimization with OptiSLang & MotorCAD
The workflow typically involves the following steps:
While this approach can lead to optimized designs, it has a significant drawback: the initial sensitivity analysis is a "brute-force" method that requires a massive number of simulations, many of which may be in uninteresting or poorly performing regions of the design space. This can lead to wasted time and computational resources.
Stochos, a product of PI Probaligence, is a software company that provides solutions in the fields of engineering, paint & coating, and medicine. Their primary focus is on improving the Design of Experiments (DOE) process, making it more efficient, effective, and insightful, especially for applications in coatings and similar chemical industries.
A key feature of Stochos is their unique DIM-GP algorithm, which combines Artificial Neural Networks (ANNs) and Gaussian processes. This algorithm is designed to set new standards in machine learning for complex classification problems and detailed time series analyses. The software is versatile, accepting a wide range of input types, offering numerous covariance functions, and incorporating an advanced feature for automatic noise level estimation and outlier detection.
Stochos offers a more intelligent and efficient approach to our Motor Design problem in the form of Bayesian optimization.
Instead of a large, upfront DoE, Bayesian optimization uses a sequential, adaptive sampling strategy to intelligently explore the design space. Here's how it works:
The Core Idea of Bayesian Optimization
At its heart, Bayesian optimization is a probabilistic approach to optimizing expensive-to-evaluate "black-box" functions (like a Motor-CAD simulation). It works by building a probabilistic model of the objective function and then using that model to decide where to sample next. This process involves two key components:
The Iterative Process
The Bayesian optimization process is iterative:
Stochos is a powerful tool for stochastic optimization that provides the building blocks for implementing Bayesian optimization. It allows engineers and data scientists to apply advanced machine learning models to their simulation and product development workflows.
A key component of Stochos is its use of sophisticated surrogate models. One such model is the Deep Input Mixture of Gaussian Processes (dimgp). At a high level, dimgp is an advanced surrogate model that combines the strengths of deep neural networks and Gaussian Processes. The deep learning component allows the model to handle complex, high-dimensional data, while the Gaussian Process component provides the crucial uncertainty estimates that are essential for Bayesian optimization.
PyMotorCAD is part of the PyAnsys ecosystem that facilitates the use of Motor-CAD within a Python environment in conjunction with other PyAnsys libraries and external Python libraries. It allows you to programmatically create, interact with, and control a Motor-CAD model, with or without using the Motor-CAD GUI. You can achieve Motor-CAD automation by running scripts, either internally via the Motor-CAD Scripting tab or externally. It's an integral component of the PyAnsys ecosystem, simplifies the integration of Motor-CAD into a Python environment, enabling its use alongside other PyAnsys and external Python libraries like Stochos.
PyMotorCAD can be operated in any IDE or in a Jupyter Notebook, as seen below:
By combining Stochos with Motor-CAD, we can create a highly efficient optimization workflow:
The key advantage of the Bayesian optimization approach with Stochos over the traditional optiSLang workflow is efficiency. By intelligently exploring the design space, Bayesian optimization can find optimal solutions with significantly fewer simulations.
Traditional optiSLang Workflow |
Bayesian Optimization with Stochos |
Large, upfront Design of Experiments (DoE) |
Sequential, adaptive sampling |
Builds a static metamodel (MOP) |
Continuously updates a probabilistic surrogate model (dimgp) |
Can waste simulations on unpromising regions |
Focuses computational effort on the most promising regions |
Time-consuming and computationally expensive |
More efficient in terms of time and computational resources |
The integration of Bayesian optimization with powerful simulation tools like Motor-CAD represents a significant step forward in the field of electric motor design. By moving away from brute-force methods and embracing intelligent, adaptive search strategies, engineers can accelerate the design cycle, reduce costs, and ultimately, create better products.
As the demand for high-performance electric motors continues to grow, the adoption of these advanced optimization techniques will be crucial for staying ahead of the curve. The combination of Motor-CAD's detailed multiphysics analysis and the intelligent search capabilities of Stochos provides a powerful toolkit for tackling the complex challenges of modern motor design.
Keep an eye out for our future blog entry where we will give a step-by-step example on using Stochos to optimize a MotorCAD design, and directly compare this with the previous optislang based optimization.