# Wing Geometry and Kinematic Parameters Optimization of Flapping Wing Hovering Flight
## 5 Optimization Problem's Modeling and Formulation
### Formulation of the Optimization Problem  
The optimization problem is to search for optimal WGP and WKP to minimize the specific power output of hovering insect (\(LtoW\geq 1\)) under different given conditions, such as prescribing wing kinematic pattern and fixed WGP (Table 3) and constraining \(AR\) and \(Re\) as follows. Here, \(AR\) is introduced as a linear constraint because of its role in mediating stability of LEV. According to the result of statistic analysis over 300 insects, \(AR\) of single wing termed Rossby number has an average value near to 3 [59; 60]. Here, taking the extension of optimal analysis and feasibility of design in engineering into consideration, we limit the range of \(AR\) as  
\[2.9\leq AR=\frac{R_{\rm eff,vari}+x_{\rm r,vari}}{C_{\rm aver,vari}}\leq 4. \tag{44}\]  
The lower bound of \(AR\) is an average value for fruit flies [60], and the upper bound refers to the average value of 65 hummingbirds [61]. Moreover, \(Re\) as a nonlinear constraint is also introduced to consider the scope of application of quasi-steady aerodynamic model, which has been probed by some researchers [36; 62]. Here, by referring to the review of Sun [37], the range of \(Re\) is limited as  
\[100\leq Re=\frac{4\phi_{m}fR_{\rm eff,vari}C_{\rm aver,vari}}{\
u}\leq 3000. \tag{45}\]  
So, the optimization problem, which subjects to some tricky nonlinear constraints of \(Re\) and \(LtoW\geq 1\), can be written as:  
\[\left\{ \begin{array}{ll}\text{find}&\mathbf{x}\\ \min&f\left(\mathbf{x}\right)=P^{*}\left(\mathbf{x}\right)\\ s.t.&LtoW\left(\mathbf{x}\right)=1\\ &x_{\rm min}\leq\mathbf{x}\leq x_{\rm max}\\ &R_{\rm eff,vari}-4*C_{\rm aver,vari}\leq 0\\ &-R_{\rm eff,vari}+2.9*C_{\rm aver,vari}\leq 0\\ &100v-4\phi_{m}fR_{\rm eff,vari}C_{\rm aver,vari}\leq 0\\ &-3000v+4\phi_{m}fR_{\rm eff,vari}C_{\rm aver,vari}\leq 0\end{array} \right., \tag{46}\]  
where \(\mathbf{x}\) is design variables with bound of \(x_{\rm min}\) and \(x_{\rm max}\), and \(f(\mathbf{x})\) is objective function for average positive power density output (\(P^{*}(\mathbf{x})\)). \(AR\) is the linear equality constraint, and ratio of lift-to-weight (\(LtoW\)) and \(Re\) are nonlinear inequality constraints. In order to conveniently realize optimization, we convert the constrained optimization into a single objective function with some penalty functions formed by boundary constraints, linear constraints and nonlinear constraints [8]. The single objective function is termed fitness, \(F(\mathbf{x})\), which subject to optimized parameter space (\(\Upsilon\)) corresponding to the optimization problem,\[\min F\left(\mathbf{x}\right)=P^{*}\left(\mathbf{x}\right)+r\Theta\left(1-LtoW \left(\mathbf{x}\right)\right)+s\underset{j\in}{\sum}\frac{\left|\zeta_{j}\right| }{Max_{j}-Min_{j}}+\lambda\Theta\left(\left\{Con\right\}\right), \tag{47}\]  
here the nonlinear equality constraint (\(LtoW\geq 1\)) is penalized to be infinitesimally approximate to equality constraint (\(LtoW\equiv 1\)) with relative toleration of \(10^{-8}\)[8]. \(\Theta\left(x\right)\) is set as the Heaviside step function about lift-to-weight's equality constraint (\(LtoW=1\)) with a positive real penalty factor of \(\boldsymbol{r}\) ahead. \(\zeta_{\text{j}}\) is the distance corresponding to the parameter \(j\) outside the range specified by its upper and lower bounds (\(Max_{j}\) and \(Min_{j}\) given in Table 1). Thus, the third item of (47) forms the penalty function about the boundary constraint with a positive real penalty factor of \(\boldsymbol{s}\) ahead. Here, \(\Theta\left(\left\{Con\right\}\right)\) is also a Heaviside function expression about \(AR\) and \(Re\) with a positive real penalty factor \(\boldsymbol{\lambda}\) ahead. For the following linear constraint of \(AR\) and nonlinear constraint of \(Re\), and \(\Theta\left(\left\{Con\right\}\right)\) is constructed by  
\[\Theta\left(\left\{Con\right\}\right)=\left\{