Tutorial II: Xfoil

In this tutorial you will learn the advanced settings and features from an already prepared case. It is recommended to do this tutorial after the Tutorial I: Borehole

Introduction: #

For this tutorial we are going to use as test problem, the optimization of the glide ratio of an airfoil using Xfoil. In this problem, there are 11 variables, 10 of them are geometrical parameters of the airfoil and the last one is the Reynolds number.

To simplify the process, and to reduce the computational cost in the user computer, all the files are already provided. That means, that there is no need to download the Xfoil software, to run or change any file, and that is possible to change the step order of the tutorial.

Where to find it: #

Necessary files can be found on the Member Area section of our website

Download -> Tutorial Cases -> Xfoil

It contains all the files needed to perform the task so the user does not need to run or generate new/additional files:

  • Xfoil.uptim: Identifier of the Project
  • InputSet.txt: Contains general information about each input distribution and its parameters
  • InputDomain.txt: Values of input distribution boundaries and coordinates of the nominal solution
  • XDis.txt: Matrix of input distribution values – each column for one input distribution
  • UptimRes.json: Contains all the information about the setup for the solver
  • Xfoil_O1_C1.json, Xfoil_O2_C2.json, Xfoil_O2_C3.json: Contains all the general information for the postprocess
  • Xfoil_it.json: Contains the data from all the simulations performed
  • Xfoil_interp_O1_C1.json: Contains information about the model, to interpolate new samples
  • Progress_iterative_store_file_O1_C1.json: Contains information about the progress of the core solver

Starting the process: #

Main window: #

The functionality of the Main UptimAI window is to guide you through the statistical process. It can create or load projects, and run all the different parts of the UptimAI software package.

Step 1: Download and save all the required files in a folder named Xfoil (the project folder has to have the same name that the .uptim file)

Step 2: Open the main window of UptimAI software and load the project.

File -> Load -> Xfoil.uptim

Input Preprocess: #

Input Preprocess is a GUI to prepare and check the input distributions for all your input variables.

Step 3: Duplicate the preprocess files (InputSet.txt, InputDomain.txt and XDis.txt), to be able to modify the files without losing the originals.

Step 4: Open the Input Preprocess, go to method UQ and load the prepared InputSet.txt.

File -> Load -> InputSet.txt

Step 5: Change the distribution from the last variable (beta_te) to a User Defined distribution.

Step 6: Set the boundaries to Min=3.0 and Max=9.0

Step 7: Define the distribution with the following three points. You can do it both from the design area or writing in the table of the right.

xy
Point 13.00.3
Point 26.00.6
Point 39.00.0

Step 8: Save the current distribution shape under the current input variable name and close the GUI. In the project folder, a file beta_be.txt file will appear. This file contains all the information about the user created distribution, and can be used for other projects.

Step 9: Click the prepare button, and a new table with the distribution options will appear. Change the nominal value of the first variable (re) to 1000000.

Tip: The nominal value should always be within (but not equal to) distribution boundaries. It is recommended for the nominal solution to be no more than 10% of the input distribution range away from input distribution mean.

Step 10: Generate the files.

Tip: These files has an standard format that makes it possible to change the input variables directly editing these files instead of using the Input Preprocessor. Nevertheless, remember of generating a new set of samples for the XDis when changing the numerical values of the distributions.

  • InputSet.txt:
  • InputDomain.txt:
  • XDis.txt:

Step 11: Go to Methods – Histogram, and load the variables (InputSet.txt), XDis, and Input Domain using the red buttons that are just above the options of the graphics.

Step 12: Display the distribution of the beta_be variable, clicking the button under its name

Step 13: Now you can see the distribution created before. You can change the title, labels, colors of the histograms and much more under the Options Set. After that you can save the plot via:

File -> Save

Step 14: Replace the new preprocess files (InputSet, InputDomain and XDis) with the older ones.

Step 15: Close the Input preprocess and open the Core Solver Setup.

Core Solver Setup: #

Core Solver Setup is a GUI to define the settings for the Core Solver and the Postprocess.

Step 16: Load the UptimRes.json provided

Step 17: Check the Output section. In this case as there are multiple studies, there are also multiple tabs in the output section, there is one study for the first output, and two studies for the second output (with different numerical setups).

Tip: It’s more efficient to have multiple studies that run the same problem separately for each output, as the algorithm reuses the samples to reduce to the minimum the number of simulations performed.

Tip: In the details button at the right of the settings is a quick reference to show the possibilities of each choice.

Step 18: In the pipeline section you can choose the name of the output files

