Effect of spanwise flexibility on flapping wing propulsion