## 3 The Multilevel Approach
### First Level  
The first level of the procedure consists of an aerodynamic shape optimization where the objective is to obtain the most efficient aerodynamic shape, subject to structural constraints that account for the morphing skin behavior and the presence of the wing-box. The skin of the adaptive structure plays an important role in defining the whole morphing solution, and considering its structural behavior from the beginning helps in finding feasible structural solutions at the subsequent stages. The shape optimization performed during the first level is a single objective optimization that can be repeated several times to collect the set of target shapes and associated external design loads. The number of repetitions is \(M\) and determines the number of shape-adaptable designs considered in the MOOP of Equation (4). The multiobjective GA performed during the second level solves the MOOP by combining the \(M\) shape-adaptable designs and \(N\) structure designs. The aerodynamic shape requires a suitable parametric representation to be described and modified. The approach adopted here is the compact Class/Shape function Transformation (CST) technique for the wing geometry representation, proposed by [PERSON] in [33] and extended by [PERSON] to the three-dimensional representation of a morphing wing equipped with continuous control surfaces. This fully analytical description provides several advantages, including a reduced number of parameters and a straightforward estimation of the structural strain on the morphing skin. Different aerodynamic solvers are coupled with the CST, and the resulting automatized process is nested in the overall design procedure. The aerodynamic module is used to estimate the aerodynamics performances at various conditions of the flight envelope and to provide the aerodynamics loading distribution that results from the critical design manoeuvres. The general mathematical expression that represents the wing geometry is defined as follows,  
\[z(x,y)=\zeta(\psi,\eta)\cdot c(\eta) \tag{5}\]  
Figure 4: Multilevel optimization procedure. where \(x=\psi\cdot c(\eta)+x_{LE}(\eta)\) and \(y=\eta\cdot b/2\) are the dimensional coordinates defined with respect to the wing span \(b\) and the distribution of the local chord \(c(\eta)\), and \(\psi\) and \(\eta\) are the corresponding non-dimensional coordinates, while \(x_{LE}(\eta)\) is the leading edge position in the \(x\) direction along the wing span. The upper and lower non-dimensional surfaces are described as follows,  
\[\zeta(\psi,\eta)=C_{N2}^{N1}(\psi)\;\mathbf{Sy}_{(\mathbf{m},\mathbf{m})}(\eta )\cdot\mathbf{A}_{(\mathbf{m},\mathbf{n})}\cdot\mathbf{Sx}_{(\mathbf{n}, \mathbf{n})}(\psi)+\psi\zeta_{TE}(\eta)+(1-\psi)\zeta_{LE}(\eta) \tag{6}\]  
where \(C_{N2}^{N1}(\psi)\triangleq\psi^{N1}\cdot(1-\psi)^{N2}\) is the nonlinear Class function that mathematically defines a variety of basic general shapes. \(\zeta_{TE}=Z_{TE}/c\) and \(\zeta_{LE}=Z_{LE}/c\) are the non-dimensional vertical trailing and leading edge position, respectively. The square matrix \(\mathbf{Sy}_{(\mathbf{m},\mathbf{m})}(\eta)\) contains the Bernstein polynomial components of order \(m\) which define the unit spanwise shape function; the square matrix \(\mathbf{Sx}_{(\mathbf{n},\mathbf{n})}(\psi)\) contains the Bernstein polynomial components of order \(n\) which define the unit chordwise shape function. The rectangular matrix \(\mathbf{A}_{(\mathbf{m},\mathbf{n})}\) contains the extra coefficients acting in a spanwise and chordwise direction, and allows to compute the two-dimensional shape function \(\mathbf{S}(\psi,\eta)=\mathbf{Sy}_{(\mathbf{m},\mathbf{m})}(\eta)\cdot\mathbf{ A}_{(\mathbf{m},\mathbf{n})}\cdot\mathbf{Sx}_{(\mathbf{n},\mathbf{n})}(\psi)\). Considering the matrix \(\mathbf{A}_{(\mathbf{m},\mathbf{n})}\), each row defines a component airfoil, and the first and last rows contain the extra coefficients of the two airfoils placed at the tips of each wing sub-element.