pyCONSOLE: a Python-based Data Intelligence environment integrated in an Engineering MDO framework

The benefits of a custom data analysis in a MDO framework

Every design engineer working on a Multidisciplinary Design Optimization project frequently needs to integrate data analysis within the MDO process in a custom way, either in a preliminary phase of the design or in the final decision-making process.
Engineers who need to optimize numerical simulation models according to several objectives and requirements may need in fact to analyze and exploit a database of CAE simulations for many different reasons:

  • Find the most significant variables in the process or redefine the problem with a reduced number of variables. 
  • Create and re-use metamodels or classification models to save computational time when performing the simulations.
  • Edit charts and modify design tables for a new series of simulations according to the results of the first analysis.

It follows that it’s fundamental for designers to have the freedom to adapt all the available analysis tools to their particular needs, integrating the available process automation modules with the data analysis ones in a single and customized design framework.

Automation and customization of data analysis may consistently benefit from Python language and the support of its large user community. Indeed, thanks to its simplicity, diffusion and flexibility, Python can be adopted as a valuable custom problem solving tool for any engineer, no matter if a beginner or expert programmer.

To fulfill this need, we introduced in modeFRONTIER a new Python console environment (pyCONSOLE) for custom data analysis.

pyCONSOLE for integrated Data Intelligence in modeFRONTIER

Python technology was already available in the modeFRONTIER workflow editor to automate engineering process simulations.  With the development of the new Python console, the integration is further extended. This technology offers designers the possibility to apply powerful and customized scripts to automate the analysis and perform advanced post-processing and decision-making operations in a single integrated MDO framework. 

To mention just a few benefits, with the modeFRONTIER pyCONSOLE users can: 

  • Include Python scripts or libraries in a single and fully integrated modeFRONTIER project, to interactively analyze data computed by the modeFRONTIER process automation workflow and to directly access the results of the analysis as custom tools in the workflow.   
  • Exploit the power of Python libraries to perform user-defined advanced and automated analysis on the data computed by modeFRONTIER according to their needs. For instance, they can execute a cross-validation of different meta-models, or create a classification or a reduced-order model, that can be used inside the same modeFRONTIER process automation workflow to reduce computational cost or gain better results when performing a numerical optimization.
  • Re-use the same Python scripts in other modeFRONTIER projects for different applications, without the need to re-create charts each time and set-up the tools from scratch. 
  • Enhance the customization of charts exploiting the high-quality potentiality of Python numerical and graphical libraries, and applying their own preferences to a large quantity of charts such as contour plots, derivative plots, multi-history or PDF charts, to mention a few.

Whatever the post-processing operations they need to perform, engineers can benefit from the full integration of Python within modeFRONTIER for several applications and problems. Be it to reduce problem complexity and computational time, or to handle a large number of variables, they can extract data from modeFRONTIER, plot custom charts, or transfer analysis results back in the workflow.

pyCONSOLE to reduce MDO computational time

In this application, the designer needs to recognize the image of an electromagnetic rotor shape, to decide whether to perform or not a simulation with JMAG software during an optimization. It is possible to significantly reduce computational time, being able to avoid the simulation of geometrical configurations that are expected to perform poorly (i.e. to have a low torque).

pyCONSOLE in modeFRONTIER, through the implementation of KERAS neural network available as a public library from Python, allows to perform this operation in an integrated framework. modeFRONTIER executes a Design of Experiments (DOE) sequence of different rotor shapes, whose images are used by the Python console script to train the neural network model. In a second step, the neural network model is used in modeFRONTIER workflow as an intermediate script node between the CAD interface and the JMAG interface, so that, according to the predicted value of torque, the JMAG simulation is performed or is skipped.

With this methodology, the optimization of the electromagnetic rotor has been performed by evaluating less than 40% of the candidate geometries proposed by the optimization, which means that the global simulation time has been almost halved.
In conclusion the pyCONSOLE allowed to:

  • Access a dedicated Python environment directly from modeFRONTIER.
  • Export an advanced deep learning model directly into the modeFRONTIER workflow to speed up the whole optimization process.

pyCONSOLE to deal with many design variables

In this application, the pyCONSOLE exploits an external Python library to perform dimensionality reduction in an engine optimization problem. The challenge is to transform the original design space of 30 input variables into an equivalent space of fewer components, in order to simplify the optimization task and reach the optimal set of solutions analyzing fewer designs than the ones required by the direct optimization.

Adopting in the pyCONSOLE a script based on the Principal Component Analysis (PCA) tool developed by Scikit Learn, we can calculate the principal components of the dataset evaluated by modeFRONTIER and reduce it to the best components only.
From this analysis, the first 14 components result to be responsible for more than 80% of the variance, and the original design space of 30 input variables can be represented by an equivalent space of just 14 variables, without completely discarding the influence of any of the original ones.

The PCA model can then be exported into a CPython script in the modeFRONTIER workflow, to re-convert any design proposed by the optimization algorithm from the new reduced base to the original base, for the execution of the GT-Power automation node (engine simulation).  
The integrated workflow results as follows:

 

This approach allowed us to reach an optimal set of solutions in just 400 designs (orange dots in the chart), where a direct MOGA-II optimization (black triangles in the chart) would have required a larger number of designs to reach the same results.

 

Thanks to the pyCONSOLE, it was therefore possible to efficiently perform different operations:

  • Extract data from modeFRONTIER, post-process and transform them using dedicated and advanced methods.
  • Plot custom chart created with external Python libraries using directly data available from modeFRONTIER.
  • Exploit results obtained from the data analysis directly into the workflow.

Full integration of Python within modeFRONTIER

As clearly illustrated by the applications above, modeFRONTIER fully supports Python, both inside the process integration workflow and in the data analysis environment, enhancing the customer experience with external custom and advanced post-processing tools. Moreover, with the integration of Python, design engineers can make the use of the optimization technology even more efficient and fully adapt modeFRONTIER to their specific needs.

At ESTECO we’re constantly working to expand the potentiality of our software and the integration of the Python scripting language ensures great benefits for all engineers in terms of both process automation and post-processing analysis. Providing all this in a unique integrated framework is what can really make the difference in everyday engineers' tasks. 

 

This article is based on the use cases developed by Gabriele Degrassi and Simone Genovese, Support Engineer and Project Manager at ESTECO.