ANSYS DOE and Design Optimization Tutorial

by Max Yi Ren and Aditya Vipradas

Table of Contents

  1. Introduction
  2. A Running Example
    1. Description of the brake design problem
    2. Static structural setup
    3. Modal setup
    4. Transient thermal setup
    5. Transfering geometry and model across analysis modules
    6. Define input parameters
  3. Background Knowledge
  4. Design of Experiments
  5. Sensitivity Analysis
  6. Optimization
  7. Checklist

Introduction

This is a step-by-step tutorial of the ANSYS Design of Experiment (DOE) and Optimization tools. These tools will allow you to better validate and understand your engineering model and further refine your design for specific properties of interest. We will skip some mathematical details but focus on explaining how things should be done.

We encourage you to also read related chapters in the official ANSYS Design Exploration User’s Guide.

NOTE: This tutorial is tested on ANSYS 16, 17.1 and 17.2.


A Running Example

Before we start, please prepare the CAD model of your design and determine attributes that you want to design for. You can also use the following sample problem on vehicle brake design. The model file of the brake can be downloaded here (.agdb). The raw model is here (.stp). All credits go to A. Durgude, A. Vipradas, S. Kishore, and S. Nimse (see their MAE598 Design Optimization project report (2016)).

Description of the brake design problem

To summarize, the brake design problem has the following objectives:

The three subsystems are as follows:

The following sections describes how these analysis are set up.

Static structural setup

Drawing

Drawing

Drawing

Drawing Drawing

Drawing Drawing

Drawing

Drawing

Drawing

Drawing

Drawing

Drawing

Drawing

Transient thermal setup

Drawing

Drawing

Drawing

Drawing Drawing

Drawing

Drawing

Transfering geometry and model across analysis modules

Consider that you have performed a Static Structural Analysis, you can use the mesh created from this analysis to perform another analysis, say a modal analysis. The followings steps show how this is done.

  1. To copy the geometry to another analysis

  2. Hold on the Modal module

Drawing

  1. Drag onto the tab of the Static Structural Module

Drawing

  1. The geometry is shared

Drawing

This is generally performed when two different analyses are to be performed on the same geometry. You will have to do the mesh again.

  1. To share the mesh, boundary conditions setup and results

  2. Hold on the Modal module

  3. Drag on the Model or Solution tab of the Static Structural module

Drawing

  1. The mesh, setup and results are shared

Drawing

This is generally performed when results from one analysis are to be shared with another analysis. For instance, these steps can be used to perform pre-stressed modal analysis where results from static structural analysis are shared with modal analysis.

NOTE: You have only these two options. There is no option to just share the mesh.

Define input parameters

The input parameters are the design variables. To set these up, click on the Geometry tab of the static structural box. Parametrize the outer diameter, inner diameter and thickness of the brake disc. Click on Sketch 1 as shown.

Drawing

Select the dimensions as input parameters as shown in the figure by hitting the checkbox.

Drawing


Background Knowledge for DOE and Optimization

We first need to define some terminologies for a design problem:

NOTE: In ANSYS and some other software, the difference between parameters and variables is not distinguished. So when you see “parameters”, it might actually mean “variables”.

Drawing

Optimization is the iterative process for finding a design that maximizes or minimizes the objective by searching the design space. There are two major schools of optimization algorithms: gradient-based methods are useful when the objective is differentiable (in many mathematical and machine learning problems). They are fast but can only find local solutions; Gradient-free methods are useful when the evaluation of the objective (and its gradient) is expensive or when the gradient is noisy. Ansys offers both options.

Drawing

DOE: Many engineering design problems have objectives that are evaluated through expensive simulations/experiments, e.g., CFD analysis. In such cases, each function evaluation during the optimization takes a long time, and thus could making the optimization intractable. DOE is a set of methodologies that determine which design to evaluate from a potentially large design space, so that we can create a statistical model to predict the objective values of other designs with low uncertainty in prediction. Through the predictive model, we can also tell the sensitivity of variables, i.e., whether the objective changes much with respect to each of the variables. DOE is often used as part of the gradient-free optimization algorithm.


Design of Experiments

DOE is used to effectively sample a design space (e.g., all design parameters for the brake disc) so that a statistical model can be built to predict responses (e.g., the maximum stress, or the first natural frequency, or the maximum temperature) of a given design. DOE is useful when one can only sample a limited number of points (i.e., run a limited number of simulations). The key idea of DOE is to ``spread out’’ the samples so that the resultant statistical model has low uncertainty in its model estimation and thus high accuracy in prediction.

Step 1: Define parameters and responses

To conduct DOE for a given model, we shall first define the list of design variables and objectives that we care about (In Ansys, these are called input and output parameters). To do so, open the “Project Schematic” window, which shall look like this:

Drawing

Step 2: Choose a Design Exploration method

In the Design Exploration window, find “Response Surface”. This will allow us to perform DOE for the purpose of creating a predictive model, called a response surface. Drag the “Response Surface” tab from the Toolbox on any one dashed box near “Parameter Set”.

Drawing

Step 3: Choose a DOE method

While ANSYS provides various DOE methods, we suggest Latin Hypercube Sampling (LHS) and Optimal space filling with user defined sample points. The main advantage of these methods is that the number of samples is independent from the number of parameters. Another (more advanced) choice is sparse grid, which only samples a few points initially and adaptively add new sample points based on the response surface. Kriging with auto-refinement has a similar effect. Note, we do not recommend Central Composite Design (CCD) because in many cases, the objective cannot be approximated as a quadratic function, and CCD requires a large number of samples for relatively small number of variables.

Click on the “Design of Experiments” option and select the required DOE and Design type:

Drawing

