<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Geometric phase predicts locomotion performance in undulating living systems across scales</title></titleStmt>
			<publicationStmt>
				<publisher>PNAS</publisher>
				<date>06/11/2024</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10536079</idno>
					<idno type="doi">10.1073/pnas.2320517121</idno>
					<title level='j'>Proceedings of the National Academy of Sciences</title>
<idno>0027-8424</idno>
<biblScope unit="volume">121</biblScope>
<biblScope unit="issue">24</biblScope>					

					<author>Jennifer M Rieser</author><author>Baxi Chong</author><author>Chaohui Gong</author><author>Henry C Astley</author><author>Perrin E Schiebel</author><author>Kelimar Diaz</author><author>Christopher J Pierce</author><author>Hang Lu</author><author>Ross L Hatton</author><author>Howie Choset</author><author>Daniel I Goldman</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[<p>Self-propelling organisms locomote via generation of patterns of self-deformation. Despite the diversity of body plans, internal actuation schemes and environments in limbless vertebrates and invertebrates, such organisms often use similar traveling waves of axial body bending for movement. Delineating how self-deformation parameters lead to locomotor performance (e.g. speed, energy, turning capabilities) remains challenging. We show that a geometric framework, replacing laborious calculation with a diagrammatic scheme, is well-suited to discovery and comparison of effective patterns of wave dynamics in diverse living systems. We focus on a regime of undulatory locomotion, that of highly damped environments, which is applicable not only to small organisms in viscous fluids, but also larger animals in frictional fluids (sand) and on frictional ground. We find that the traveling wave dynamics used by mm-scale nematode worms and cm-scale desert dwelling snakes and lizards can be described by time series of weights associated with two principal modes. The approximately circular closed path trajectories of mode weights in a self-deformation space enclose near-maximal surface integral (geometric phase) for organisms spanning two decades in body length. We hypothesize that such trajectories are targets of control (which we refer to as “serpenoid templates”). Further, the geometric approach reveals how seemingly complex behaviors such as turning in worms and sidewinding snakes can be described as modulations of templates. Thus, the use of differential geometry in the locomotion of living systems generates a common description of locomotion across taxa and provides hypotheses for neuromechanical control schemes at lower levels of organization.</p>]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Locomotion (or self-propulsion) is an essential behavior in most living systems <ref type="bibr">(1,</ref><ref type="bibr">2)</ref> and important for engineered devices like robots <ref type="bibr">(3)</ref><ref type="bibr">(4)</ref><ref type="bibr">(5)</ref>. In organisms as diverse as jumping kangaroos, swimming eels, crawling nematodes, and spiraling bacteria, self-propulsion results from cyclic changes in body and/or appendage configuration. These configuration sequences are ultimately generated by numerous interacting and coordinated components coupled to environments of varying composition. A major challenge in locomotor biology is to discover general principles that govern how organisms generate and control fast, stable, or energetically efficient locomotion. At the organismal scale, these principles have long been discussed in the physiology and motor control literature <ref type="bibr">(6,</ref><ref type="bibr">7)</ref> with the term "neuromechanics" used to indicate the importance of concomitant consideration of nervous, musculoskeletal, and biomechanical systems in explaining performance.</p><p>Several approaches are used to develop neuromechanical control principles. One approach ("bottom-up") to addressing this question is to directly incorporate the nonlinearly coupled nervous/musculoskeletal systems and environments in full detail. While success has been achieved using this approach in ferreting out mechanisms of legged <ref type="bibr">(8,</ref><ref type="bibr">9)</ref> and undulatory locomotion <ref type="bibr">(10)</ref><ref type="bibr">(11)</ref><ref type="bibr">(12)</ref>, the complexity of such models leads to challenges in discovering broad principles. Another approach ("top-down") ignores the complexity of organisms and seeks to discover broad (cross-taxa) and relatively simple patterns of dynamics. These models are often referred to as templates <ref type="bibr">(8,</ref><ref type="bibr">13)</ref>, defined as a behavior that "contains the smallest number of variables and parameters that exhibit a behavior of interest." This approach has the benefit of producing models which are analyzable, can be used to test lower-level mechanisms, and yield insight into features across organisms. The template approach has been useful in rationalizing locomotor performance and control across taxa in legged and undulatory systems <ref type="bibr">(8,</ref><ref type="bibr">(14)</ref><ref type="bibr">(15)</ref><ref type="bibr">(16)</ref><ref type="bibr">(17)</ref><ref type="bibr">(18)</ref>. In addition to descriptive power, templates can also serve a prescriptive role, generating dynamics which are targets of control for the neuromechanical system that can yield beneficial locomotor properties (e.g., speed, energetics, stability), enabling robots with</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Significance</head><p>A challenge in locomotion studies is to discover how organisms control their many degrees of freedom to move in diverse environments. Insight into such control schemes can aid biology and advance robots. Here, we use a geometric framework to model biological locomotion in a "top-down" approach, allowing comparison of highly damped systems across scales, levels of complexity, and environmental interactions. From tiny nematode worms locomoting in fluids to snakes and lizards in granular media, animal kinematics, and locomotor performance coincide with predictions that nearly maximize a geometric phase in the space of body configurations. This leads to a principle for forward planar undulatory locomotion in highly damped environments as well as gives insight into turning behaviors.</p><p>performance approaching those of living systems <ref type="bibr">(8,</ref><ref type="bibr">(19)</ref><ref type="bibr">(20)</ref><ref type="bibr">(21)</ref>. Finally, a top-down approach can offer insights into how locomotors adapt their templates to changes in locomotor morphology [e.g., lizard limblessness <ref type="bibr">(22)</ref>] and/or environments [e.g., from swimming to walking in amphibious salamanders <ref type="bibr">(23)</ref>].</p><p>Despite the apparent simplicity in the template-based approach, a question arises: given all the ways an organism could organize its neuromechanical system to self-deform (24)-e.g., bounce across the ground like a pogo stick <ref type="bibr">(17)</ref> or send waves down its body from head to tail-how can one determine "good" ones? That is, does a general framework for locomotion exist that could provide a priori useful template dynamics which could then be used to evaluate performance and test optimality <ref type="bibr">(7)</ref> in terms of speed, energy use, or stability? Surprisingly, an answer to this question arose starting in the 1980s through the work of physicists and control theorists <ref type="bibr">(25)</ref><ref type="bibr">(26)</ref><ref type="bibr">(27)</ref><ref type="bibr">(28)</ref><ref type="bibr">(29)</ref><ref type="bibr">(30)</ref><ref type="bibr">(31)</ref><ref type="bibr">(32)</ref><ref type="bibr">(33)</ref><ref type="bibr">(34)</ref><ref type="bibr">(35)</ref><ref type="bibr">(36)</ref>. These researchers developed a scheme which now goes by the name "geometric mechanics" (and which we will refer to as the geometric phase approach) which first uses environmental models to link small self-deformations around each body configuration to small translations and rotations in world space. Line integrals over closed paths in a space of body configurations, which represent cyclic sequences of body/limb changes, can then lead to translation/rotation in the world. These translations or rotations can be expressed as "geometric phases"-net changes in global quantities like position that depend on the shape of a cyclical path whose local parameters return to their initial values <ref type="bibr">(25,</ref><ref type="bibr">26,</ref><ref type="bibr">28,</ref><ref type="bibr">29,</ref><ref type="bibr">37)</ref>. These geometric phases are independent of the specific temporal details, such as the speed at which the paths are executed. In other words, the geometric phase depends solely on the path's shape and is unaffected by the specific timing or speed of the movements. Geometric phases appear in diverse situations including the Ahranov-Bohm effect, parallel transport of vectors on curved manifolds, a swinging Foucault pendulum and polarization changes of light in coiled optical fibers. *  A major advance in the possibility of using geometric phase in realistic locomotor situations occurred with the introduction of the minimal perturbation coordinate <ref type="bibr">(38,</ref><ref type="bibr">39)</ref>. Such coordinates mitigate issues associated with the noncommutivity of translations and rotations in the plane and allow line integrals in the configuration space to be approximated by surface integrals over certain functions. These functions are referred to as "constraint curvature functions" or "height functions." Critically, height functions replace potentially laborious calculations used in the line integral approach. For example, even in simple artificial systems <ref type="bibr">(40)</ref><ref type="bibr">(41)</ref><ref type="bibr">(42)</ref> to identify parameters that result in optimal performance requires considerable computational effort, comparing movements arising from an infinite combination of shape change sequences. Height functions instead enable a comparatively simple, diagrammatic approach. Their key utility is that they simplify the inverse problem: providing ready identification of gaits that maximize performance in diverse systems. Height functions also give a geometric rationalization of the marginal benefits that result from changing/adapting self-deformation patterns, without the need for significant calculation. Because of its utility, over the last decades, researchers have developed the theory so that it is applicable to a broad range of situations and applied the scheme to optimal control of artificial devices including satellite reorientation <ref type="bibr">(43)</ref>, robot swimming <ref type="bibr">(39)</ref>, sidewinding <ref type="bibr">(44)</ref> and walking <ref type="bibr">(22,</ref><ref type="bibr">45)</ref> in granular and frictional environments.</p><p>A particular regime of self-propulsion which could be amenable to geometric analysis is that in which dissipative forces dominate inertia. Here, cyclic patterns of undulatory selfdeformations solely dictate performance (provided the environment is uniform like in open fluid)-unlike in inertia-dominated systems where gliding (movement without shape changes) and stored/returned elastic energy can be utilized. This is typically thought of as the world of very small scales [nicely narrated in ref. <ref type="bibr">40</ref> and the subject of much effort devoted to locomotion <ref type="bibr">(46)</ref>]. Surprisingly, in the last decade, our experimental and granular resistive force theory [RFT, first introduced for microscopic organisms <ref type="bibr">(47)</ref>] modeling studies of sand-swimming organisms have revealed that the dynamics of such terrestrial macroscopic undulatory locomotors <ref type="bibr">(48)</ref><ref type="bibr">(49)</ref><ref type="bibr">(50)</ref><ref type="bibr">(51)</ref> operate in a mechanically analogous regime, where rate-independent friction, as opposed to viscosity, dominates inertia. Even within these dissipative locomotor regimes, comparing undulatory locomotor performance for different dynamics is challenging due again to infinite combinations of self-deformation sequences, necessitating the use of the height function formulation of locomotor geometric phase to establish cross-system principles of locomotion.</p><p>In this paper, we demonstrate that the geometric phase approach of locomotion provides a useful way to compare living organisms with seemingly very different and differently composed (e.g., exo-vs. endoskeletal) locomotor systems across scales. We first show that diverse undulatory organisms (including microscopic nematodes and macroscopic snakes/lizards, Fig. <ref type="figure">1A</ref>) moving forward can be described using a planar wave templatea time series of two spatial basis functions. We notice that these time series exhibit similar patterns in locomotor systems across scales, suggesting the existence of a fundamental template for undulatory systems. Moreover, the time series emerge as circular paths in the two-dimensional spatial-basis space, which we refer to as serpenoid templates. Interestingly, we note that the parameters governing the animals' chosen serpenoid templates nearly maximize geometric phase, indicating that the animals are controlling their self-deformation patterns to achieve "good" A B C D Fig. 2. Low dimensional representation of animal movement. (i) Photos of animals and (ii) snapshots of animal body configurations colored by time (over two or three cycles) for (A) the nematode worm (C. elegans) in Sbasal buffer (T cycle &#8776; 1 s) (B) the sandfish lizard (S. scincus) 7.6 cm below the surface of and fully immersed in 300-&#956;m glass particles (T cycle &#8776; 0.4 s), (C) the shovel-nosed snake (Ch. occipitalis) 7.6 cm below the surface of and fully immersed in 300-&#956;m glass particles, and (D) Ch. occipitalis moving on the surface of 300-&#956;m glass particles (T cycle = 0.3 s). (iii) Solid lines show the two dominant relative curvature ( s ) PCA modes account for (A) 96.7%, (B) 94.7%, (C) 57.6%, (D) 90.7% of the variation in observed body configurations. Dashed lines show best fits to sin and cos functions. (iv) 2D probability density map of projections of curvatures (directions specified by arrows) onto the two PCA modes with the largest eigenvalues. Axes are identical in (iii) and (iv).</p><p>locomotor performance (a notion we will discuss in more detail). Beyond forward crawling, serpenoid templates can be modulated (e.g., adding an offset to the center of the circle) to explain turning behaviors, such as the omega turn in nematodes and the differential turn in sidewinders.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Using a Two-Mode Description for Planar Undulation in Dissipative Environments</head><p>Previous studies of highly damped locomotors using planar undulation revealed relative simplicity in wave shapes <ref type="bibr">(52)</ref><ref type="bibr">(53)</ref><ref type="bibr">(54)</ref>. To describe the planar &#8224; shapes used during C. elegans locomotion, (52) used principal components analysis (PCA) to diagonalize the covariance matrix of local body curvatures (determined from digitized midlines of animals during movement) to identify a set of orthonormal basis functions, referred to as principal components (PCs), whose weighted superposition can be used to capture observed animal body configurations. Eigenvalues associated with each PC or "eigenworm" indicate the variance explained by each mode (and therefore the fraction of the variance explained by each mode is given by the eigenvalue divided by the sum of all eigenvalues). For steady forward crawling, ref. <ref type="bibr">52</ref> found that two PCs were sufficient to capture most of the shape variance, and the dynamics of movement could be represented within this two-dimensional space by projecting time traces of local body curvatures onto these PCs. A depiction of a "shape space" spanned by two undulatory PCs for forward movement is shown in Fig. <ref type="figure">1B</ref>, with an example of the dynamics of movement represented by the directed closed path within this space. Each point along this path corresponds to a body posture, and the direction indicates how postures change. Environmental reaction forces induced by these posture changes (Fig. <ref type="figure">1C</ref>) can result &#8224; Body undulation in these animals is planar but occurs dorsoventrally.</p><p>in world-frame displacements. The body shapes associated with five points identified along the path, as well as the resulting displacements, are shown in Fig. <ref type="figure">1D</ref>.</p><p>Here, inspired by the similarity of the wave kinematics used by the sandfish lizard, S. scincus (Fig. <ref type="figure">2B</ref> and ref. <ref type="bibr">50)</ref>, and the shovel-nosed snake, Ch. occipitalis (Fig. <ref type="figure">2</ref> C and D and refs. 50 and 55) in sand to those used by low Reynolds number mmscale locomotor C. elegans (Fig. <ref type="figure">2A</ref>), we investigated whether a low-dimensional representation could capture the body postures and dynamics observed in these undulatory locomotors across scales. We collected data on C. elegans (Materials and Methods) and reanalyzed previously published data on lizards and snakes <ref type="bibr">(50,</ref><ref type="bibr">55)</ref>. We started with the digitized animal midlines from high-speed kinematic data (Fig. <ref type="figure">2</ref>-ii and SI Appendix, section 3), and characterized instantaneous body configuration using the relative curvature, (s, t) s , where (s, t) is the local curvature at position s and time t (Fig. <ref type="figure">2C</ref>-ii), s is the position along the body, and s is the arc length of one wave (SI Appendix, section 3).</p><p>(s, t) s is a nondimensional and coordinate-invariant quantity that is measured as a function of position along the body for each moment in time.</p><p>PCA was applied to the entire dataset of each species combining curvature measurements from all trials throughout all times <ref type="bibr">(52,</ref><ref type="bibr">56)</ref>. We find that, for the forward movement of lizards and snakes in granular media, and nematodes in fluid, two PCs capture most of the variation in the body configurations of each species (SI Appendix, section 3). This observation allows us to use the space spanned by the first two PCs as our low dimensional representation for each animal:</p><p>where v 1 (s) and v 2 (s) are principal components identified from PCA; w 1 (t) and w 2 (t) are the time series of weights associated with the corresponding principal components. We thus define the shape variable (t) = [w 1 (t), w 2 (t)].</p><p>Similar to the results from ref. <ref type="bibr">52</ref>, we find that the two dominant PCs in the lizards, snakes, and nematodes were well fit by v i (s) = sin (2 ns/L + s i ), i &#8712; {1, 2} where n, s i and L are, respectively, the number of waves, spatial phase, and the body length (Fig. <ref type="figure">2</ref>-iii for modes and fits &#8225; ). Note that to enforce the orthogonality of fitted basis functions, we assume | s 1 -s 2 | = /2. We use the fitted sinusoidal basis functions to construct a two-dimensional shape space. Because the first two PCs explain comparable amounts of the variance, we assign them to the dimensions of the space in order of phase (i.e., s 1 &gt; s 2 ), rather than the amount of variance explained. This allows the chirality of the shape space to be the same across organisms (i.e., counterclockwise/clockwise directed trajectory in the shape space leading to forward/backward displacement respectively; see Fig. <ref type="figure">2</ref>).</p><p>The visualization of shape variables reveals that animals investigated in our manuscript used nearly circular templates (of radius</p><p>to transition through body configurations in [w 1 , w 2 ]-space as they deform (Fig. <ref type="figure">2</ref>-iv). Notably, the circle in shape space and thus the sinusoidal variation in curvature was first studied in the context of snake locomotion and limbless robot control by Hirose in his seminal work <ref type="bibr">(57)</ref>. Following Hirose's terminology for such a wave, we will refer to the circular pattern in shape space as a "serpenoid" template. &#167;</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Resistive Force Theory to Model Environmental Interactions</head><p>To develop the geometric phase framework to rationalize such templates as well as to discover novel behaviors, we first require a model of body-environment interactions that connects a particular change in shape to center-of-mass translation and/or rotation in the environment. Resistive force theory (RFT) modeling has had successes describing movement in fluids, for example in predicting forward swimming speeds of C. elegans <ref type="bibr">(59,</ref><ref type="bibr">60)</ref>; however, in other situations (e.g., waves with higher curvatures), more elaborate schemes are often required to accurately capture the dynamics <ref type="bibr">(61)</ref>. One of the key assumptions in RFT modeling is that environmental disturbances induced by the movement of a swimmer are sufficiently localized that forces and flow fields from neighboring body segments are completely decoupled. In the last decade, studies of animal locomotion in dry granular media have revealed that the simplest form of RFT is remarkably successful in describing movement in such environments <ref type="bibr">(49)</ref><ref type="bibr">(50)</ref><ref type="bibr">(51)</ref>.</p><p>Further, from the assumption of decoupled forces along a deforming body, a swimmer can be divided into many infinitesimal segments that can be treated independently. In dissipationdominated environments, the net force on a body is zero at every moment in time, giving</p><p>d F &#8869; and dF are the environmental reaction forces acting perpendicular and parallel to the surface of an infinitesimal segment of the body as it moves within the surrounding medium.</p><p>&#8225; For the subsurface movement of Ch. occipitalis, we attribute the points near the origin to turning behavior that is not captured by the first two modes; however, we will show that despite the more complex body postures and locomotion, we are still able to quantitatively describe forward locomotion.</p><p>&#167; The serpenoid dynamics differ from characterization of animal body shapes as sinusoidal amplitude displacements of away from the midline of a straight animal during a posteriorly traveling wave, previously utilized in refs. 49 and 58.</p><p>Environmental reaction forces experienced by the undulatory locomotors in this study are shown in Fig. <ref type="figure">3</ref>.</p><p>In the fluid-swimming nematodes analyzed here, locomotion occurs at sufficiently low Reynolds number (the ratio of inertial to viscous forces is approximately 0.1) such that the assumption of zero net force (inertialess locomotion) is well justified. This has an important locomotor consequence: If a nematode stops self-deforming, its locomotory speed will decay to one-half of its steady-state speed within approximately &#8776;5 ms via viscous Stokes drag (see SI Appendix, section 4 and ref. <ref type="bibr">62</ref> for details on the calculation). We will refer to this as the coasting time, coast , and can form a nondimensional parameter, the "coasting number" C = 2 coast / cycle , the ratio of this time to a typical undulatory timescale, cycle ; for a nematode this is cycle &#8776; 1 s. &#182;  We can extend this idea (and thus the inertialess locomotion assumption) to granular undulating systems. We justify our extension by estimating the ratio of inertial to frictional forces in Coulomb friction-dominated systems (which are approximately rate independent):</p><p>, where the numerator is the characteristic dynamic inertial forces and m, v 0 , and cycle are body mass, average speed, and temporal period respectively; the denominator is the characteristic frictional force where and g are the friction coefficient and gravitational acceleration constants respectively. We can rewrite the above as</p><p>where the numerator can be interpreted as the time required to go from steady-state locomotion to a complete stop. Because force in a frictional fluid environment is approximately rate-independent, we have</p><p>In doing so, this ratio is then (in frictiondominated systems) exactly C. Thus, like in the viscous swimmer, in the macroscopic granular swimmers we have analyzed, C is sufficiently small (order 0.1) such that we can neglect inertial effects in granular locomotion (SI Appendix, Tables <ref type="table">S1</ref> and <ref type="table">S2</ref>).</p><p>For forces acting on the body of a viscous drag-dominated nematode, we use Stokes drag from measurements from refs. <ref type="bibr">(60,</ref><ref type="bibr">63)</ref>. In the present study, these values likely represent an approximation of the drag forces, due to the presence of surfaceinduced hydrodynamic effects arising when swimming near a glass substrate. Regarding forces on the granular swimmers in the locomotion systems we studied, elemental forces were determined from previously developed empirical force relations <ref type="bibr">(50,</ref><ref type="bibr">58)</ref>, with modifications made (SI Appendix, section 4) to account for contact dynamics at granular surfaces (Fig. <ref type="figure">3A</ref>). Knowing the elemental forces at each point along the body (depicted in Fig. <ref type="figure">3B</ref>), the instantaneous swimming speed, &#289;b (t), satisfying the force balance in Eq. 2, can be numerically determined (SI Appendix, sections 4 and 5). Notably, &#289;b = [ x , y , ], where each element denotes an instantaneous velocity component in the forward, lateral, and rotational directions expressed in the time-varying local frame of the locomotor (which does not always align with the laboratory frame of reference). It is worth noting that the evaluation of instantaneous velocity is independent of the position of the locomotor with respect to the laboratory frame of reference (g = [x, y, ]). The net displacement over a cycle can be numerically obtained by solving the ordinary differential equation: Our previous work <ref type="bibr">(49,</ref><ref type="bibr">50,</ref><ref type="bibr">55)</ref> demonstrated that RFT agrees with experimentally measured forward speeds (displayed here as body lengths per undulation cycle) of the sandfish lizard and the shovel-nosed snake. RFT calculations predict that intermediate body curvatures result in the largest displacements, and previous studies demonstrated that animals move using body curvatures that nearly coincide with the RFT-predicted speed-maximizing shapes. Given the success of RFT, we will model environmental forces with this approach.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Introducing the Geometric Framework</head><p>RFT does not immediately facilitate ready understanding of how variation in paths in the configuration space results in different amounts of displacement (e.g., what happens to displacement when we go from circle paths to ellipse paths or vary parameters like radius of circle), nor does it permit rapid understanding of why certain paths could be better than others <ref type="bibr">(39,</ref><ref type="bibr">45)</ref>. That is, beyond merely rationalizing observed gaits, what are the principles by which we can predict paths for other living (and ultimately nonliving systems like robots) to achieve optimal performance without having to do laborious calculations? While we will not fully address these questions in this paper, we now illustrate how progress can be made using the geometric phase approach.</p><p>The first step in applying the geometric framework to our systems is to movement as a series of small displacements (translations or rotations), each introduced by small body configuration changes ("self-deformations"). We seek a mapping that relates changes in body configuration space to changes in realworld space. To construct such a map (which will prove valuable in subsequent sections as we build up the machinery of the geometric approach), we next introduce a fundamental assumption in the geometric theory. That is, we assume that the small changes in displacement (small body velocities) are linearly related to small shape changes (small "shape" velocities) via the following:</p><p>where = [w 1 , w 2 ] T is the shape of the system (Fig. <ref type="figure">4-i</ref>); &#729; is the shape velocity, the speed with which the body curvatures are changing; and A( ) is the local connection, which encodes environmental constraint forces that relate changes in body shape to the changes in position that they induce <ref type="bibr">(30)</ref><ref type="bibr">(31)</ref><ref type="bibr">(32)</ref><ref type="bibr">(33)</ref><ref type="bibr">(34)</ref><ref type="bibr">36)</ref>. Each row of the local connection A( ) can the be visualized as a vector field in the shape space (Fig. <ref type="figure">4</ref>-ii).</p><p>In our previous work on geometric methods in locomotion, we showed the validity of the linearity in Eq. 4 of a granular Purcell's three-link swimmer <ref type="bibr">(39)</ref>, which only has two joints (internal shape Dof = 2). Here, we consider a two-dimensional shape space identified by PCA as discussed earlier. We numerically obtained the local connection matrix A using the same approach as discussed in ref. <ref type="bibr">39</ref>. The validity of the linearity assumption for the two-dimensional reduced shape space representation is shown in SI Appendix, Figs. S1-S4 <ref type="bibr">(64,</ref><ref type="bibr">65)</ref>.</p><p>Given the local connection, we aim to identify relationships between the geometries of gaits and the displacements (net body translations or rotations) they produce (the accumulated geometric phase). Notably, Eq. 3 is nonlinear and time-dependent, causing additional challenge to directly calculate the geometric phase. To simplify our analysis, we can approximate Eq. 3 as</p><p>where is now time-invariant. Thus, the net displacement &#916; is uniquely determined by the trajectory of shape change. The establishment of such approximation us to evaluate the geometric phase as the linear, time-independent line integral over the local connection vector field Fig. <ref type="figure">4</ref>-iii. To further visualize and analyze the geometric phase, it can be convenient to turn the line integral into a surface integral via Stokes' theorem <ref type="bibr">(38,</ref><ref type="bibr">66)</ref>. Thus, the net displacement can be approximated by taking the integral of the curvature of A over the region of the shape space enclosed by a gait,</p><p>Taking the individual components of &#8711; &#215; A as height functions yields gait-independent signed scalar maps that provide an intuitive visual depiction of how shape changes relate to net motions <ref type="bibr">(38,</ref><ref type="bibr">39,</ref><ref type="bibr">67)</ref>. Surface integrals over the height functions predict displacements caused by the cyclic sequences of selfdeformation described by the boundary of the enclosed area. As a result, the height function provides a way to identify gaits which produce no displacements (i.e., enclose no net curvature) as well as gaits that yield large displacements (i.e., enclose significant net signed curvature).</p><p>The primary source of error in our approximation Eq. 5 is the fact that matrix multiplication is not commutative <ref type="bibr">(38)</ref>. This effect can be seen in the context of "parallel parking": a car cannot move sideways, but the interplay of forward and rotational velocities can generate an emergent lateral displacement if the forward and rotational velocities are properly sequenced. Hatton et al. <ref type="bibr">(67)</ref> introduced the notion of systematically selecting the system gauge (the choice of body frame) such that the parallelparking effect is suppressed. The chosen gauge is generally close to, but not exactly, the center of mass and mean orientation of the body elements.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Locomotion with Continuous Environmental Contact</head><p>We used Eq. 6 to obtain the height functions shown in the contour plots of Fig. <ref type="figure">5</ref>-i with average animal gaits overlaid in blue. Integrating the height function circles of different radii provides predictions of how displacements per gait cycle, &#916;, depend on the maximum local curvature along the body of the animal, m s (Fig. <ref type="figure">5-ii</ref>).</p><p>For the subsurface movement of the sandfish lizard S. scincus in a frictional fluid (Movie S1 and Fig. <ref type="figure">2 B-ii</ref>) and for swimming of C. elegans in a true fluid (Movie S2 and Fig. <ref type="figure">2 A-ii</ref>), comparisons of animal performance, direct RFT simulations, and height function surface integrals reveal that displacements per cycle are close to predictions (Fig. <ref type="figure">5 A</ref> and <ref type="figure">B</ref>). In the case of the sandfish, biological data from previous studies <ref type="bibr">(49,</ref><ref type="bibr">50,</ref><ref type="bibr">68)</ref> provide a range of local curvatures (SI Appendix, section 3) that are predicted to yield near-maximal displacements per cycle. This is in accord with previous muscle activation measurements that identified these template parameters as targets for the neuromechanical controller <ref type="bibr">(68)</ref>. In the case of the nematode, animal performance is in agreement with RFT and height function integral predictions. It is important to note here that because of power limitations in living (or synthetic) systems, displacement per cycle is not necessarily equivalent to speed. Since power generation capabilities of a swimmer are finite (e.g., muscles are not infinitely strong), larger shape changes (and therefore larger amplitude cycles) require more time to execute <ref type="bibr">(69)</ref>. As a result, in the case of the sandfish, the peak power-limited speed occurs at a slightly smaller amplitude. In contrast, in low viscosity regimes C. elegans is not power limited <ref type="bibr">(59)</ref>. Power limits arise in higher viscosity regimes (e.g., agar), where the nematode uses greater muscle power to deform both its body and the surrounding fluid <ref type="bibr">(59)</ref>. The shovel-nosed snake Ch. occipitalis used different waves for locomotion on the surface of sand and within sand (Fig. <ref type="figure">2 C</ref> and <ref type="figure">D</ref>). For subsurface movement of Ch. occipitalis, the first two PCs only capture 57.6% of the variation in body configurations (Movie S3). One possible explanation for the apparent increase in postural complexity in subsurface movement may result from the increase in spatial frequency relative to surface crawling. As the number of waves along the body increases, traveling waves may become localized to such a degree that the coherence across the entire body is lost. Another possible mechanism may arise from the finite muscle torque provided by the organism in the increased stiffness subsurface environment. Torque limits may cause localized failures to realize a target waveform which may act as a random perturbation causing wave decoherence.</p><p>Despite the lack of clean circularity in the configuration space, previous work showed that RFT and experiment are in good agreement <ref type="bibr">(50)</ref> which we attribute to the locality of granular resistive forces and the low slip locomotion. To test the efficacy of the geometric scheme in such a situation, we constructed the height function using the shape space spanned by the two dominant PCs, and the fully immersed environmental stresses (Fig. <ref type="figure">3A</ref>) is shown in Fig. <ref type="figure">5 C-i</ref>. Predicted displacements from direct RFT simulations and height function surface integrals are in agreement with animal performance (Fig. <ref type="figure">5</ref> C-ii and SI Appendix, sections 4 and 5) and reveal that animals use postural dynamics predicted to yield near-maximal displacement per cycle.</p><p>The surface waveform used by Ch. occipitalis, which has fewer waves and lower curvatures, produces low-slip movement that leaves behind a well-defined track of depth &#8776;5 mm (55) (Movie S4). Given that RFT measurements for movement at the surface used a flat plate intruder, we added an additional term to the measured RFT relations to account for the kinetic Coulomb friction drag that opposes the motion of the local segment (SI Appendix, section 4). Predictions from direct RFT simulation and height function surface integrals are in agreement with animal performance (Fig. <ref type="figure">5 D-ii</ref>). We can rationalize the difference in the subsurface and surface waveforms by considering that granular drag force increases with intruder depth. For a fixed depth, increasing wave curvature and/or wavenumber decreases the amount of torque joints must produce <ref type="bibr">(55)</ref>. Thus, when moving subsurface the snake can contend with the increased environmental forces by adjusting its waveform to reduce the torque required.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>In Place Turns in Limbless Locomotors</head><p>To navigate in complex terrain, effective turning (reorientation combined with or without translation) is as important as translation <ref type="bibr">(21,</ref><ref type="bibr">52,</ref><ref type="bibr">70)</ref>. However, unlike in forward motion, both the wavelength and the amplitude of the worm body wave become time dependent <ref type="bibr">(52)</ref>, leading to additional challenges to reconstruct the turning behavior. It was hypothesized that additional PCs (eigenworms) are needed to fully describe the turning behaviors <ref type="bibr">(52)</ref>. Here, we hypothesize that turning and forward behaviors may share some common dynamics. Specifically, we posited that turning is a modulation of the serpenoid template in the shape space that can be rationalized by the geometric phase approach. Note that to fully describe worm turning behaviors on agar, we require 4 PC modes, as discussed in refs. 71 and 72. However, in this study, we demonstrate that 2 PC modes are sufficient to characterize worm turning in buffer fluid.</p><p>The nematode exhibits extraordinary maneuverability in part because of its ability to perform omega turns <ref type="bibr">(73)</ref>. The turning motion is called an omega turn because during the course of turning the anterior end of the body (head) sweeps near the posterior end of the body (tail), inscribing an "Omega" (&#937;) shape (Fig. <ref type="figure">6A</ref>). In Fig. <ref type="figure">6A</ref>, we illustrate an example of an omega turn in C. elegans. It is worth noting that the worm body in &#937; shape cannot be readily prescribed by a sinusoidal function. During an omega turn, the worm body orientation experiences significant (typically over 60 &#8226; ) rotation with negligible translation (typically less than 0.1 BL/cycle; see Fig. <ref type="figure">6A</ref>). We refer to this type of nontranslating turning behavior as an in-place turn. The efficacy of such turns has made them targets for control of turning in robots <ref type="bibr">(71,</ref><ref type="bibr">72)</ref>. We perform PCA to explore the omega turn kinematics and notice that the modes of C. elegans forward motion and turning motion are surprisingly similar. Specifically, the two standard sinusoidal modes identified in C. elegans forward motion (Fig. <ref type="figure">2</ref> A-iii) can explain over 80% of the total variation of curvatures in turning motion. In Fig. <ref type="figure">6B</ref>, we compare the PCs calculated from isolated recordings of turning motion (solid thick curves) and the standard sinusoidal basis derived from isolated recordings of forward motion (dashed thin curves, same as Fig. <ref type="figure">2 A-iii</ref>).</p><p>In omega turn kinematics, there is a significant difference between the variance explained by the first PC (which we will refer to as mode 1) and the second PC (which we will refer to as mode 2), hence their order is not arbitrary, in contrast to the case of forward crawling described above. The similarity of the PC modes in forward and turning motions suggests a conserved shape space can realize a variety of behaviors.</p><p>Unlike in forward motion, for turning behaviors we notice that the trajectories in the shape space are centered off-origin along the w 1 axis (hence the difference in the amount of variance explained by each PC). Notably, clockwise (CW) turns are typically associated with positive w 1 offset and counterclockwise (CCW) with a negative offset (Fig. <ref type="figure">6C</ref>). For each trial (20 individuals, one trial per individual), we calculate the distance of the center of the recorded space shape trajectory from the origin (x c ) and measure the net rotation the space. Fig. <ref type="figure">6E</ref> shows clear correlation between x c and the body rotation (each trial measurement is represented as a blue dot).</p><p>In the 2D plane, there are three connection vector fields (corresponding to forward, lateral, and turning dynamics, Eq. 3). We can use the same methods narrated above to generate height functions for each. Performing these calculations (SI Appendix, section 5E), the rotational height function reveals two distinct positive and negative regions along the w 1 axis (Fig. <ref type="figure">6D</ref>). To quantify the turning modulation, we perform the surface integral over standard circular templates (with a radius of m s = 8) subject to different offsets in w 1 axis. We bound the uncertainty in effective drag anisotropy by computing a series of height function with different drag anisotropy (d a ). We compare the geometric phase approach predictions on displacement and rotation with the empirically measured data in Fig. <ref type="figure">6E</ref> and observe good agreement. Thus, a shape space made with a common set of modes can describe both worm forward swimming and turning in fluids, simply by applying the appropriate height function; near-optimal turns can be achieved with the modes from forward crawling through amplitude modulation that serves to offset circular templates gaits from the origin. This suggests that to turn, organisms may capitalize on common neural means of coordination associated with forward locomotion, as turns and forward crawling share a similar low-dimensional representation.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Sidewinding: Locomotion with Changing Environmental Contact</head><p>Thus far in the paper, systems studied are assumed to maintain continuous full-body contact with the environment during selfpropulsion. However, many animals lift limbs or body portions as they move, changing their contact state throughout a gait cycle <ref type="bibr">(74,</ref><ref type="bibr">75)</ref>. We therefore sought to build on our previous success in applying the geometric framework to such situations in robophysical models <ref type="bibr">(76)</ref><ref type="bibr">(77)</ref><ref type="bibr">(78)</ref>. Following the other examples of undulatory behavior in this work, we chose an organism that modulates environmental contact within a flowable resistive environment with vertical waves, the rattlesnake, Cr. cerastes (Fig. <ref type="figure">7A</ref>). This organism encounters sandy substrates in its native North American desert habitat and moves by sidewinding. Sidewinders locomote on homogeneous substrates <ref type="bibr">(79,</ref><ref type="bibr">80)</ref> by propagating a wave of planar body undulation coupled to an offset wave of body lifting (Fig. <ref type="figure">7B</ref>), resulting in each body segment being cyclically lifted clear of the substrate, moved forward, placed into a nearly static contact, then lifted again, with a slight phase offset between successive segments (75, 81-83) (Movie S5). Thus, the snake generates multiple head-to-tail propagating regions of lifted movement and nearly static ground contact and moves at a nonzero angle relative to the overall headto-tail body axis (Fig. <ref type="figure">7C</ref>) <ref type="bibr">(75,</ref><ref type="bibr">77,</ref><ref type="bibr">(81)</ref><ref type="bibr">(82)</ref><ref type="bibr">(83)</ref>.</p><p>Despite the apparent complexity of these movements, our previous work indicated that the self-deformation pattern of Cr. cerastes could be characterized as a template consisting of a superposition of a planar and vertical traveling wave <ref type="bibr">(21)</ref>, with a phase shift of &#177; /2 between them (Fig. <ref type="figure">7B</ref>). The modulation (e.g., changes in the maximum amplitude) of these waves can lead to diverse behaviors <ref type="bibr">(21,</ref><ref type="bibr">77,</ref><ref type="bibr">84)</ref>. However, sidewinders tend to use relatively consistent horizontal waves during forward motion and are typically thought to regulate forward speed using temporal frequency changes of the wave <ref type="bibr">(75,</ref><ref type="bibr">79,</ref><ref type="bibr">84)</ref>.</p><p>Indeed, when we applied PCA to horizontal wave dynamics of previously collected Cr. cerastes data, we found that, across trials dynamics of the horizontal wave consists of a circular path in a two sinuous mode configuration space (Fig. <ref type="figure">8 A</ref> and <ref type="figure">B</ref>) of a characteristic radius (and therefore maximal body curvature). We thus posit that this circle forms a control template enabling these animals to move rapidly over loose granular surfaces.</p><p>Although the vertical body dynamics have not been carefully experimentally resolved <ref type="bibr">(84)</ref>, they are assumed to be a traveling wave (and thus described by two modes) that sets the periodic contact pattern (Fig. <ref type="figure">8 A</ref> and <ref type="figure">B</ref>). On level granular media <ref type="bibr">(21,</ref><ref type="bibr">84)</ref>, parameters describing the vertical template remained approximately constant. Therefore, to model the vertical wave interaction, as in refs. 21, 77, and 85, we introduced a weighting prefactor, c, that specified how much of the environmental force each infinitesimal segment experienced. # Specifically, we modify the resistive force balance in Eq. 2 as</p><p>Previous work <ref type="bibr">(21)</ref> revealed that the three-dimensional pose of Cr. cerastes could be represented by a horizontal wave (characterized by w 1 , w 2 ) coupled to a phase-shifted vertical wave that sets the environmental contact condition. To properly couple the contact function to the in-plane shape, we introduced the vertical wave:</p><p>where a is the amplitude of the vertical wave, w 1 and w 2 describe the in-plane wave shape. To set the contact using the vertical wave description, , we defined the smoothly varying function c(s) = 1/ 1 + exp[ (s) + b] , where c &#8712; [0, 1] sets the local fraction of the environmental force experienced as a function of position along the body, and b sets contact width. To be consistent with previous observations, a = 15 and b = 0.5 are chosen so that approximately 34% of the animal's body is on the ground <ref type="bibr">(84)</ref>. Fig. <ref type="figure">7B</ref> shows how environmental contact couples to an in-plane shape, and Fig. <ref type="figure">8C</ref> shows how this contact varies throughout the in-plane shape space for an animal with n = 1.5 waves along its body. Fig. <ref type="figure">8D</ref> shows four RFT simulation snapshots throughout one undulation cycle. Contact patches (dark regions) originate near the head and are propagated toward the tail. Given the experimentally observed oblique direction of travel (relative to the head-to-tail body axis), we expect the kinematics in our modeling to produce significant displacements in both the x (forward) and y (lateral) directions. We therefore numerically computed connection vector fields (Fig. <ref type="figure">9A</ref>) and height functions to visually and intuitively prescribe motions along both the x and y directions (Fig. <ref type="figure">9B</ref>). We define the total predicted displacement is given as &#916; = (&#916; 2</p><p>x +&#916; 2 y ) 1/2 , where &#916; x and &#916; y are displacements predicted from x and y height functions, respectively. Fig. <ref type="figure">9C</ref> shows that, for movement on granular media, direct RFT simulations (dashed tan curve) and geometric computations (solid tan curve) predict similar maximal displacements. The RFT gait predicted to yield peak performance differ slightly from those predicted to from the "cartoon model" presumably because at large amplitudes slip in the primary direction of motion occurs. Despite the differences in predicted gait amplitude, the displacement curves predicted are not highly sensitive to gait amplitude variation over a broad range. Note that the discrepancy between RFT simulation and geometric phase approach for sidewinding on sand can be a result of the noncommutativity of body velocities. As shown in Fig. <ref type="figure">9A</ref>, the body velocity in xand y-directions have comparable magnitudes, which can lead to relatively large noncommutativity effect in body velocities <ref type="bibr">(38)</ref>.</p><p>Differential Turns in Sidewinding. As with the worms, the geometric phase approach can also help rationalize the spectrum of "differential turns" observed in Cr. cerastes <ref type="bibr">(21)</ref>. Such turns are interesting because those sidewinders can modulate the net translational displacement associated with a particular turning angle. That is, sharp differential turns (e.g., &#8764;90 &#8226; per cycle) are often accompanied by reduced translational displacement, and gradual differential turns (e.g., less than 20 &#8226; per cycle) by large translation. Therefore, unlike in straight sidewinding where the animals use relatively consistent horizontal waves (e.g., consistent wave amplitude and propagation speed), animals exhibit varying horizontal wave dynamics during differential turns.</p><p>The differential turning mode, first analyzed by Astley et al. horizontal wave (Fig. <ref type="figure">10A</ref>). Depending on the of modulation, can control the degree of turning during translation. Notably, in prior work, the amplitude modulation refers to the modulation of elemental velocity distribution (from anterior to posterior) <ref type="bibr">(21)</ref>. It is yet not clear how internal curvature should be adapted to facilitate such amplitude modulation on spatial velocity distribution.</p><p>We used PCA to find the curvature modes during differential turns. We noticed that the first two principal components can account for over 69.1% of the variance (Fig. <ref type="figure">10B</ref>); and the two modes for straight sidewinding are almost identical to those for differential turns with two subtle differences: i) the spatial frequency changes from 1.5 in straight sidewinding 1.2 in differential turn, and ii) the phasing relationship between two modes changes from mode 1 ahead of mode 2 in straight sidewinding to mode 2 ahead of mode 1 in differential turn. We suspect that these subtle changes emerged from the variation in the horizontal wave. We project body curvatures during differential turns onto the first two PC modes (Fig. <ref type="figure">10C</ref>). We notice that the configuration space trajectory is approximately circular, with its center offset from the origin. As with the worm turning, we posit that the offset of the center from the origin can serve as an indicator of the degree of turning and translation in the snakes. We measure the rotation and translation for each cycle (95 cycles over 47 trials, a trial might include multiple cycles). The translation (Fig. <ref type="figure">10 E</ref>, <ref type="figure">Left</ref>) and rotation (Fig. <ref type="figure">10 E</ref>, Right) in each cycle (represented as a blue dot) are plotted as a function of w 1 -offset of the trajectory center (arithmetic average) from the origin. Linear regression between w 1 -offset and rotation shows significant relationships (translation: r 2 = 0.20, P &lt; 0.01; rotation: r 2 = 0.50, P &lt; 0.01).</p><p>We use the geometric phase approach to explain the observed correlation. We numerically compute the height functions (Fig. <ref type="figure">10D</ref>) on granular media using the same contact function and RFT relationships as straight sidewinding. The clusters of positive and negative volumes are distributed along the axis of w 2 = 0 in height function, indicating that the introduction of offset in w 1 direction can indeed lead to body rotation.</p><p>We then perform surface integrals over circular gaits on the height functions. Specifically, we used the following equations to prescribe off-centered circles in the calculation:</p><p>[8]</p><p>We compare the surface integral with RFT calculation (integrating Eq. 8 over a cycle t &#8712; [0 2 )) and the fitted linear regression, and observed good agreement. ||  Our analysis illustrates that the seemingly distinct behaviors of straight sidewinding and differential turn (through amplitude modulation on spatial velocity distribution) share the same shape space (PC modes). Moreover, the simple modulation scheme (with a single variable: w 1 -offset) reconstructs the complicated spectrum of behaviors with different degrees of displacement and rotation, which further facilitates a relatively simple understanding of seemingly complex sidewinder locomotion.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Discussion and Conclusions</head><p>In this paper, we presented a biological experimental application of a geometric framework of locomotion proposed in the 1980s by physicists <ref type="bibr">(25)</ref> to describe movement and developed during the last three decades for robotic applications by control theorists <ref type="bibr">(29,</ref><ref type="bibr">31,</ref><ref type="bibr">38)</ref>. Application of this framework to organisms across scales and levels of complexity revealed that selfdeformation kinematics were well described by serpenoid templates (near circular paths in low-dimensional body configuration spaces). Further, observed animal self-deformation kinematics and locomotor performance coincided with predictions that nearly maximized the surface integral over this curve in a diagram called a height function, which corresponds to nearly maximizing a geometric phase in the space of animal body configurations. We can thus posit that a emergent guiding principle for control of limbless undulatory locomotion in highly damped environments || Note that forward and lateral height functions in Fig. <ref type="figure">10D</ref> have opposite sign to those in Fig. <ref type="figure">9</ref> because of the changes in the relative phasing relationship between mode 1 and 2.</p><p>is: maximize geometric phase relative to the time/effort needed to complete the cycle, using a template which is approximately a circle in a two-dimensional configuration space. This is true both in situations with continuous and variable environmental contact-for cm-scale lizards and snakes in flowable (granular) and frictional environments (both of which are ubiquitous in natural organism environments) as well as a tiny nematode worm in a fluid environment. Finally, modulations to serpenoid templates can explain the turning behaviors (omega turn and differential turn), which further indicates the generality our templates of the underlying physiological, neural, and biomechanical mechanisms responsible for the selfdeformation patterns.</p><p>Why is this seemingly abstract approach, requiring mathematical tools not traditionally represented in the fields of bio-and neuromechanics, of value in locomotion analysis? First, recognition that the dimensionality reduction scheme proposed in ref. <ref type="bibr">52</ref> applies to diverse and significantly more complex organisms than nematode worms is a useful step in discovery of candidate templates (i.e., high-level control targets). Second, the diagrammatic approach simplifies search for candidate paths in configuration spaces; typically such a search requires brute force computation of all allowed paths but with height functions in hand, optimal selfdeformation patterns for translation rotation <ref type="bibr">(71)</ref>] becomes relatively straightforward to hypothesize. Third, the scheme can be readily adapted <ref type="bibr">(69)</ref> to imposing biologically relevant constraints like internal force, power, or energetic limitations.</p><p>Amplifying on this last point, to demonstrate our method, in this paper, all computations were performed in the space of shape changes, where all shape changes are equally easy to execute and the geometric phase nearly maximized displacement per cycle. But recent work (69) has demonstrated connection vector fields can be computed within modified metric spaces (such as weighting shape changes by internal force and power requirements). Modifying the underlying metric to account for physiologically relevant constraints could provide insights into the goals and limitations associated with a broader range of behavior and inherent biological variability. With such theoretical tools in concert with new experimental tools, we can now address how lower-level physiological, neural, and biomechanical mechanisms ["anchors" in the parlance of Full and Koditschek <ref type="bibr">(13)</ref>] conspire to generate the template dynamics <ref type="bibr">(18,</ref><ref type="bibr">68)</ref>. In large-scale organisms, electromyographic and neural recording tools at the macroscale have been used for decades to assay neuromechanical control across taxa <ref type="bibr">(86)</ref>. Relevant to animals studied here, such tools proved useful to test a hypothesis of shape control in sandfish locomotion <ref type="bibr">(68)</ref>. However, such tools provide crude assays relative to those available in model organisms (like C. elegans). The optical transparency and genetic mutability of these worms provide experimental opportunities to connect templates to underlying anchors through genetic circuit manipulation, optogenetics, and calcium imaging. Using the geometric scheme to develop templates for diverse environments, we can, for example, test the hypothesis that nematodes control for force and thus shapes emergently arise from neuromechanical feedback <ref type="bibr">(10,</ref><ref type="bibr">87)</ref>.</p><p>Finally, the results in this paper used reductions of the kinematics of animal movements to simple patterns of self-deformation and used RFT to describe environmental interactions. We posit that this is because we focused on relatively simple tasks, such as escape and steady transit in homogeneous media. The extent to which more complex locomotor behaviors (e.g., refs. 88 and 89) could be amenable to such simplification remains an open question. Complexity may arise from unusual gait paths in the shape spaces or from additional modes. While C. elegans uses a circular gait in agar <ref type="bibr">(52)</ref>, changes in the viscosity of the environment could lead to a spectrum of gaits, ranging from circular to elliptical gaits. Such gait spectrum is observed in the continuum of lizard body elongation and limb reduction, where elliptical gaits emerge as limb size reduces <ref type="bibr">(22)</ref>. Generalizations to more complex descriptions (e.g., more modes) are straightforwardgeometric methods can handle higher dimension although the visualization of height functions becomes more difficult <ref type="bibr">(90,</ref><ref type="bibr">91)</ref>. It will be interesting to explore other, potentially more complex, locomotor behaviors not described by planar traveling waves of body bends [e.g., rectilinear motion in snakes and peristalsis in worms, walking and crutching of mudskippers <ref type="bibr">(76)</ref>].</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Materials and Methods</head><p>For all experiments, high-speed videos (excluding C. elegans) were recorded as animals moved on various substrates, and animal postures were obtained by identifying tracking features located along the midline of the dorsal side (lateral side for C. elegans) of the animal in each frame. For subsurface animals, lead markers glued to the animal were visible in X-ray images and extracted as a part of a previous study <ref type="bibr">(50)</ref>. For surface animals, either markers or features on the snakes were tracked through time, and again these points were interpolated using a cubic spline. For C. elegans, animals were placed in 10 &#956;L of S-basal on a glass slide. 3D movement was constrained by a glass coverslip to a 50 &#956;m height, with the use of tape (Kapton). Worms were imaged using a brightfield microscope (Leica ATC 2000). For forward crawling data, midlines were obtained using custom MATLAB code. Binary masks of the organism were created via thresholding. The binary masks were then skeletonized and splined. For turning data, DeepLabCut (92) was used to track the self-occluding postures where binarization and skeletonization fails. For Ch. occipitalis on the surface of sand, the positions of naturally occurring evenly spaced black bands were identified in each video image frame as part of a previous study <ref type="bibr">(55)</ref>. For Cr. cerastes, infraredreflective markers were placed along the animal, and a Natural Point Optitrack Flex 13 camera system automatically identified and recorded marker positions at 120 frames per second. Further biological information and experimental details for S. scincus and Ch. occipitalis are given in SI Appendix, Table <ref type="table">S1</ref> and for Cr. cerastes in SI Appendix, Table <ref type="table">S2</ref>. Details on numerical analysis and geometric phase approach are provided in SI Appendix, sections 3-5.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_0"><p>of 12 https://doi.org/10.1073/pnas.2320517121 pnas.org Downloaded from https://www.pnas.org by "GEORGIA INSTITUTE OF TECHNOLOGY, SERIALS CONTROL-EBS" on August 26, 2024 from IP address 75.24.196.82.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_1"><p>PNAS 2024 Vol. 121 No. 24 e2320517121 https://doi.org/10.1073/pnas.2320517121</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_2"><p>Downloaded from https://www.pnas.org by "GEORGIA INSTITUTE OF TECHNOLOGY, SERIALS CONTROL-EBS" on August 26, 2024 from IP address75.24.196.82.   </p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_3"><p>&#182; Note that the coasting number can also be defined as the coasting distance (from stop self-deforming to complete stop) normalized by the characteristic length scale. The relationship between time-scale coasting number and length-scale coasting number is discussed in SI Appendix, section 4.4 of 12 https://doi.org/10.1073/pnas.2320517121 pnas.org Downloaded from https://www.pnas.org by "GEORGIA INSTITUTE OF TECHNOLOGY, SERIALS CONTROL-EBS" on August 26, 2024 from IP address75.24.196.82.   </p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_4"><p>PNAS 2024 Vol. 121 No. 24 e2320517121 https://doi.org/10.1073/pnas.2320517121 5 of 12 Downloaded from https://www.pnas.org by "GEORGIA INSTITUTE OF TECHNOLOGY, SERIALS CONTROL-EBS" on August 26, 2024 from IP address 75.24.196.82.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="6" xml:id="foot_5"><p>of 12 https://doi.org/10.1073/pnas.2320517121 pnas.org Downloaded from https://www.pnas.org by "GEORGIA INSTITUTE OF TECHNOLOGY, SERIALS CONTROL-EBS" on August 26, 2024 from IP address</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_6"><p>75.24.196.82.   </p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_7"><p># We also modified our force balance to ensure that the total weight of remains unchanged (SI Appendix, section 4). 8 of 12 https://doi.org/10.1073/pnas.2320517121 pnas.org Downloaded from https://www.pnas.org by "GEORGIA INSTITUTE OF TECHNOLOGY, SERIALS CONTROL-EBS" on August 26, 2024 from IP address 75.24.196.82.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_8"><p>PNAS 2024 Vol. 121 No. 24 e2320517121 https://doi.org/10.1073/pnas.2320517121 9 of 12 Downloaded from https://www.pnas.org by "GEORGIA INSTITUTE OF TECHNOLOGY, SERIALS CONTROL-EBS" on August 26, 2024 from IP address 75.24.196.82.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="10" xml:id="foot_9"><p>of 12 https://doi.org/10.1073/pnas.2320517121 pnas.org Downloaded from https://www.pnas.org by "GEORGIA INSTITUTE OF TECHNOLOGY, SERIALS CONTROL-EBS" on August 26, 2024 from IP address 75.24.196.82.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="12" xml:id="foot_10"><p>of 12 https://doi.org/10.1073/pnas.2320517121 pnas.org Downloaded from https://www.pnas.org by "GEORGIA INSTITUTE OF TECHNOLOGY, SERIALS CONTROL-EBS" on August 26, 2024 from IP address 75.24.196.82.</p></note>
		</body>
		</text>
</TEI>
