Geometrically optimal gaits: a data-driven approach


The study of optimal motion of animals or robots often involves seeking optimality over a space of cyclic shape changes, or gaits, specified using a large number of parameters. We show a data-driven method for computing the gradient of a cost functional with respect to a large number of gait parameters by employing geometric properties of the dynamics to efficiently construct a local model of the system, and then using this model to rapidly compute the gradients. Our modeling step specifically applies to systems governed by connection-like models from geometric mechanics, which encompass a number of high-friction regimes. We demonstrate using our method for optimizing gaits under noisy, experiment-like conditions by simulating planar multi-segment serpent-like swimmers in a low Reynolds number (viscous friction) environment. Our optimization results recover known results for 3-segment swimmers with a 66 dimensional gait parameterization, and extend to optimizing the motion of a 9 segment swimmer with a 264 dimensional gait space, using only 30 simulation trials of 30 gait cycles each. The data-driven geometric gait optimization approach we present is designed to operate on noisy, stochastically perturbed dynamics—as noisy and variable as experimental data—and efficiently optimize a large number of parameters. We believe this approach has the potential to significantly advance our ability to optimize robot gaits with hardware in the loop and to study the optimality of animal gaits with respect to hypothesized cost functions.

This is a preview of subscription content, log in to check access.

Access options

Buy single article

Instant unlimited access to the full article PDF.

US$ 39.95

Price includes VAT for USA

Subscribe to journal

Immediate online access to all issues from 2019. Subscription will auto renew annually.

US$ 199