If you double click on the “Design of Experiments” tab, a new window opens where you see your input and output parameters.

Drawing

You can set the lower and upper bounds of each input parameter by clicking on that parameter.

Drawing

After setting the input parameter bounds, hit “Preview” to see the list of DOE points according to your settings.

Drawing Drawing

Now hit “update” and brew your coffee. Depending on how many samples you requested, it will take hours to days for DOE to finish.

NOTE: Some of your DOE samples may not be evaluated successfully due to significant change in geometry. In the brake disk example, if the outer radius of the disk is changed to be smaller than the outer radius of the pads, the friction contact setting will need to be reset manually due to mesh change. When this happens, it could indicate that some of the designs sampled by DOE are not meaningful, e.g., having the brake pads partially cover the disk is not a good design after all. It could also happen that you do want to evaluate these designs. To do so, first manually fix issues due to parameter changes, and run the simulation(s) manually. You can then download the current DOE results, add in these manually derived data, and upload the data table to ANSYS.

Step 4: Create a response surface

The DOE results can be used to create a response surface for prediction purpose. ANSYS provides the following list of response surface methods:

To create a response surface, click on the “Response Surface” option in the Project Schematic window:

Drawing

A new window opens. Choose the type of response surface you need. And then hit on the “Update” button.

Common issues in DOE and response surface

My model has a bad fit, what shall I do?: There are two ways to improve the goodness of fit: (1) increase the sample size in DOE; and (2) increase the “complexity” of the response surface. To perform the latter, one can simply choose a high-order polynomial model or a non-parametric model such as Kriging and Non-parametric Regression.

Wow, now my model has a perfect fit, is that good?: The short answer is NO. While increasing the “complexity” lowers the “training error”, i.e., the error between the model and the data used to train the model, it is not recommended to use this method to push the goodness of fit to the limit. In fact, with non-parametric models, it is always possible to perfectly fit through all data points (one can always connect all dots manually). But by doing this, we may very likely overfit the model, so that it actually has worse prediction performance than a model with higher training error. To summarize the theory behind this, A model has better prediction performance when: the training error is low, and the model complexity is also low. Note that this is essentially what Occam’s Razor says.

So how can we determine which model is the best? A common practice is to use a judge, or called verification points. The idea is to set some data we collected aside, and never use them for training the model, but only use them for calculating the error, which is called the validation error. The rationale is that if the model can fit well with these data without using them for training, then it has good predictability.

To perform verification in Ansys, click on the “Response Surface” as shown in the figure below. Check “Generate Verification Points” and enter the number of verification points. There is not really a rule on how many verification points you should use, but 1/4 or 1/3 of your total sample size is practically reasonable.

Drawing

What if my verification result is bad? This can commonly happen if (1) your sample size is small, or (2) the underlying response is highly nonlinear, or (3) the choice of response surface is too flexible (e.g., Kriging), thus causing overfit. To address this issue, you can (1) increase the sample size, (2) try a different model. Note that in ANSYS, you can include the verfication points as refinement points, which will lead to better goodness of fit. To do so, right click on the verification point. One shall then increase the number of verification points in the response surface setting before updating the response surface (or otherwise all points are used for fitting the response surface, leading to overfitting again).

When shall I stop refinement? If the goal of creating the response surface is solely to use the surface for predicting responses, then one shall make sure that with enough verification points, the error in prediction is limited. ANSYS provides a three-star rating on the goodness of fit of the response surface for verification points for this purpose.

If the goal is to perform optimization, an accurate response surface is not necessary. Therefore with a relatively accurate surface model, one can move on to the optimization. Since the optimization is performed based on the response surface rather than the true simulations, a discrepancy may exist between the predicted and the true responses. ANSYS reports both numbers for the set of near-optimal solutions it finds. If the discrepancy is significant, one shall set these solutions as refinement points of the response surface, and run optimization again upon the refined surface. A smarter approach is the Bayesian Optimization algorithm. For interested readers, see this review of BO.

** What is verification and validation?**: “Validation” is often referred to as testing a design in reality (with experiments) while “verification” means testing the design with simulations.

Sensitivity Analysis

Building the response surface also allows us to perform sensitivity analysis, i.e., to see how much the objective changes when each variable changes. When a large number of variables exist, sensitivity analysis allows us to figure out the most important variables to design for, and thus reduce the computational cost of the optimization.

To perform sensitivity analysis, go to the “Response Surface” tab. The options for the sensitivity analysis are as shown in the figure below.

Drawing

Here, “Local Sensitivity” shows the norm of the partial derivatives of the chosen objective with respect to the selected variables:

Drawing

“Local Sensitivity Curves” shows the response curve of the chosen objective (Y-axis) with respect to the selected variables (X-axis):

Drawing


Optimization

Single-objective vs. Multi-objective

There is rarely a design case where we only want to optimize a single response. In the running example, a set of objectives are listed. However, finding a Utopian design that simultaneously optimizes all objectives is unachievable in reality. This is because for a reasonable problem setting, there always exist conflicts among objectives. There are two solutions to this: (1) One can set one of the objectives as the objective in ANSYS, and the rest as constraints. By changing the constraints, one can derive a sequence of optimal solutions. This set of solutions is call Pareto Optimal, and a surface spanned in the space of objectives fitting through these solutions is call the Pareto frontier. For cases with two (three) objectives, it is called the Pareto curve (Pareto surface). Deriving the Pareto frontier is often more valuable than obtaining a single optimal solution, since the former reveals quantitatively how conflicting objectives trade off for the design problem of interest. % need a figure here.

Optimization algorithms

ANSYS provides a list of optimization algorithms:


Things to check during your analysis and optimization

Drawing