Blog post

Instantly predict design behavior with Python based Response Surface Models

Nov 29 2022 · 5 min read

Physics-based design optimization is essential in simulation-driven development to get reliable insights on the performance of real products. However, assessing the behavior of complex designs often requires a large number of simulations which can be both time consuming and computational expensive. In such circumstances, you should opt for statistical-based Response Surface Models (RSM) to approximate, analyze and simulate complex real world systems. With this approach, you can get an instant and accurate insight into the relationship between a set of design parameters and one or more design objectives. Then, you can use it to perform RSM-based optimization. This is helpful in all those situations where a simulation based on real-physics models would not be affordable in terms of computational time. But what about combining RSM with Python Machine Learning libraries?

RSM training with Python Machine Learning libraries

RSM or metamodels are statistical and numerical models that approximate the input and output behavior of the system. The idea is to run physics-based simulations on a limited number of designs and use them to create a mathematical function able to predict the behavior of the response variables more or less accurately. The behavior of the RSM model is determined by the algorithm and its parameters set by the user, which are computed by modeFRONTIER during the training phase.

All of this could already be familiar to anyone who has already used RSM techniques in the past. But there is more than this. In the engineering simulation world, deep expertise in scripting languages became a valuable skill set to perform data analysis. Python programming language gained popularity over the last decade due to its simplicity and flexibility. Its numerous Machine Learning (ML) libraries can be also beneficial to train and evaluate RSM.

TensorFlow, the TensorFlow logo and any related marks are trademarks of Google Inc.

Python-based RSM with modeFRONTIER

The creation of meta-models can be a complex and laborious task, especially in situations where high accuracy is required. With modeFRONTIER process automation and design optimization software, you can generate reliable metamodels that are effective in approximating the multivariate input/output behavior of complex systems with little computational effort. With the pyCONSOLE, the environment that integrates Python and the design space, you can evaluate RSM with the algorithms available in the Python world. The pyRSM module now adds the capabilities to train Python algorithms as RSM. This means using external Python Machine Learning libraries (such as scikit-learn) within modeFRONTIER to perform RSM analyses, with all the benefits that a modeFRONTIER RSM entails (sharing, charts creation, etc.).

Python script included in pyRSM for multi-fidelity RSM training in modeFRONTIER

Both training and evaluation features available for modeFRONTIER native RSM are also available for Python-based RSM. Basically, you can code your own Python algorithm in the script to train the model and evaluate it with exactly the same chart as modeFRONTIER native RSM.

With Python you can explore the complexity of training an accurate RSM model not only by giving access to the most advanced ML algorithms, but also by enabling a very flexible training strategy to build the most effective model for the dataset under consideration. As an example, multi-fidelity modeling, where the training strategy is able to leverage training data of different accuracy, can be quickly implemented by using dedicated python libraries, as you will see in the following use case.

Application scenario: multi-fidelity Python-based RSM for airfoil aerodynamics optimization

The overall computational cost to train metamodels is generally lower than the one required by an optimization fed directly by numerical simulations. However, the computational cost to generate the training dataset can still be relevant in many cases, especially with high-fidelity (HF) simulations.

Multi-fidelity methodologies have been introduced to combine HF simulations with middle or low-fidelity ones (MF/LF), to train efficiently meta-models with a significantly lower computational cost. LF models can be obtained for instance from a model grid that is coarser than the HF one, or from a simulation model which introduces a higher level of approximation still keeping a good accuracy in the results. To prove the efficiency of the multi-fidelity methodology, it has been applied to an aeronautical test case.

Baseline airfoil simulation (NACA0012, aoa=4°; Flow conditions: M=0.6, Re=1.35E7)

A NACA0012 airfoil, in transonic conditions at Mach=0.6, Re=1.35E7, and angle of attack of 4°, has been simulated using ANSYS Fluent software, using two grids of different quality: the coarser grid (LF) has 30,000 elements while the refined one (HF) has 150,000 elements.

NACA0012 airfoil: LF grid 30,000 elements (left), HF grid 150,000 elements (right)

The baseline airfoil is parameterized in the modeFRONTIER workflow by adding two parametric Bezier curves of 4 control points on the upper and lower baseline profiles. The goal of the study is to train a Response Surface to predict the aerodynamic coefficients in function of the 8 parameters.

modeFRONTIER workflow for aerodynamic performances evaluation

First, a uniform DOE of 50 LF simulations has been executed. Selecting by the Dataset Reducer DOE of modeFRONTIER the optimal subset of training points, 10 optimal sampling points have been re-evaluated by the HF grid.

Dataset Reducer methodology for multi-fidelity meta-models training

The dataset made by the combination of 50 LF and 10 HF simulations is selected as a training set in the RSM Wizard of modeFRONTIER. Selecting the pyRSM module, it is then possible to import a Python script which calls the Multi-fidelity Cokriging algorithm from the public library of Surrogate Modeling Toolbox of University of Michigan.

Cokriging is a multi-fidelity surrogate model based on Bayesian theory, which aims at exploiting the cross-correlation between two or more Gaussian process surrogates through a stochastic auto-regressive scheme, yielding a predictive posterior distribution for the high-fidelity model output that encodes the contribution of lower fidelity levels with quantified uncertainty.

Performance of multi-fidelity RSM and 3D RSM chart in modeFRONTIER

As result, the Cokigring RSM has proved to be more efficient than a single-fidelity RSM trained on the set of HF simulations only. The RSM trained by pyRSM can be used for every chart and tool, including RSM-based optimization, available in modeFRONTIER.

In conclusion, python RSM bridge in modeFRONTIER is a very effective way of dealing with complexity, at any level, when creating RSM models that have to be as accurate as possible to be used with confidence in your simulation design workflow. In this way, both the most advanced algorithms and flexible and customizable training strategies becomes an option, together with modeFRONTIER consolidated native RSMs.

Riccardo Di Meo

Riccardo Di Meo is a software developer at ESTECO. He holds a bachelor's degree in Physics from the University of Trieste. Before joining ESTECO in 2017, he participated in several successful GRID and HPC projects and collaborations with different scientific institutions; later, he moved to the private sector to work on medical and pharmaceutical mobile apps. He is currently leading the effort to provide Python-based functionalities in the ESTECO software solutions.

Alessandro Viola

Alessandro Viola is a Product Marketing Specialist at ESTECO. He graduated with a Master of Science in Business Administration and Strategic Control from the University of Trieste. Prior to joining ESTECO in 2016, he worked for a consulting company that assists companies to access business opportunities in the Central and Eastern European markets. He also was part of a start-up founding team, based in Brussels (Belgium), focused on providing an innovative e-learning platform and training for European project stakeholders.

Alberto Clarich

Alberto Clarich is Head of Engineering Team at ESTECO and member of NAFEMS Italy Steering Commitee. He received a PhD in “Innovative Parameterisation and Optimisation Methodologies in Aeronautic Field”, University of Trieste (2003), in collaboration with Dassault Aviation, having a background as Mechanical Engineer. He begun working at ESTECO in 2004 as Optimization expert.

Danilo Di Stefano

Danilo Di Stefano is the modeFRONTIER product manager at ESTECO. He graduated in Physical Chemistry from the University of Padova, and completed a Master's programme in Bioinformatics at the University of Bologna. After three years of experience as a Scientist at the Area Science Park (National Research Institution, Italy) in the design and implementation of data mining software, he joined ESTECO, working as an internal data mining consultant and business development in the pharmaceutical market.

Design better products faster

modeFRONTIER is the leading software solution for simulation process automation and design optimization