This is the net price. Taxes to be calculated in checkout.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9


  1. 1.

    In the parlance of geometric mechanics, this assigns \(Q\) the structure of a (trivial, principal) fiber bundle, with \(G\) the fiber space and \(R\) the base space.

  2. 2.

    The quality of this approximation depends on the choice of body frame for the system, which can be optimally selected once \(\mathbf {A}\) is calculated in an arbitrary convenient frame. See [8, 9, 11] for further discussion of this point.

  3. 3.

    These phase-matched \(\theta _{n}\) points can be individually computed for each \({r}_{n}\), and so are not restricted to the previously-sampled \(\theta _{m}\) values. Similarly, the estimates of \(\mathbf {A}\) and its derivative from Sect. 5.1 are computed as Fourier series, and can thus be interpolated to any \(\theta _{n}\).


  1. 1.

    Avron, J.E., Raz, O.: A geometric theory of swimming: Purcell’s swimmer and its symmetrized cousin. New J. Phys. 9(437), (2008).

  2. 2.

    Bazzi, S., Shammas, E., Asmar, D., Mason, M.T.: Motion analysis of two-link nonholonomic swimmers. Nonlinear Dyn. 89(4), 2739–2751 (2017).

  3. 3.

    Bittner, B., Revzen, S.: What do nematode swimming gaits optimize? In: The Society for Integrative and Comparative Biology Annual Meeting (poster) (2018)

  4. 4.

    Bloch, A.M., Krishnaprasad, P., Marsden, J.E., Murray, R.M.: Nonholonomic mechanical systems with symmetry. Arch. Ration. Mech. Anal. 136(1), 21–99 (1996).

  5. 5.

    Dai, J., Faraji, H., Gong, C., Hatton, RL., Goldman, DI., Choset, H.: Geometric swimming on a granular surface. In: Proceedings of the Robotics: Science and Systems Conference, Ann Arbor, Michigan, (2016)

  6. 6.

    Eldering, J., Kvalheim, M., Revzen, S.: Global linearization and fiber bundle structure of invariant manifolds. arXiv preprint arXiv:1711.03646 (2017)

  7. 7.

    Guckenheimer, J., Holmes, P.: Nonlinear Oscillations, Dynamical Systems, and Bifurcations of Vector Fields. Springer, New York (1983).

  8. 8.

    Hatton, R.L., Choset, H.: Geometric motion planning: the local connection, Stokes’ theorem, and the importance of coordinate choice. Int. J. Rob. Res. 30(8), 988–1014 (2011).

  9. 9.

    Hatton, R.L., Choset, H.: Geometric swimming at low and high reynolds numbers. IEEE Trans. Rob. 29(3), 615–624 (2013a).

  10. 10.

    Hatton, R.L., Choset, H.: Geometric swimming at low and high reynolds numbers. IEEE Trans. Rob. 29(3), 615–624 (2013b).

  11. 11.

    Hatton, R.L., Choset, H.: Nonconservativity and noncommutativity in locomotion. Eur. Phys. J. Spec. Top. Dyn. Anim. Syst. 224(17–18), 3141–3174 (2015).

  12. 12.

    Hatton, R.L., Choset, H., Ding, Y., Goldman, D.I.: Geometric visualization of self-propulsion in a complex medium. Phys. Rev. Lett. 110(078), 101 (2013).

  13. 13.

    Hatton, R.L., Dear, T., Choset, H.: Kinematic cartography and the efficiency of viscous swimming. IEEE Trans. Rob. (2017).

  14. 14.

    Kanso, E., Newton, P.: Locomotory advantages to flapping out of phase. Exp. Mech. 50(9), 1367–1372 (2010).

  15. 15.

    Kanso, E., Marsden, J.E., Rowley, C.W., Melli-Huber, J.B.: Locomotion of articulated bodies in a perfect fluid. J. Nonlinear Sci. 15(4), 255–289 (2005).

  16. 16.

    Kelly, SD., Pujari, P., Xiong, H.: Geometric mechanics, dynamics, and control of fishlike swimming in a planar ideal fluid. In: Natural Locomotion in Fluids and on Surfaces, Springer, pp. 101–116, (2012)

  17. 17.

    Lauga, E.: Life around the scallop theorem. Soft Matter 7(7), 3060–3065 (2011).

  18. 18.

    Mahalanobis, P.: On the generalized distance in statistics. Proc. Natl. Inst. Sci. India 2(1), 49–55 (1936)

  19. 19.

    McInroe, B., Astley, HC., Gong, C., Kawano, SM., Schiebel, PE., Rieser, JM., Choset, H., Blob, RW., Goldman, DI.: Tail use improves performance on soft substrates in models of early vertebrate land locomotors. Science 353(6295):154–158,, (2016)

  20. 20.

    Ostrowski, J.: Computing reduced equations for robotic systems with constraints and symmetries. IEEE Trans. Robot. Autom. 15(1), 111–123 (1999).

  21. 21.

    Ostrowski, J., Burdick, J.: The geometric mechanics of undulatory robotic locomotion. Int. J. Rob. Res. 17(7), 683–701 (1998).

  22. 22.

    Purcell, E.M.: Life at low Reynolds numbers. Am. J. Phys. 45(1), 3–11 (1977).

  23. 23.

    Ramasamy, S., Hatton, RL. Soap-bubble optimization of gaits. In: The Proceedings of the IEEE Conference on Decision and Control, Las Vegas, NV, (2016)

  24. 24.

    Ramasamy, S., Hatton, RL.: Geometric gait optimization beyond two dimensions. In: American Control Conference, (2017)

  25. 25.

    Rauch, H.E., Tung, F., Striebel, C.T.: Maximum likelihood estimates of linear dynamic systems. AIAA J. 3(8), 1445–1450 (1965).

  26. 26.

    Revzen, S.: Neuromechanical control architectures of arthropod locomotion. PhD thesis, University of California, Berkeley (2009)

  27. 27.

    Revzen, S., Guckenheimer, J.M.: Estimating the phase of synchronized oscillators. Phys. Rev. E 78(5), 051,907 (2008).

  28. 28.

    Revzen, S., Guckenheimer, J.M.: Finding the dimension of slow dynamics in a rhythmic system. J. R. Soc. Lond. Interface 9(70), 957–971 (2012).

  29. 29.

    Revzen, S., Kvalheim, M.: Data driven models of legged locomotion. In: SPIE Defense+ Security, International Society for Optics and Photonics, pp. 94,671V–94,671V, (2015)

  30. 30.

    Roweis, S., Ghahramani, Z.: A unifying review of linear gaussian models. Neural Comput. 11(2), 305–345 (1999).

  31. 31.

    Shapere, A., Wilczek, F.: Efficiencies of self-propulsion at low reynolds number. J. Fluid Mech. 198, 587–599 (1989)

  32. 32.

    Sznitman, J., Purohit, P.K., Krajacic, P., Lamitina, T., Arratia, P.E.: Material properties of caenorhabditis elegans swimming at low reynolds number. Biophys. J. 98(4), 617–626 (2010).

  33. 33.

    Tam, D., Hosoi, A.E.: Optimal stroke patterns for Purcell’s three-link swimmer. Phys. Rev. Lett. 98(6), 068,105 (2007).

