Analysis of tail effects in flapping flight