Step 19: The coupling section is very important as it is where is located the path to the coupling script. If you want to run a loaded setup from another computer, you will need to change it and generate the setup files again.

Tip: You can similarly than in the Input Preprocess, change the settings from the UptimRes.json directly editing the file instead of with the user interface. The structure is the following:

Step 20: Close the Core Solver Setup

.

Result Postprocess: #

Result postprocess is a GUI that allows to evaluate Uncertainty Quantification results obtained in the core solver.

Step 21: Open the Result PostProcess

Sensitivity Analysis: #

The Sensitivity Analysis quantifies the response of mean and variance of results to change in certain variables and their increment functions. It is very useful at early stages of the postprocess to check which variables are more important, and which can be neglected as they don’t have any influence in the results.

Step 22: Open the results file from the Glide Ratio (1st study)

File -> Load -> Xfoil_O1_C1.json

Tip: The name of the results files is using the following name convention

project_name_On_Cm.json

Being n, the number of output and m the number of case solved

Step 23: There are two basic modes for the sensitivity Analysis. The difference is that in the variable mode it quantifies the importance of each individual parameter, and in the increment functions is comparing the increment functions to check for example if the interactions are important. Open the Sensitivity Analysis – increment.

Step 24: Now display all the increment functions. If you want to see the data in a table format, you can do so selecting the Text Form switch.

Step 25: You can save the table to a .xls format, similarly to the plot (it will save what you have displayed at the moment)

File -> Save

Increment Function #

The Increment Function feature allows to visualizes the response of the output to changes in an input variable or combination of input variables. It allows a fast analysis of which are the range of input variables that minimize or maximize the output.

Step 26: Open the Increment Function

Increment Function -> Increment

Tip: The difference between the increment and the total increment mode is that, in the increment is shown the response of the output to changes in an input variable or combination of input variables. Instead, in the total increment is shown the cumulative effect of all increment functions related to the selected variables.

Step 27: Plot the dF1 Increment Function to see the computed function points and the interpolated increment function.

Tip: Use View Details of Points button to get the exact value of increment in computed function point and retrieve its coordinates in all dimensions. The point itself will be highlighted on the figure.
Rows with interpolated points are highlighted in yellow. The interpolation is used in case of a failure of the computation to replace the NaN values.

Step 28: Press the Total Increment button, and select increment functions of interest from the list of available increments

Step 29: Turn the Scale on, to compare ranges of increment functions against each other

Step 30: Adjust the look and labels of the plot in the Options section and click the Apply button to display any changes

Function Plot #

Standard plot that represents the detailed mathematical model walkthrough. It can compute the absolute value of the output based on given input values combination, and plot 2D and 3D graphs with up to 2 variables undetermined.

Step 31: Open the visualize mode of the Function Plot

Step 32: Write the combination of inputs desires, and select apply (without selecting any variable) to see the result from the model for this specific point

Step 33: Now, select 1 or 2 variables to see the results without determining some variables

Step 34: Adjust the look and labels of the plot in the Options section and click the Apply button to display any changes

Step 35: Now change the mode from Visualize to Data File. With this mode, it is possible to check multiple sample points at the same time.

Step 36: Load a file containing all the input parameters in the same format that the XDis.txt (For this tutorial you can send the XDis.txt).

Step 37: Press apply to save a .csv file with the results for all the samples sent.

Tip: That can be also done without use of the GUI, using the interpolant result file as following:

uptimai_interp.exe <path_to_the_project> <interpolant_file> <Input_file> <Result_file> <Result_file_format>

For example:

uptimai_interp.exe F:\UptimAI\Xfoil xfoil_interp_O1_C1.json XDis.txt Results txt

Being the input file with the same format as the XDis.txt

Partial/Full histograms: #

Visualize separate contribution of each increment function to the final probability density function.

Step 38: Open the Partial/Full histograms feature

Step 39: Select increment functions for visualization from list of available sets

Step 40: Select desired increment functions for visualization from list of available sets

Step 41: Switch the Nominal sample on if you want to see absolute values instead of increments

Step 42: Adjust the look and labels of the plot in the Options section and click the Apply button to display any changes, you can also display the text form instead of the plot

Influencer: #

Visualizes the change in the final probability density function caused by the set of selected increment functions or selected variables. Allows to have two histogram plots in one picture are shown for direct comparison – the full probability density function of output values and the probability density function with the selected set of variables or increment functions neglected from the plot

Step 43: Open the Influencer – Variables feature

Step 44: Select variables for visualization from list of available sets

