Body torsional flexibility effects on stability during trotting and pacing based on a simple analytical model