# Gradient-Based Aerodynamic Optimization of an Airfoil with Morphing Leading and Trailing Edges
## 2 Methodologies
### Feasible Morphing Airfoil Geometry Parameterization
#### 2.2.2 CST Coefficient Identification  
The parameterization procedure starts with the identification of the Bernstein polynomials' coefficients \(A_{i}\) for both lower and upper surfaces, which can be evaluated by various techniques, e.g., curve fitting, and gradient-based and genetic optimization [17], to minimize the error from the CST airfoil representation and the already available one that is represented by points or as a CAD file. In this work, curve fitting is employed, and a least-square solution is obtained by solving an over-determined linear system.  
The identification of the CST parameters consists of projecting the existing airfoil into CST space. Most of the airfoils are represented by the coordinates of points. The airfoil is first translated by putting the leading edge point on the vertical axis of the current coordinate system. Then the dimensional coordinates of an input airfoil are non-dimensionalized by chord length. This procedure is a bijective transformation from \(x-z\) domain where \(x\in[x_{\text{LE}},\ x_{\text{TE}}]\) to \(\psi-\zeta\) domain where \(\psi\in[0,\ 1]\) by setting \(\psi=(x-x_{\text{LE}})/c\).  
After transformation of the coordinates, denote \(\left\{\psi_{j}\right\}_{1\leq j\leq l}\in[0,\ 1]\) as distinct points with a total number of \(l\), such that \(0\leq\psi_{1}<\cdots<\psi_{l}\leq 1\), \(\left\{\psi_{j},\ \zeta_{j}\right\}_{1\leq j\leq l}\) depicts the coordinates of a set of points on the upper or lower surface of an input airfoil. Generally, the order of polynomials is less than the number of points, i.e., \(n\leq l\). The coefficient identification problem is to find a suitable set of \(A_{i}\) that minimizes the sum of the square of deviations from the data \(\zeta_{j}\) to \(\zeta(\psi_{j})\), i.e., \(\min\limits_{A}\sum\limits_{j=1}^{l+1}\left|\zeta_{j}-\zeta(\psi_{j})\right|^{2}\), which is equivalent to solve the over-determined linear system [18]:  
\[\mathbf{T}(\mathbf{\psi})\mathbf{A}=\mathbf{f}(\mathbf{\psi}) \tag{7}\]  
where  
\[\mathbf{T}(\mathbf{\psi})=\left[\begin{array}{cccc}\mathrm{C}_{N_{2}}^{N_{1}}( \psi_{1})K_{0,n}(1-\psi_{1})^{n}&\mathrm{C}_{N_{2}}^{N_{1}}(\psi_{1})K_{1,n} \psi_{1}(1-\psi_{1})^{n-1}&\cdots&\mathrm{C}_{N_{2}}^{N_{1}}(\psi_{1})K_{n,n} \psi_{1}^{n}\\ \mathrm{C}_{N_{2}}^{N_{1}}(\psi_{2})K_{0,n}(1-\psi_{2})^{n}&\mathrm{C}_{N_{2}} ^{N_{1}}(\psi_{2})K_{1,n}\psi_{2}(1-\psi_{2})^{n-1}&\cdots&\mathrm{C}_{N_{2}}^ {N_{1}}(\psi_{2})K_{n,n}\psi_{2}^{n}\\ \vdots&\vdots&\ddots&\vdots\\ \mathrm{C}_{N_{2}}^{N_{1}}(\psi_{l})K_{0,n}(1-\psi_{l})^{n}&\mathrm{C}_{N_{2}} ^{N_{1}}(\psi_{l})K_{1,n}\psi_{l}(1-\psi_{2})^{n-1}&\cdots&\mathrm{C}_{N_{2}}^ {N_{1}}(\psi_{l})K_{n,n}\psi_{l}^{n}\end{array}\right] \tag{8}\]  
is a Bernstein-Vandermonde matrix [19] with a size of \(l\times(n+1)\), and  
\[\mathbf{f}(\mathbf{\psi})=\left\{\begin{array}{c}\zeta_{1}-(1-\psi_{1})\zeta_{\text {LE}}-\psi_{1}\zeta_{\text{TE}}\\ \zeta_{2}-(1-\psi_{2})\zeta_{\text{LE}}-\psi_{2}\zeta_{\text{TE}}\\ \vdots\\ \zeta_{l}-(1-\psi_{l})\zeta_{\text{LE}}-\psi_{l}\zeta_{\text{TE}}\end{array}\right\} \tag{9}\]