## 2 Materials and Methods
### Establishment of the Optimization Problem
by a spanwise blade element with the width of \(\mathrm{d}r\) at an instant time can be summed up as follows:  
\[\mathrm{d}F_{\zeta}(r,t)=\mathrm{d}F_{T\zeta}(r,t)+\mathrm{d}F_{R\zeta}(r,t)+ \mathrm{d}F_{A\zeta}(r,t)+\mathrm{d}F_{I\zeta}(r,t). \tag{40}\]  
The resultant vertical force generated by a wing cross-section over one stroke period can be determined according to  
\[\mathrm{d}F_{\zeta}(r)=f\int_{0}^{\frac{1}{7}}\mathrm{d}F_{\zeta}(r,t). \tag{41}\]  
Then, the time-averaged vertical force for one stroke cycle is obtained by integrating the vertical forces across all divided wing sections, as shown in Equation (42):  
\[F_{\zeta}=\int_{0}^{r_{0}+L}\mathrm{d}F_{\zeta}(r) \tag{42}\]  
Eventually, the constraint on the generation of vertical force is written as  
\[2F_{\zeta}\geq mg, \tag{43}\]  
where \(g\) is the acceleration of gravity and is numerically equal to \(9.8\,\mathrm{N/kg}\). In this study, we focus on the optimal design of energy-minimizing wings in hover. Therefore, the first task is to assess the energy cost of flapping wings with different configurations. Various power components consumed by a wing section, including aerodynamic and inertial power, have been discussed in Section 2.2. The power components required by an entire wing to create flapping and pitching motions can be expressed as  
\[P_{f,j}(t)=-\int_{0}^{r_{0}+L}\mathrm{d}P_{f,j}(r,t)=-\int_{0}^{r_{0}+L}\dot{ \varphi}r\cdot\mathrm{d}F_{j\eta}(r,t) \tag{44}\]  
\[\text{and }P_{r,j}(t)=-\int_{0}^{r_{0}+L}\mathrm{d}P_{r,j}(r,t)=-\int_{0}^{r_{0}+L }\dot{\theta}_{r}[x_{j}\cdot(dF_{j\eta}\sin\theta-dF_{j\zeta}\cos\theta)], \tag{45}\]  
where \(P_{f,T}(P_{r,T})\), \(P_{f,A}(P_{r,A})\), \(P_{f,R}(P_{r,R})\), and \(P_{f,I}(P_{r,I})\) denote the translational, added mass, rotational, and inertial power components about the flapping (rotation) axis, respectively. However, the mechanical power required to move each wing should be treated with caution. In our calculation, the true cycle-averaged aerodynamic (\(\overline{P}_{m,a}\)) and inertial power (\(\overline{P}_{m,i}\)) are obtained by averaging only the corresponding positive components, accounting for  
\[\overline{P}_{m,a}=f\int_{0}^{\frac{1}{7}}\{\Xi[P_{f,T}(t)]+\Xi[P_{f,R}(t)]+ \Xi[P_{f,A}(t)]+\Xi[P_{r,T}(t)]+\Xi[P_{r,R}(t)]+\Xi[P_{r,A}(t)]\}\mathrm{d}t, \tag{46}\]  
\[\text{and }\overline{P}_{m,i}=f\int_{0}^{\frac{1}{7}}\{\Xi[P_{f,I}(t)]+\Xi[P_{r, I}(t)]\}\mathrm{d}t, \tag{47}\]  
where \(P_{m}\) is the mechanical power, and \(\Xi\) is a function, defined as  
\[\Xi[x]=\left\{ \begin{array}{cc}x&(x>0)\\ 0&(x\leq 0)\end{array} \right.. \tag{48}\]  
The cycle-averaged mechanical power \(\overline{P}_{m}\) is the sum of these two powers, expressed as  
\[\overline{P}_{m}=\overline{P}_{m,a}+\overline{P}_{m,i}. \tag{49}\]  
The strategy of obtaining the energy cost is consistent with that employed in another study [38]. After comparing the cycle-averaged mechanical power obtained using the UBET estimation and the experimental measurement of the robot wing model, the effectiveness of this method was proved. It is also reasonable in our study because the wing system has no elastic storage, and the twisting of the wing model is active instead of relying on resilient energy storage or release. No energy cost is needed to dissipate negative power. This treatment ensures that the negative parts of each power component are excluded from the net cycle-average power:  
\[ \begin{array}{ll}\underset{\mathbf{x}}{\min}&P^{*}\\ \text{subject to}&\\ &2F_{\zeta}-mg\geq 0\\ &\text{Re}=\frac{4\rho_{f}\phi_{m}/R_{2}\pi}{\mu}\leq 13,000\\ &\mathbf{x}\in(\chi_{L,B},\chi_{LIB})\end{array}  \tag{50}\]  
where the vector \(\mathbf{x}\) of design variables includes the eight parameters \(\mathbf{x}=[r_{0},\,L,\,C_{R},\,f,\,\varphi_{m},\,\theta_{m,r},\,\theta_{m,t}, \,C_{\theta}]\), and \(\chi_{LB}\) and \(\chi_{LIP}\) are its lower and upper bounds, respectively. The mechanical power normalized by the MAV mass \(P^{*}=\overline{P}_{m}/m\) was used as the evaluation index of the energy economy [46; 47; 48].