Step 45: Adjust the look and labels of the plot in the Options section and click the Apply button to display any changes, you can also display the text form instead of the plot

Step 46: Open the Influencer – Increments feature

Step 47: Repeat the steps 42 and 43, to see how a particular increment function affects the final probability distribution function.

Regions of preference avoidance – Inputs #

Identifies the ranges and shapes of input distributions to be preferred for the enhanced solution or to be avoided to prevent failure. Due to interactions of variables, regions of preference/avoidance may overlap but differences in suggested input distributions can be tracked together with the probability of the preferable/avoidable result

Step 48: Select the Regions of preference/avoidance – Inputs feature

Step 49: Load original values of input distributions from the XDis.txt file

Step 50: Choose the variable wanted to be displayed

Step 51: Adjust the look and labels of the plot in the Options section and click the Apply button to display any changes

Regions of preference avoidance – Results #

Propagates the proposed ranges for the selected input variables to show the new output probability distribution function.

Step 52: Change the mode to Regions of preference avoidance – results

Step 53: Select which variables want to be improved (others will use the original input distribution)

Step 54: Load original values of input distributions from the XDis.txt file

Step 55: Adjust the look and labels of the plot in the Options section and click the Apply button to display any changes

Save Interface #

Allows to save the computed avoidance and preference distributions. It is possible to save the Graphic displayed on the Screen or the distribution data. There are two different distribution data that can be solved, the input characteristics or the output characteristics.

  • The input characteristics, analogous to the distribution parametrization of the PreProcessor, consist on 3 different files. The InputSet file, that contains general information about the distribution, the InputDomain file, that contains the information of the boundaries and nominal value, and the XDis file, that contains a set of samples of the distribution.
  • The output characteristics, are defined in one file, containing all the results from the UptimAI model for the set of samples defined in the XDis file.

Step 56: Open the Save Interface

File -> Save

To save data files:

Step 57: Load the InputSet.txt file generated in the PreProcessor

Step 58: Select the distribution to save (Avoidance, Preference or both)

Step 59: Select the characteristic of the distribution to save (Inputs, Outputs or both)

Step 60: Write the File Prefix (The name of the saved files is composed of this prefix and a pre- defined name)

Step 61: Select the Directory in which the files will be saved

Step 62: Save the Data

To save graph:

Step 63: File prefix and directory has to be filled as for the data (not necessary to change it)

Step 64: Save the graph

Regions of preference avoidance – Optim #

Obtains the absolute maximum and minimum from the model and the combination of input variables that arouse them, both from the original distributions, and from the preference/avoidance proposed distributions.

Step 65: Open the Regions of preference avoidance – Optim feature

Step 66: Select the variables from which proposed distributions want to be used (if any, the optimum from the original distributions will be found)

Step 67: Load the XDis.txt file (combination of inputs where the optimum will be found)

Step 68: Select Apply

Postprocess #

Displays the convergence history of values for mean, variance, and their residuals is available for the overall process as well as for each increment function, helping to identify increment functions difficult to converge.

Step 69: Open the Regions of postprocess – UQ feature

Step 70: Choose values to be displayed (select whether the global convergence or convergence of an increment function)

Step 71: Select convergence criteria to be displayed using buttons below the list– you can select Convergence/Residual total/Residual logic (for increment functions only)

Step 72: Adjust the look and labels of the plot in the Options section and click the Apply button to display any changes

Step 73: Select now the Prediction model to create an additional linear model of residuals and estimate the prediction quality of the surrogate model

Step 74: Choose distributions to be displayed– select whether the distribution of residual model only, the original model only (equivalent to full histogram plot), or their summation and comparison

Iterative file #

In the iterative file, you can check, edit and save all the combination of inputs that have been required and its outputs.

Step 75: Clean the memory of the program and load the iterative file

File -> Clean

File -> Load -> Project_Name_it.json

Step 76: Open the Iterative File -> Sample Data to see all the sample points that has been computed to generate the Surrogate Model.

Step 77: User can fix values of inputs or outputs, add/delete function points, add/delete outputs. Edited data can be stored as a *.json to be used by the Core Solver for another run of uncertainty propagation. Change slightly the output of a sample point.

Step 78: Check all changes (Check button) – values of input variables need to be inside the domain boundaries and all cells must be filled, and save changes (red save button)

Step 79: Export the data as .csv file with File -> Save

Congratulations! You have finished the Tutorial II: XFoil. Now you have all the information to use UptimAI algorithm. If you want more extensive material you can check the manuals or ask our technical team: support@uptim.ai