This can be further refined by adding the amount of the CST weights, or by setting a different initial solution. The shape is not perfectly similar especially in the lower surface, since it is more difficult to be approximated. The Wopt values that I found is, with the error value of 0.0002. voila! you will have the CST airfoil that closely matches the RAE 2822 airfoil. The output of this optimization procedure is the ‘Wopt’ that hopefully could match the RAE 2822 airfoil. Note that the first four weights are for the lower surface, while the rest are for the upper surface. Here, what we want to find is the W (CST weights) that returns the lowest error, where the initial solution is and we set the minimum and maximum search bounds as -1 and 1 for all weights. I also set the trailing edge thickness to zero to match the RAE 2822 data. Where yt is the y-coordinate of the target airfoil (lower+upper surface), while the XL and XU are the x-coordinate of the lower and upper surface, respectively. This can be done simply by using fmincon (or you can use the unconstrained fminunc) as airfoilfit(W,yt,XL,XU,0),ones(1,8)*-1,ones(1,8),) In order to find the CST parameters that fit your airfoil, we have to do the optimization procedure with the objective is to minimize the error as mentioned before. I also include the sample of the RAE 2822 airfoil for this demonstration.
S1223 airfoil code#
The ‘airfoilfit.m’ code calls the ‘CST_airfoil_fit.m code’, which is the CST generation code that I modified specifically for this purpose. The main program is the ‘airfoilfit.m’ with error term as the output. Here we want to fit the RAE 2822 airfoil with CST parameters of 4 weights each at the upper and the lower surface (so in total there are 8 parameters to be determined). Please note that the principle is similar regardless the parameterization method that you used (e.g., CST, PARSEC, or anything else). The input of the code itself is exactly the CST weights themselves. In order to do this, you have to create a computer code that calculate this error and then set the error as the output of the code. We can easily see that the ‘error’ is the y-coordinate deviation of your CST airfoil to the target airfoil, measured at every point in the x-coordinate including the upper and lower surface. First, let us define the following error measure in a matlab-like language: error = mean(abs(yt-yp)), which means that we want to compute the mean absolute error between the y-coordinate of the target airfoil (yt) and the CST-generated airfoil (yp).
S1223 airfoil how to#
In this post, I will give you some simple examples in MATLAB about how to do this. If you want to do this, basically you have to minimize the error between your CST-generated airfoil and the target airfoil. I think some people wish to find the CST parameters for an existing airfoil, which can be used later for an optimization purpose (for example). Short note on CST method for airfoil parameterization ( MATLAB Code included) I wrote this article a long time ago about how to use the class-shape-transformation (CST) parameters to create an airfoil: