<?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'>Efficient bending and lifting patterns in snake locomotion</title></titleStmt>
			<publicationStmt>
				<publisher></publisher>
				<date>10/01/2022</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10373973</idno>
					<idno type="doi">10.1098/rspa.2022.0312</idno>
					<title level='j'>Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences</title>
<idno>1364-5021</idno>
<biblScope unit="volume">478</biblScope>
<biblScope unit="issue">2266</biblScope>					

					<author>S. Alben</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[We optimize three-dimensional snake kinematics for locomotor efficiency. We assume a general space-curve representation of the snake backbone with small-to-moderate lifting off the ground and negligible body inertia. The cost of locomotion includes work against friction and internal viscous dissipation. When restricted to planar kinematics, our population-based optimization method finds the same types of optima as a previous Newton-based method. With lifting, a few types of optimal motions prevail. We have an s-shaped body with alternating lifting of the middle and ends at small-to-moderate transverse friction. With large transverse friction, curling and sliding motions are typical at small viscous dissipation, replaced by large-amplitude bending at large viscous dissipation. With small viscous dissipation, we find local optima that resemble sidewinding motions across friction coefficient space. They are always suboptimal to alternating lifting motions, with average input power 10–100% higher.]]></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"><head n="1.">Introduction</head><p>Snakes have a relatively simple body geometry but can perform a wide range of locomotor behaviours. They are useful for understanding the mechanics of locomotion in terrestrial and even aquatic <ref type="bibr">[1]</ref> and aerial <ref type="bibr">[2]</ref> environments. Snakes are also an important source of ideas for bioinspired robots <ref type="bibr">[3]</ref><ref type="bibr">[4]</ref><ref type="bibr">[5]</ref><ref type="bibr">[6]</ref><ref type="bibr">[7]</ref><ref type="bibr">[8]</ref>, and their limblessness has advantages for control, adaptability, and navigation in complex and cluttered environments <ref type="bibr">[9]</ref><ref type="bibr">[10]</ref><ref type="bibr">[11]</ref>. Although a wide range of motions are possible, four major modes of snake locomotion-serpentine, concertina, sidewinding and rectilinear-have been described and studied most often <ref type="bibr">[12]</ref><ref type="bibr">[13]</ref><ref type="bibr">[14]</ref><ref type="bibr">[15]</ref>, though the true diversity of motions is greater <ref type="bibr">[4,</ref><ref type="bibr">16,</ref><ref type="bibr">17]</ref>.</p><p>Many common biological snake motions such as serpentine locomotion have been modelled successfully by assuming planar motions with a simple <ref type="bibr">(Coulomb)</ref> 2022 The Author(s) Published by the Royal Society. All rights reserved. frictional model <ref type="bibr">[18]</ref><ref type="bibr">[19]</ref><ref type="bibr">[20]</ref><ref type="bibr">[21]</ref><ref type="bibr">[22]</ref><ref type="bibr">[23]</ref><ref type="bibr">[24]</ref><ref type="bibr">[25]</ref><ref type="bibr">[26]</ref>. Serpentine and concertina-like motions were found to be optimally efficient among general time-periodic kinematics of three-link <ref type="bibr">[27]</ref> and smooth bodies <ref type="bibr">[28,</ref><ref type="bibr">29]</ref>. For certain body geometries and frictional anisotropies, other motions, beyond those observed biologically, were found to be optimal <ref type="bibr">[30]</ref><ref type="bibr">[31]</ref><ref type="bibr">[32]</ref>.</p><p>These models assume a resistive force law, local in the velocity, which is somewhat simpler than many fluid locomotion models <ref type="bibr">[33]</ref><ref type="bibr">[34]</ref><ref type="bibr">[35]</ref><ref type="bibr">[36]</ref>. Nonetheless, even the simplest planar models with Coulomb friction are too complicated to be solved theoretically with large-amplitude motions, so the physics of many motions are not well understood, and computational models and explorations of the types of efficient dynamics over parameter space play an important role.</p><p>Of the four major modes of locomotion, non-planar kinematics feature most strongly in sidewinding <ref type="bibr">[12,</ref><ref type="bibr">14,</ref><ref type="bibr">37]</ref>. References <ref type="bibr">[8,</ref><ref type="bibr">37]</ref> demonstrated that sidewinding can be represented as a pair of orthogonal body waves (vertical and horizontal) that can be independently modulated to achieve high manoeuverability and ascend inclines. The other major modes are not perfectly planar in real snakes or robots but can be approximated well by bodies that remain planar. The serpentine mode often features lifting at the curvature peaks, termed 'sinus-lifting' <ref type="bibr">[3,</ref><ref type="bibr">4]</ref> and modelled in <ref type="bibr">[22,</ref><ref type="bibr">23]</ref> using planar shapes together with a weight distribution function. <ref type="bibr">[38]</ref> used planar shapes together with the weight distribution function approach of <ref type="bibr">[22,</ref><ref type="bibr">23]</ref> to model sidewinding and other three-dimensional motions. Using a travelling-wave weight distribution function that is phase shifted from a travelling-wave body curvature they found a wide range of turning, slithering and sidewinding motions. Rieser et al. <ref type="bibr">[26]</ref> used similar techniques to model sidewinding locomotion and found higher speeds with isotropic friction than with dominant transverse friction.</p><p>Here, instead of a planar curve with a weight distribution function, we represent the snake body as a time-dependent three-dimensional space curve. Given the space curve shape, the regions of contact and lifting arise naturally from solving the dynamical equations. We prefer this direct approach because it removes the question of which three-dimensional shape, if any, would produce a prescribed weight distribution function. The weight distribution depends on the equilibrium position of the space curve under gravity and may be sensitive to slight changes in the curve's shape.</p><p>Three-dimensionality opens up new possibilities for interesting mechanisms of locomotion. Some three-dimensional motions may have higher efficiency than similar two-dimensional motions, e.g. sinus-lifting versus lateral undulation, and three-dimensional motions may be necessary for traversing uneven ground and obstacles. Some three-dimensional studies have focused on modifications of sidewinding motions: <ref type="bibr">[10]</ref> showed how sidewinding waveforms can be modulated in biological and robotic snakes to move around peg obstacles and <ref type="bibr">[39]</ref> developed a geometric mechanics method to find optimal contact patterns for sidewinding robotic snakes for maximum speed. Other types of three-dimensional motions have also been studied: <ref type="bibr">[11]</ref> studied experimentally how snakes use a combination of lateral and vertical bending to traverse uneven terrain made up of blocks with vertical and horizontal planar surfaces; <ref type="bibr">[9]</ref> showed that body compliance can help snakes traverse obstacles stably.</p><p>As in our previous planar locomotion studies <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>, we study non-planar motions using an optimization framework. It is not feasible to describe the full range of locomotor behaviours across the space of geometrical and physical parameters. Focusing on those that are optimally efficient is more manageable, even if they do not fully describe the possibilities. The optimal solutions indicate the trade-offs between the objectives and constraints in the problem, and how they depend on the parameters <ref type="bibr">[40]</ref>. The optimal solutions can provide effective strategies and suggest general mechanisms for robotic locomotion <ref type="bibr">[5,</ref><ref type="bibr">39]</ref>. The relationship between the optima and biological organisms is less clear, as the model omits many physiological aspects, and the importance of mechanical efficiency to reproductive success varies widely among organisms <ref type="bibr">[41]</ref>. Locomotor efficiency on sandy surfaces is often mentioned in explanations of the sidewinding gait, but other benefits-avoiding predators, minimizing contact with hot surfaces and increasing sensory perception-are also discussed <ref type="bibr">[42]</ref>. Comparing the optimal solutions to biological  <ref type="bibr">[40]</ref>.</p><p>In <ref type="bibr">[28,</ref><ref type="bibr">31]</ref>, we used quasi-Newton optimization methods; in <ref type="bibr">[28,</ref><ref type="bibr">29]</ref> we used theoretical methods applicable to small body deflections; in <ref type="bibr">[30]</ref> we used a commercial solver; and in <ref type="bibr">[32]</ref>, we used a stochastic population-based optimization method. Here, we also use a stochastic population-based method, because it is relatively simple and turns out to be effective and robust for the problem at hand. Convergence is generically slower than for Newton-based optimization methods, but those methods may have difficulties because the normal contact and tangential Coulomb friction forces where the body meets the ground are singular (or nearly singular in the regularized model we use), which also causes singularities in derivatives of the objective function.</p><p>Section 2 describes our model of a locomoting snake-a curve in three-dimensional space with curvature and torsion that vary with arc length and time. The curve moves according to Newton's Laws, with forces due to friction and normal contact with a planar ground. Unlike our previous optimization studies, here we include the body's internal viscous dissipation in the cost function. We use implicit time stepping to evolve the body's motion. Section 3 describes our optimization method. We compute the motions of a population of locomoting bodies, select a top-performing subset, and use random perturbations of its members to form the population at the next generation. After many generations, the population converges to the vicinity of a local optimum.</p><p>Section 4 describes the computed optima and how they vary with key parameters such as the numbers of modes describing the curvature and torsion ( &#167;4a). Section 4b shows how the algorithm behaves in the special case of planar motions, with and without internal viscosity. In the latter case, good agreement with <ref type="bibr">[28]</ref> is found. Section 4c then shows how the optimal motions change when lifting is allowed. With small-to-moderate lifting, the effects of frictional anisotropy and damping are studied in &#167;4d. A special class of optima that resemble sidewinding motions are shown in &#167;4e, and special types of analytical optima are presented in &#167;5. Section 6 gives the conclusion.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">Model</head><p>In previous work, we assumed that the snake body was a curve in the two-dimensional plane, with a prescribed shape given by its curvature &#954;(s, t), where s is arc length and t is time. Now, we assume the body is a curve in three-dimensional space (figure <ref type="figure">1</ref>), so the shape is given by its curvature &#954;(s, t) and torsion &#964; (s, t) <ref type="bibr">[43]</ref>. We assume that &#954;(s, t) and &#964; (s, t) are periodic in time with period T. Given &#954; and &#964; , we can integrate the Frenet-Serret formulae</p><p>to obtain the body tangent, normal and binormal vectors {&#349;(s, t), n(s, t), b(s, t)}, if we know these vectors at one s value, say s = 0 (the tail). The values of these vectors at the tail can be written as the columns of a three-dimensional rotation matrix</p><p>where R z , R y and R x are the matrices for counterclockwise rotations about the z-, y-and x-axes by (Euler) angles &#945;(t), &#946;(t) and &#947; (t), respectively <ref type="bibr">[43]</ref>.</p><p>After integrating the Frenet-Serret formulas, we have &#349;(s, t) = &#8706; s X(s, t), where X(s, t) = [x(s, t), y(s, t), z(s, t)] T is the position of the body. Given the position of the body at the tail, X 0 (t) &#8801; X(0, t), we integrate &#349; to obtain the position all along the body,</p><p>To summarize, given the shape of the body (&#954; and &#964; ), and the six unknowns {X 0 (t), &#945;(t), &#946;(t), &#947; (t)} specifying its position and orientation at the tail, we can integrate to obtain X(s, t). At each t, we solve for the six unknowns by enforcing six equations, the linear and angular momentum balances for the snake body as a whole</p><p>Here, L is the body's length, &#961; is its mass per unit length and f ext is the external force on the body due to normal contact with the ground, gravity and friction</p><p>and</p><p>Here, g is gravitational acceleration and H is the Heaviside function. Instead of a hard or rigid contact force that rises in magnitude from 0 to +&#8734; when the body penetrates the ground at z = 0, the contact force magnitude is very small when z &#948; w and very large when z -&#948; w . We set &#948; w = 10 -3 L, approximating the hard contact limit. Making &#948; w much smaller than 10 -3 L does not noticeably alter the body dynamics in our computations but can significantly increase the number of iterations required by our iterative solver of the nonlinear ODE system (2.3). The frictional force model is an extension of the two-dimensional version used in several previous works <ref type="bibr">[18]</ref><ref type="bibr">[19]</ref><ref type="bibr">[20]</ref><ref type="bibr">[21]</ref><ref type="bibr">[22]</ref><ref type="bibr">27]</ref>. Sliding friction opposes the component of velocity tangent to the ground, written here as &#8706; t X 2D , the projection of the body velocity in the x-y plane. The frictional force magnitude is proportional to the contact force magnitude and approximately independent of the velocity magnitude, following the Coulomb friction model. We allow for anisotropic friction that corresponds to easier sliding in certain directions. For example, snake scales allow for smaller friction when the snake slides toward the head, in the &#349; direction, instead of towards the tail or perpendicular to the body axis <ref type="bibr">[19,</ref><ref type="bibr">22]</ref>. Stronger anisotropies can occur in robotic snakes due to wheels or active scales on the body surface <ref type="bibr">[3,</ref><ref type="bibr">24,</ref><ref type="bibr">44]</ref>. In (2.5), the friction coefficients &#956; s and &#956; n are used for the components of velocity that are parallel to the ground and tangent to the backbone, or perpendicular to the backbone, respectively. Here, &#349;2D is the projection of &#349; in the x-y plane, so the frictional force acts tangentially to the ground, and its magnitude decreases as &#349; becomes more vertical at a contact. Typically, &#349; &#8776; &#349;2D at a contact on the body's interior, because the body is smooth and almost tangent to the ground at a contact (otherwise it would penetrate the ground). At the ends of the body, &#349; may be somewhat more vertical, though in the computations we will limit the non-planarity of the snake body, so &#349; &#8776; &#349;2D at the ends also. In (2.5), &#349;&#8869; 2D is &#349;2D rotated 90 &#8226; counterclockwise about the e z -axis. Thus &#349;&#8869; 2D points in the x-y plane, in the direction transverse to the body tangent, and &#956; n gives the coefficient of transverse friction. Note that &#349;&#8869; 2D = n, as n points in the direction towards which the body curves, which could be vertical even when &#349; lies in the x-y plane. The parameter &#948; s in (2.5) is set to 10 -3 L/T, and smoothes a discontinuity in the frictional force that would occur when ||&#8706; t X|| = 0, if &#948; s were zero. Like &#948; w , &#948; s is used to make the iterative solver more robust without noticeably altering the dynamics. In <ref type="bibr">[27]</ref>, we noted that there are certain motions for which &#948; s = 0 is required for a solution to exist, but these are somewhat uncommon. The tangential friction coefficient &#956; s takes the values &#956; f or &#956; b when the tangential body motion is in the forward or backward direction, respectively:</p><p>. Without loss of generality, we may assume &#956; b &#8805; &#956; f . Our focus here is on efficient body kinematics, defined similarly to previous locomotion studies <ref type="bibr">[28,</ref><ref type="bibr">33,</ref><ref type="bibr">34,</ref><ref type="bibr">45,</ref><ref type="bibr">46]</ref>: among the body kinematics that result in a time-averaged centre-of-mass speed V, we find the one(s) that minimize the time-averaged power consumption. The power consumption is the rate of work done by the body against gravity, contact and frictional forces, and we also include the rate of internal viscous dissipation, assuming a linear viscoelastic model that we now describe.</p><p>So far, we have only described the centreline of the body, as a space curve with torsion &#964; and curvature &#954;. To quantify the internal viscous dissipation, we model the body as a rod of small but non-zero thickness with a viscoelastic response given by the Kelvin-Voigt model <ref type="bibr">[47]</ref>. In &#167;A of the electronic supplementary material, we show that the viscous dissipation per unit length of the rod is 1  2 &#951; E I(&#8706; t &#954;) 2 with &#951; E the extensional viscosity (a function of the bulk and shear viscosities and the Poisson ratio <ref type="bibr">[47]</ref>), E the Young's modulus and I the area moment of inertia.</p><p>In this work, we limit the size of &#964; and thus confine our attention to motions which are only moderately perturbed from planar motions. If instead we were to allow arbitrary &#964; (s, t), we would have essentially arbitrary three-dimensional motions which could involve complex falling and impact dynamics. Such motions are interesting but more challenging to compute accurately, and we do not address them here. With small-to-moderate &#964; , motions are relatively smooth in time, and z(s, t) is close to time-periodic. Even with only moderately non-planar motions, it is difficult to consider the full range of possible motions, so we focus on those that are optimally efficient. If z(s, t) is time-periodic (or simply has a finite long-time average), the average rate of work done against both the contact and gravity forces ((2.4) and (2.5)) is zero, because both correspond to potential energies that oscillate in time with constant long-time averages. In the simulations, we find that the rates of work done against gravity and contact forces are negligible. The timeaveraged power consumption is then the sum of that due to dry friction with the ground and internal viscous dissipation</p><p>We non-dimensionalize all quantities (e.g. in equations (2.3) and (2.6)) using T as the characteristic time, L as the characteristic length and &#961;gL as the characteristic force. Henceforth, the variables are assumed to be dimensionless, but we keep their names the same. The dimensionless versions of equations (2.3) are Fr 1 0</p><p>where Fr = L/gT 2 has been termed the Froude number <ref type="bibr">[22]</ref>. As in many previous studies, we assume that Fr is sufficiently small that it can be approximated as zero. Thus we neglect the effect of body inertia, so we do not consider fast motions that involve significant body accelerations <ref type="bibr">[31]</ref>. This simplifies the problem in two ways: it reduces the number of parameters under investigation, and it makes the solutions behave simply under time reparametrization. Now Fr is set to zero, and we can divide the equations (2.7) through by &#956; f , so the dependence on friction coefficients is only through the ratios &#956; n /&#956; f and &#956; b /&#956; f . Having set Fr to zero, we have eliminated the acceleration terms in (2.7). The result is that body motions are invariant under reparametrization of time, if we assume that &#948; s = 0. In particular, if X(s, t) is the body motion that corresponds to &#954;(s, t) and &#964; (s, t), then X(s, ct) is the body motion that corresponds to &#954;(s, ct) and &#964; (s, ct), for any positive constant c. The invariance under time reparametrization was shown in appendix B of <ref type="bibr">[27]</ref> and also occurs in many other locomotion models <ref type="bibr">[48]</ref><ref type="bibr">[49]</ref><ref type="bibr">[50]</ref>. Here &#948; s is sufficiently small that the rescaling property holds to a very good approximation. We use the property as follows. We wish to find the kinematics that minimize the average power consumption among all those that achieve a given time-averaged centre-of-mass speed V. With the rescaling property, any kinematics that give a non-zero average speed can be rescaled in time so that the average speed is V. For a given motion X(s, t), let the norm of the centre-of-mass displacement after a period be D (positive in general).</p><p>Then for this motion, we set T = D/V, so it has average speed V. The dimensionless average power is (2.6) divided by &#961;gL 2 /T, but is still denoted P . We define P to be the dimensionless average power divided by the optimal (i.e. minimal) value for a two-dimensional motion with average speed V, which was shown in <ref type="bibr">[27]</ref> to be &#961;g&#956; min VL (dimensional form) or &#956; min D/L (dimensionless form), where &#956; min = min(&#956; f , &#956; b , &#956; n ). This is the power expended by a planar body (i.e. ||f contact || &#8801; 1) sliding uniformly in the direction of minimal friction. Our scaled average power is</p><p>where c v = &#951; E IV/&#961;gL 4 &#956; min is a dimensionless constant that measures the ratio of internal viscous dissipation to external friction. The frictional and viscous power terms on the right side of (2.8) involve a time derivative and a time derivative squared, respectively, so they have the factors D -1 and D -2 to reflect the fact that the period (and hence time t, in units of the period) is scaled by D so that V = D/T is constant across motions.</p><p>Using the zero-Fr rescaling property, we have reduced the dependence on viscosity and on V to the single parameter c v . We give an order-of-magnitude estimate of c v for a biological snake (for example, a corn snake <ref type="bibr">[22]</ref>). We take L = 30 cm, g &#8776; 10 m s -2 , &#961; = 1 g cm -3 and &#956; min = 0.1 <ref type="bibr">[23,</ref><ref type="bibr">51]</ref>. To estimate I, we assume a cylindrical body with thickness h = 3 cm, so I &#8776; 5 cm 4 . A typical locomotion speed is V = 10 cm s -1 . We are not aware of measurements of the effective viscosity of snake tissue (which would only approximate the true nonlinear viscoelastic behaviour), but an approximation comes from human muscle measurements <ref type="bibr">[52]</ref>, applied to a similar viscoelastic model of a saithe fish <ref type="bibr">[53]</ref>, with viscosity given as 10 4 -10 5 poise. The net result is c v &#8776; 10 -3 -10 -2 . Smaller viscosities of 10 1 -10 2 poise were reported for human muscle and other tissues in <ref type="bibr">[54]</ref>, resulting in c v &#8776; 10 -6 -10 -5 . Therefore, we vary c v over a wide range, 10 -6 -10 -1 , to consider a wide range of possibilities.</p><p>Next, we describe an algorithm to the determine the kinematics that minimize P among all kinematics that give locomotion at a given speed.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.">Stochastic optimization</head><p>We now describe the optimization algorithm. We write &#954; and &#964; as double Fourier-Chebyshev series</p><p>where T k (s) is the Chebyshev polynomial of first kind of degree k. We initialize a population of 50 body kinematics, each given by 2(2N f -1)N c coefficients {A jk , B jk , C jk , D jk } (excluding B 0k ) with A jk and B jk drawn from a Gaussian distribution with standard deviation W jk = 1/j if j = 0, and 1 otherwise. The 1/j weight corresponds to piecewise continuous functions of time, a minimal type of regularity that we bias the solutions towards because we find empirically that it yields better optima <ref type="bibr">[32]</ref>. C jk and D jk are drawn from uniform distributions on &#964; amp W jk <ref type="bibr">[-1, 1]</ref>, where &#964; amp is a non-negative parameter that limits the size of &#964; . We compute solutions to (2.7) from t = 0 to t final = 3, using the second-order BDF method with time step t = 0.005. At each time step, we solve the six nonlinear equations (2.7) for {X 0 (t), &#945;(t), &#946;(t), &#947; (t)} using Newton's method with the solution at the previous time step as an initial guess. The integrals in (2.7) are discretized using the trapezoidal rule with grid spacing s = 0.01. To obtain a good guess for the solution near the initial time, and to decrease the chances of jumping to other branches of solutions at later times, we use a non-zero (but small) Fr value, 10 -3 in (2.7), and solve the problem as an initial value problem starting from zero tail position/angles and velocity. The initial condition is a good guess for the solution just after the initial time. Fr is small enough to give a very good approximation to the zero-Fr case, but provides a small amount of inertia that prevents the large accelerations that would occur with jumps to other solution branches. The exponential-in-time factor on the right side of (3.2) causes the body to ramp up from a planar shape over a short time given by t d = 0.2. This improves convergence during the initial transient in which the body transitions from zero tail velocity to O(1) tail velocity.</p><p>The algorithm runs for a number of generations N gens = 300-600. In &#167;B of the electronic supplementary material, we describe the method of selecting motions that achieve low P simultaneously with negligible rotations about the z-axis-so the body's path is a straight line rather than a circle.</p><p>We list the values or ranges of values used here for the most important physical and numerical parameters in table <ref type="table">1</ref>. Next, we present the optimal solutions computed by the model and how they depend on the key parameters: N f , N c , &#956; n /&#956; f , &#956; b /&#956; f , &#964; amp and c v . To keep the presentation somewhat concise, we vary one or two parameters at a time, keeping the others fixed.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.">Computational results (a) Numbers of modes</head><p>The numbers of Fourier and Chebyshev modes, (2N f -1) and N c , are important parameters in the optimization. Increasing them increases the range of possible kinematics, allowing for bending and lifting patterns that vary more sharply in space and time. The dimension of the parameter space (for &#954; and &#964; together) is 2(2N f -1)N c . It grows rapidly with N f and N c , which generally increases the number of local optima, and the chance of the population converging to a local optimum that greatly underperforms the global optimum <ref type="bibr">[32]</ref>. We study the effect of varying N f and N c in &#167;C of the electronic supplementary material. Based on these results, our approach is to gradually increase N f and N c from 3-6 and 3-7, respectively, as the generation number n increases, because this usually provides a lower P than other simple choices. We also include results with N f and N c fixed at 4 and 5, respectively, in a few cases where this choice gives lower P values.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>(b) Planar optima</head><p>Next, we study how the algorithm performs in the case of no lifting, &#964; amp = 0, which corresponds to the class of planar motions studied in many previous works <ref type="bibr">[21,</ref><ref type="bibr">22,</ref><ref type="bibr">28,</ref><ref type="bibr">32]</ref>. The most similar is <ref type="bibr">[28]</ref>, in which the same modal expansion of curvature was used, but with zero viscous damping only. When c v is large, the friction term in P becomes insignificant compared to the viscous term, but friction still plays a key role in setting the motion of the body through the dynamical evolution equations. We investigate the planar case first to show the results of the algorithm in this more familiar case. The planar case is also a benchmark against which the benefits of lifting can be assessed.   In figure <ref type="figure">2</ref>, we plot P versus c v for five different &#956; n /&#956; f (increasing from a to e), and three different &#956; b /&#956; f (solid, dashed and dashed-dotted lines within each panel). For each curve, P is approximately independent of c v near c v = 10 -6 , where viscous dissipation is negligible, and P grows linearly with c v near 10 -1 , the large-c v regime. Other aspects of these plots are discussed in &#167;D of the electronic supplementary material. Typical optimal planar motions are shown in figure <ref type="figure">3</ref>. The minimal values of P are plotted in friction coefficient space in a and b, with zero and large viscous damping respectively (c v = 0). The magenta lines serve to divide friction coefficient space into six regions, each characterized by a typical motion, labelled C-H and Cv-Hv in a and b, respectively. Below these panels, each motion is shown as a set of 11 snapshots over a period of motion. The snapshots are uniformly rotated so that the (arbitrary) direction of time-averaged centre-of-mass displacement is up the page. The snapshots are shown twice, first in their true physical positions immediately adjacent to the letter label, as an overlapping set of shapes that vary from light grey to black as time increases. Then, extending rightward, the snapshots are spread out across the page with a fictitious horizontal displacement that makes it possible to see each snapshot individually (the true horizontal displacement over a period is zero).</p><p>In the two rightmost columns of a, &#956; n /&#956; f = 3 and 10, the optimal motions G and H are retrograde travelling-wave motions, also seen in <ref type="bibr">[28]</ref>. The snapshots of G and H follow undulatory paths up the page. The more viscous optima Gv and Hv have larger deflection amplitudes and smaller curvatures, which increase D and decrease &#8706; t &#954; in the second term on the right side of (2.8), decreasing the viscous dissipation. For &#956; n /&#956; f = 1 and smaller, there are different types of optimal motions for &#956; b /&#956; f = 1 and &#956; b /&#956; f &gt; 1. The isotropic case (E) is a type of concertina motion <ref type="bibr">[27]</ref>-the body curls up at the front and rear, forming 'anchors' that can push the rest of the body forward. The viscous version (Ev) involves larger swinging motions and somewhat less curling, as well as more self-intersecting (which is not prevented for simplicity). As before, the curvatures are smaller while the net displacement is larger in the viscous case. Motions F and Fv exemplify the region &#956; n /&#956; f = 1 and &#956; b /&#956; f &gt; 1-the body repeatedly flexes and unflexes as a curvature wave travels slightly forward. For &#956; n /&#956; f &lt; 1, the optima with zero viscosity (C and D) are mostly perpendicular to the direction of locomotion, a low drag configuration. The large viscosity optima (Cv and Dv) have much larger degrees of flexing with a swinging motion (Cv) or a forward-propagating wave of curvature (Dv), giving a larger displacement than C and D, which is preferable at large viscosity. Additional information about the planar optima is given in &#167;D of the electronic supplementary material.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>(c) Lifting amplitude</head><p>We now consider how the optimal motions change when the body is allowed to lift off of the plane, i.e. when &#964; amp is increased from zero. To limit the number of cases under discussion, we focus on just four choices of friction coefficient pairs (&#956; n /&#956; f , &#956; b /&#956; f ): (0.1, 1), (1, 1), ( <ref type="formula">10</ref> the colour plot, we see that the optimal P drops with increasing &#964; amp (except for the very slight increase just to the right of point G). It is reasonable that the optimal P decreases, because the set of possible motions at a given &#964; amp includes those at smaller &#964; amp . Enlarging the set of possible states could cause the algorithm to find a worse local optimum, but not here. To show how the optimal motions change with lifting, we use A-L to label the subsets of cases with &#964; amp = 0, 0.1, and 1 at each of the four friction pairs, and show the body snapshots below. Moving from the planar motion A to the non-planar motion B, the type of motion changes completely, from a small amplitude deflection about a straight body, to a 'walking' type of motion. The snapshots are coloured according to the contact force magnitude (green-black scale above the snapshots), where lifted regions of the body are in green, and those strongly contacting the ground are in black. The colour maps at the right show, for each set of snapshots, the distribution of contact forces in the space of arc length s and time t, over one period. Motion B involves )</p><p>small perturbations about an s-shaped curve. The contact map on the right shows that motion B involves two phases. The first phase is shown by two crossing diagonal black bands. Thus two contact regions move from the ends to the middle and back to the ends. In this phase, the snapshots show that the ends are lifted and moved in the forward direction. In the second phase, the black regions are confined to the ends. Here, the middle part of the body is lifted and moved in the forward direction. From A to B, P is reduced by about a factor of five. Motion C, with &#964; amp increased to 1, is similar to B, though the bands of lifting are sharper and P is reduced by an additional factor of almost two. In principle, alternately lifting parts of the body and moving them only when they are off the ground can reduce the power done against friction to very small values. Motions D, E and F show the sequence of optima with increasing &#964; amp when friction is isotropic. Motions G, H and I correspond to &#956; n /&#956; f = 10 and &#956; b /&#956; f = 1. The planar motion (G) is a basic lateral undulation, a retrograde travelling wave. The lifted motions (H and I) have snapshots that start with the body curled up. Then part of the body straightens and moves forward. It is mostly lifted off the ground except at one end, its more forward point, that is in contact with the ground, and slides forward along the ground. In the last few snapshots (in H and I), the forward end curls up, drawing the rest of the body forward behind it. The overall motion is similar to a concertina motion, with an anchor formed by the curled region, and the straight region extended or retracted forward, mostly lifted, except at one end. From G to H to I, P drops by 46% and then by 17%, smaller reductions from lifting than at the other friction pairs. Motions H and I combine lifting with sliding mainly in the tangential direction, in contrast to B/C and E/F, where the body is oriented transverse to the direction of motion, so the normal friction coefficient applies more strongly for the sliding that occurs. None of the optima computed with &#956; n /&#956; f = 10 and &#956; b /&#956; f = 1 and non-zero &#964; amp resemble 'sinus-lifting'-lateral undulation with lifting at the peaks of the sinusoidal wave. We study this aspect further in &#167;E of the electronic supplementary material.</p><p>Motions J, K and L apply with &#956; n /&#956; f = 1 and &#956; b /&#956; f = 5. K and L are very similar to E and F, both in the snapshots' shapes and in the values of P (those for K/L are within a few percent of those for E/F). There is little backward motion, so the difference in &#956; b /&#956; f is not very important.</p><p>In some cases (D, H and I), there is apparently self-intersection at certain times. This partly due to the two-dimensional projection of the images, and in any case is not a major concern because with slight modifications the motions avoid self-intersection.</p><p>In figure <ref type="figure">5</ref>, we consider the same quantities but instead of zero viscosity, we have large viscosity (c v = 0.1). As with zero c v , there is a large change in motions and P values as &#964; amp increases from 0 to 0.03 or 0.1, and a smaller change as &#964; amp increases further to 1. This is particularly true for the friction coefficient pairs (0.1,1) and (1,1), and somewhat less so at <ref type="bibr">(10,</ref><ref type="bibr">1)</ref> and <ref type="bibr">(1,</ref><ref type="bibr">5)</ref>. As in figure <ref type="figure">4</ref>, motions B and C mainly involve an alternating pattern of lifting and moving of the outer regions and of the central region. Here, however, the body curves more and obtains a larger displacement over one period. The main advantage probably is to increase D in the c v -term in (2.8), thereby decreasing P. Motions E and F are fairly similar, though interestingly E resembles C more than B, and F resembles B more than C, despite the different &#964; amp values. Motion H qualitatively resembles G even though G has no lifting. H has an alternating 2-2 contact pattern as it flexes symmetrically to the left and to the right. The main contacts are at the head and midbody when the tail swings forward, and at the tail and midbody when the head swings forward. P is reduced by about 30% from G to H. Motion I is similar to H but less symmetrical, and gives a further 14% reduction in P. With lifting, the friction coefficient pair (10,1) has the highest power with zero c v (H-I at the top of figure <ref type="figure">4</ref>) but the lowest power with large c v (figure <ref type="figure">5</ref>). Motions K and L are very different from each other, but have about the same P, about a factor of three less than that of the non-lifting optimum J. K involves large bending to the left and right, with some similarities to H and I. L has bending to one side only, with two almost-fixed contact regions near the head and the midbody. It resembles J in that it is a repeated bending and unbending motion, but to one side only. A combination of backward and normal friction acts at each contact region at different times, pushing the body forward.</p><p>For the first three of the friction coefficient pairs, the smallest P is obtained at &#964; amp = 0.3, and for the fourth, the smallest value occurs at &#964; amp = 1, but it is within 7% of the values at &#964; amp = 0.1 and 0.3. Because friction is negligible in P at large c v , a large degree of lifting is less important in terms of avoiding frictional power dissipation. But a moderate degree of lifting is still much better than small lifting, because it changes the correspondence between body bending and locomotion. It allows for a smaller viscoelastic (bending) dissipation for a given average speed of locomotion.</p><p>To summarize, at both zero viscous damping and large viscous damping there are large changes in the optimal motions and large improvements in P when &#964; amp increases from 0 to 1. Most of the changes occur in the increase from 0 to 0.1, with smaller changes over the increase from 0.1 to 1. The optimal motions in the latter range are characteristic of the regime of moderate lifting, in which the body is mostly extended in the x-y plane with a z-extent that is much smaller, but large enough to lift completely off the ground at most points. In some cases, a lower P is obtained at &#964; amp = 0.3 than at 1. In most cases, the optimization routine is faster and more robust at &#964; amp = 0.3 than at 1. At &#964; amp = 1, the lifting may be large enough that the body tips over due to gravity, and a tumbling motion occurs which is not resolved by the time-stepping algorithm. In order to avoid such cases while examining the effects of the friction coefficients in more detail, we therefore fix &#964; amp at 0.3, which gives a good representation of motions with a moderate amount of lifting. We are not aware of biological or robotic motions that closely resemble the optima presented here, but we discuss possible connections further in &#167;5.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>(d) Effects of frictional anisotropies and damping</head><p>We now consider the optimal motions and P values across the 5-by-3 grid of friction coefficient ratios. We use 10 random initializations with each of the (3-6,3-7) and (3-6 w ,3-7 w ) mode choices (see &#167;C of the supplementary information). We fix &#964; amp at 0.3, and vary c v from 0 to 0.1 (large).</p><p>In figure <ref type="figure">6</ref>, we plot the optima at the two extreme c v only, 0 in a and 0.1 in b. We have also computed results at intermediate values, and we find that around c v = 10 -3 they smoothly transition between the behaviours at the extremes. With zero c v (a), there are essentially two types of optima, one for &#956; n /&#956; f &#8804; 3 and another at the largest &#956; n /&#956; f = 10. The two regimes are divided by the magenta line in a. For &#956; n /&#956; f &#8804; 3 and all &#956; b /&#956; f , the optimal solution is an s-shaped body with alternate lifting of the body ends and the body middle, similar to those shown in figure <ref type="figure">4b,</ref><ref type="figure">c</ref> optimal. At &#956; n /&#956; f = 10, a symmetric bending motion with alternating pairs of contacts (Ev) is optimal, as in figure <ref type="figure">5h,</ref><ref type="figure">i</ref>. At small &#956; n /&#956; f and &#956; b /&#956; f &gt; 1, different optima are seen, shown by Cv and Fv. The first four snapshots of Cv show the middle part of the body lifted and placed forward. Snapshots 4-7 show curling and uncurling of the right side of the body, which pushes the left side of the body forward. Snapshots 8-11 show curling and uncurling of the left side of the body, which pushes the right side of the body forward. Motion Fv is a similar pattern of curling and uncurling, but by the left side of the body only. Curling pushes the left side forward, and uncurling pushes the right side forward. Meanwhile, there are three almost fixed contact regions at the two ends and the middle of the body, which resembles the contact pattern at certain times in Cv, but not others.</p><p>At the bottom of the figure is an example of a different type of optimal motion, labelled Gv. The friction coefficients are the same as for E and Ev (&#956; n /&#956; f = 10, &#956; b /&#956; f = 5), but c v = 10 -4 , intermediate between the values in a and b. The contacts occur exclusively at the two ends throughout the motion. Because these are oriented in the tangential direction, frictional dissipation occurs mainly with the minimal drag coefficient &#956; f . There is also backward movement at the contacts, but it is much smaller than the forward movement because &#956; b /&#956; f = 5.</p><p>To summarize, alternating lifting motions predominate across friction coefficient space both with small viscosity and large viscosity. However, other motions become optimal when friction is very anisotropic.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>(e) Optima with travelling-wave contacts</head><p>One of the most interesting types of lifting motions in biological snakes is the sidewinding motion, which consists of a travelling wave of curvature synchronized with a travelling wave of lifting, with a phase difference between the two <ref type="bibr">[12,</ref><ref type="bibr">14,</ref><ref type="bibr">26,</ref><ref type="bibr">37]</ref>. Interestingly, for some random initializations our optimization algorithm converges to these types of motions, across friction coefficient space. This only occurs for low viscous damping, c v = 0 or 10 -6 usually. So far in this paper, we have presented only the best local optimum we have found at a given parameter set, and these are never the sidewinding-type motions. We now show, in figure <ref type="figure">7</ref>, examples of the sidewinding-type local optima. Six different examples are shown, labelled A, C, E, G, I and K in blue at left. Each case has a different pair of friction coefficient ratios, in parentheses below and to the right of the blue letter label. Below each of the six cases is the best local optimum found at the same friction coefficient ratios, labelled B, D, F, H, J and L at left. These are alternating lifting motions (B, D, F, H) or curling and sliding motions (J and L) that are similar to those already discussed. Next to each letter label is the value of P for that motion, and the values for the sidewinding motions vary from slightly higher (K versus L) to about a factor of two higher (A versus B, C versus D etc.) than those of the best local optima.</p><p>To the right of each set of snapshots are the contact force maps and curvature maps in s-t space. For the sidewinding motions (A, C, E, G, I and K), both maps have diagonal bands with about the same slopes, showing unidirectional travelling waves of contact force and curvature that are approximately synchronized. The optimal motions (B, D, F, H, J and L) do not show unidirectional travelling waves except for motion J, and there the diagonal bands in the contact and curvature maps have different slopes, corresponding to waves moving at different speeds. Another distinctive feature of the sidewinding motions can be seen by examining the sets of snapshots in physical space, just to the right of the P values. The black regions (where the body contacts the ground) of all the snapshots together trace out approximately continuous line segments on the ground. Between the black regions are almost-parallel arrays of green regions, lifted parts of the snake body that are being moved from one black region to the next. When the motion is repeated over multiple periods, the sets of black line segments form a series of parallel tracks on the ground, as for biological sidewinding snakes <ref type="bibr">[12,</ref><ref type="bibr">14]</ref>. In A, C, E, G, I and K, the tracks are almost orthogonal to the direction of locomotion (up the page), whereas biological tracks are typically at an oblique angle <ref type="bibr">[12,</ref><ref type="bibr">14,</ref><ref type="bibr">15]</ref>. In figure <ref type="figure">7</ref>, the sidewinding motions separate into two groups: &#956; n /&#956; f &#8804; 1 (ACEG), where the lifted (green) body segments are at an oblique angle to the tracks and to the direction of locomotion, and &#956; n /&#956; f = 10, where the lifted segments are perpendicular to the tracks and parallel to the direction of locomotion. Here, the tracks are shorter and the body has a larger displacement per period. It is not obvious why sidewinding optima occur commonly in the computations yet are never the global optima. Perhaps sidewinding motions require relatively more modes to achieve high efficiency than the global optima.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.">Simple theoretical motions</head><p>Our computed optima include many cases of alternating lifting (walking) or sidewinding, which involves contact regions rolling on and off the ground. We now demonstrate theoretical walking and rolling motions that locomote with essentially zero work done against friction. After describing the motions, we will discuss their differences with the computed optima and biological motions.</p><p>Figure <ref type="figure">8a</ref> shows a sequence of four snapshots of a walking type of motion, similar in principle to the optima computed for &#956; n /&#956; f 1. In each snapshot of a, the body is bent into a shape with the x-z plane as a plane of symmetry, in order to extend its base of support along the y direction, and make it stable to small perturbations that involve a rotation about the x-axis. The body has regions in contact with the ground-the 'feet'-and an elevated region that is used to shift the centre of mass from one foot to the other. Two dashed red lines are used as fixed guides to show how far the body locomotes. In snapshot 1, the left foot, highlighted in yellow, is in contact with the ground, and the body's centre of mass, a black dot, lies within its convex hull, so the body is stable. From snapshot 1 to 2, the right foot is lifted slightly, then brought closer to the left foot, and meanwhile the elevated portion shifts rightward to keep the centre of mass fixed. Small green dots in snapshots 2-4 show the regions of the body that have moved from the previous snapshot.</p><p>From snapshot 2 to 3, the body puts both feet on the ground, then shifts the elevated region so the centre of mass lies over the right foot, then lifts the left foot. From snapshot 3 to 4, the left foot is moved leftward, and simultaneously the elevated region shifts rightward to keep the centre of mass fixed. Now the body can return from snapshot 4 to snapshot 1 (but translated leftward), shifting the elevated region and the centre of mass leftward, and repeat the process. As with the computed optima, the body is a single continuous segment here. The computed optima, which involved lifting the middle portion and ends of an s-shaped body, are a smoother type of walking motion, which have smaller viscous dissipation than in a (or even a slightly regularized version that removes the sharp corners). With a finite number of modes, the computed optima probably cannot have a frictional dissipation that is precisely zero, as it is for the motion in a.</p><p>In (b,c), we examine two rolling types of motions, described as kinematic and dynamic rolling in <ref type="bibr">[55]</ref>. A vast number of shape-changing rolling robots have been created using these types of motions, e.g. <ref type="bibr">[56]</ref><ref type="bibr">[57]</ref><ref type="bibr">[58]</ref><ref type="bibr">[59]</ref>. Panel b shows three successive snapshots of a body performing a tanktreading motion. Portions of the body at the left are rolled off the ground into the semicircle at the left end while portions at the right are rolled out of the semicircle at the right end, onto the ground. The dashed lines with arrows show the directions of rolling, and the hash marks show how fixed material points move between the three snapshots. In the tank-treading motion, the region in contact with the ground is stabilized by static friction, which is approximated by the sliding friction model with the small &#948; s term we have used (equation (2.5)) as described in <ref type="bibr">[27]</ref>. The tanktreading motion is called kinematic rolling, because the body is always at a stable equilibrium and inertia plays no role. In c, dynamic rolling, the body starts in a stable elliptical shape (solid black line), and then changes its shape to the dashed line. If friction is sufficiently large, the ground contact remains approximately fixed. The dashed line shape is gravitationally unstable, so the body rolls rightward to reduce the height of its centre of mass, resulting in the blue shape. With inertia, the body will perform a rocking oscillation about the blue shape, damped by internal or frictional dissipation in real situations. With further shape changes, the body may continue rightward with steady or variable velocity <ref type="bibr">[57]</ref>. Like walking, these rolling motions do essentially no work against friction in the ideal case. They can also be made into stable three-dimensional shapes by adding a mirror-symmetric portion, as for the motion in a. The rolling motions can be made to have relatively small changes in curvature, decreasing viscous dissipation.</p><p>Many of our computed optima resemble the walking or rolling strategies. The sidewinding motions involve a continuous rolling on and off the ground at certain contact regions, although the body does not assume a circular shape. A small number of other organisms have been found to roll passively (without shape change), including tumbleweed, a type of salamander, a spider, and a woodlouse <ref type="bibr">[56]</ref>. Organisms that use active rolling to locomote include a type of shrimp and a caterpillar <ref type="bibr">[56]</ref>. There may be various reasons why sidewinding is preferable to a more vertical rolling configuration for snakes. Sidewinding may allow for a better view of the snake's surroundings including prey and predators. In the sidewinding motion, the snake is closer to the ground, which is better for stealth when stalking prey or avoiding predators <ref type="bibr">[15]</ref>. Body configurations that are closer to the ground are often more gravitationally stable. Another advantage is that less work is done is lifting portions of the body high off the ground. Although gravitational potential energy can be recovered in a periodic motion, there may be more losses during large conversions of potential to kinetic energy <ref type="bibr">[60]</ref>.</p><p>Another possible advantage of sidewinding over the rolling motions in figure <ref type="figure">8</ref> is that it preserves the snake's upright orientation. Snakes have an upright orientation in most studies of locomotion over approximately flat surfaces, and their belly scales seem to be adapted for contact with surfaces <ref type="bibr">[15]</ref>. One notable and unusual case of an upside-down posture is a specialized antipredator behaviour of the hognose snake <ref type="bibr">[61]</ref>. Upright postures are also preferred by many other organisms such as fish <ref type="bibr">[62,</ref><ref type="bibr">63]</ref>. It is interesting that sidewinding optima occur in our computations even though our model omits biological considerations beyond mechanical efficiency, as well as details of snake physiology that may favour certain body postures such as sidewinding. Sidewinding may be the most efficient rolling type of motion that fits the constraint of small-to-moderate lifting. It is also interesting that sidewinding optima occur only with a very small viscous damping constant. However, the more-efficient alternating lifting or 'walking' optima are also optimal in many cases with large viscous dissipation, which include high-speed motions.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.">Conclusion</head><p>We have developed a model and computational method to find three-dimensional motions that optimize the mechanical efficiency of snake-like locomotion with small-to-moderate lifting off of the ground. The key physical parameters are the two ratios of friction coefficients (&#956; n /&#956; f , &#956; b /&#956; f ), the lifting amplitude &#964; amp , and the viscous damping parameter c v . Our stochastic populationbased optimization method finds motions that minimize the average input power P while locomoting with very small net rotation per period. The same types of optima are found when we vary the numbers of modes in the Chebyshev-Fourier basis that describe the body shapes, so the results are robust with respect to changing the numbers of modes. Although we have mainly focused on the best computed optima, in most cases, the second-best computed optimum is very similar to the best, so the algorithm finds the same optima from different initializations. Presumably the best computed optimum has a sizeable basin of attraction and is not very difficult to locate.</p><p>For planar (and non-planar) locomotion, the transition from negligible to dominant viscous damping occurs near c v = 10 -3 . The optima in the planar case with zero viscous damping are very similar to those computed in <ref type="bibr">[28]</ref> with a Newton-based optimization method. With nonzero viscous damping, the body shapes are often similar but smoother, and achieve larger displacements per period.</p><p>When the allowed lifting amplitude &#964; amp is increased from zero, the optimal motions change dramatically. For &#956; n /&#956; f &#8804; 3, a motion with an s-shaped body and alternating lifting of the midbody and the ends is typical, though there are other types of motions at certain friction coefficients. For &#956; n /&#956; f = 10, the optimal motions are a combination of lifting with curling and sliding at zero c v . At large c v , the motions are a combination of lifting with large amplitude</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_0"><p>Downloaded from https://royalsocietypublishing.org/ on 12 October 2022</p></note>
		</body>
		</text>
</TEI>