Download references

Author information

Correspondence to Brian Bittner.

Ethics declarations

Conflicts of interest

Conflict of Interest: The authors declare that they have no conflict of interest.

Additional information

RLH thanks the National Science Foundation for support under Civil, Mechanical and Manufacturing Innovation grant 1653220. SR and BB were funded by Army Research Office grant W911NF-14-1-0573 and the Rackham Merit Fellowship.

Electronic supplementary material

Below is the link to the electronic supplementary material.

Supplementary material 1 (m4v 27573 KB)

Supplementary material 1 (m4v 27573 KB)

Appendix A: Regression for estimating the cost metric

Appendix A: Regression for estimating the cost metric

The regression for computation of the metric \(\mathcal {M}\) is centered about \(\theta \) and \(\dot{\theta }\), similarly to the construction of the regression for the connection \(\mathbf {A}\). The metric approximation now takes the form:

$$\begin{aligned} \dot{s}^2_n \sim ({\dot{\theta }_n + {\dot{\delta }}_n}^\mathsf {T}) \left[ \mathcal {M}+ \left( \frac{\partial \mathcal {M}}{\partial {r}_j}\right) \delta ^j_n \right] (\dot{\theta }_n + {\dot{\delta }}_n) \end{aligned}$$

leading to the regression:

$$\begin{aligned}&\begin{bmatrix} \dot{s}^2_{_1} \\ \vdots \\ \dot{s}^2_{_N} \end{bmatrix} = \begin{bmatrix} 1,&{\dot{\delta }}_1,&{\dot{\delta }}_{_1} \hat{\otimes }\, {\dot{\delta }}_{_1},&\delta _1,&{\delta }_{_1} \otimes \, {\dot{\delta }}_{_1},&{\delta }_{_1} \otimes \, {\dot{\delta }}_{_1} \hat{\otimes } {\dot{\delta }}_{_1}\\ \vdots&\vdots&\vdots&\vdots&\vdots \\ 1,&{\dot{\delta }}_N,&{\dot{\delta }}_{_N} \hat{\otimes }\, {\dot{\delta }}_{_N},&\delta _N,&{\delta }_{_N} \otimes \, {\dot{\delta }}_{_N},&{\delta }_{_N} \otimes \, {\dot{\delta }}_{_N} \hat{\otimes } {\dot{\delta }}_{_N} \end{bmatrix} \cdot {R}^\mathsf {T}, \end{aligned}$$
$$\begin{aligned}&R = \begin{bmatrix} \widehat{\mathcal {M}_{i,j}\dot{\theta }^i\dot{\theta }^j},&\widehat{\mathcal {M}_{i,j} \dot{\theta }^i},&\widehat{\mathcal {M}_{i,j}},&\widehat{\frac{\partial \mathcal {M}_{i,j}}{\partial {r}_k} \dot{\theta }^i\dot{\theta }^j},&\widehat{\frac{\partial \mathcal {M}_{i,j}}{\partial {r}_k} \dot{\theta }^j},&\widehat{\frac{\partial \mathcal {M}_{i,j}}{\partial {r}_k}} \end{bmatrix}\nonumber \\ \end{aligned}$$

Here the modified exterior product \(\hat{\otimes }\) includes only the upper triangular elements, i.e., \(x\hat{\otimes }\,y = [\ldots , x_i y_j, \ldots ]\) s.t. \(i\le j\). Following (14), at each m we solved for \(1+d+\left( {\begin{array}{c}d\\ 2\end{array}}\right) +d+d^2+d\left( {\begin{array}{c}d\\ 2\end{array}}\right) \approx \frac{1}{2}d^3\) unknowns to construct our model of the metric.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Bittner, B., Hatton, R.L. & Revzen, S. Geometrically optimal gaits: a data-driven approach. Nonlinear Dyn 94, 1933–1948 (2018).

Download citation


  • Gait optimization
  • Locomotion
  • Geometric mechanics
  • Oscillator
  • Data-driven floquet analysis