## 2 Materials and Methods
### Estimation of Force and Power Consumption  
A wing theoretically consists of an infinite number of wing cross-sections, but it can be discretized into finite blade elements for numerical analysis. Since there are distinctive rotation angles in different wing sections even at the same instant, we discretized the wing model into infinitesimal strips along the spanwise directions. An aerodynamic model,  
Figure 4: Morphing pattern of wing twist at the middle of a wing’s upstroke. This diagram includes two wings: a rigid flat grey wing (partially obscured by the transparent blue wing), and a blue wing exhibiting a specific twisting deformation. Additionally, for the sake of comparison, the corresponding block diagram provides an alternative viewing angle for the wing model. In particular, the wing shapes at \(t/T=0.55\) and \(0.75\) were also plotted to provide visual representation of wing twist. Figure 3: The profiles of the rotation angles at different wing sections of a deformable wing, and a comparison between those and the simplified modelling results. named the unsteady blade element theory (UBET) in Refs. [22; 43], was then employed to estimate the force generated by any two-dimensional wing section and the associated power requirement. In this model, the resultant aerodynamic load acting on a blade element is decomposed into translation-induced load, rotation-induced load, and added-mass load. In addition, the inertial load can also be obtained with the known mass distribution. The power components required to overcome aerodynamic and inertial moments around the flapping and rotation axes are readily available. Note that in the optimization problem it is difficult to parameterize the mass distribution of a wing in a case where its configuration is unknown. Therefore, in our study, the density was assumed to be homogeneous in order to account for inertial effects. The UBET allows us to quickly evaluate the wing performance with the given morphological and kinematic parameters and to excavate the influence law of parameters, which is extremely important for optimization. Force and power calculations are introduced in the following paragraphs. For any wing cross-section, the translational force usually depends on its angular stroke velocity \(\dot{\varphi}\) and geometric angle of attack \(\theta\). As shown in Figure 2, \(\theta\) can be determined according to the rotation angle \(\theta_{r}\). \(\theta\) is identical to \(\theta_{r}\) during the upstroke, and \(\theta\) equals \(\pi-\theta_{r}\) during the downstroke. The symbol \(V\) stands for inflow velocity, \(V_{T}\) denotes the translational velocity due to the flapping motion, and \(V_{i}\) is the induced velocity. The angle between the inflow velocity and the chord is the effective angle of attack \(\alpha\), while \(\psi\) is the induced angle of attack, the angle between the inflow velocity and the translational velocity. The equations about the induced velocity and the effective angle of attack can be established based on the blade element theory and the momentum theory [44], as follows:  
\[V_{T}=\big{|}\dot{\varphi}r\big{|}, \tag{6}\]  
\[\psi=\tan^{-1}(\frac{V_{i}}{V_{T}}), \tag{7}\]  
\[\alpha=\theta-\psi, \tag{8}\]  
\[U_{ref}=4\varphi_{mf}R_{2}, \tag{9}\]  
\[\text{Re}=\frac{\rho_{air}U_{ref}\,\overline{c}}{\mu}, \tag{10}\]  
\[C_{L}=\,(1.966\,-\,3.94\text{Re}^{-0.429})\sin(2\,\alpha), \tag{11}\]  
\[C_{D}=\text{Re}^{-0.764}+(1.873-3.14\text{Re}^{-0.369})\,(1-\cos(2\alpha)), \tag{12}\]  
\[\text{and}\,\frac{c}{8\varphi_{mf}}\sqrt{\big{(}\frac{V_{i}}{V_{T}}\big{)}^{2 }+1}\bigg{[}C_{L}(\alpha)-C_{D}(\alpha)\frac{V_{i}}{V_{T}}\bigg{]}-\big{(} \frac{V_{i}}{V_{T}}\big{)}^{2}=0, \tag{13}\]  
where \(U_{ref}\) is the reference velocity, and Re is the Reynolds number.