quasi one - dimensional objects are characterized by having one dimension , the length , much larger than the others , say the radius , so that .relative to three - dimensional objects , this measure of slenderness allows for enormous mathematical simplification in accurately describing the physical dynamics of strings , filaments and rods .it is thus perhaps not surprising that the physics of strings have been the subject of intense study for centuries , and indeed their investigation substantially pre - dates the birth of three - dimensional elasticity .  following the pioneering work of galileo on the bending of cantilevers , one - dimensional analytical models of beams date back to 1761 when jakob bernoulli first introduced the use of differential equations to capture the relation between geometry and bending resistance in a _planar elastica _, that is an elastic curve deforming in a two - dimensional space .this attempt was then progressively refined by huygens , leibniz and johann bernoulli , until euler presented a full solution of the planar elastica , obtained by minimizing the strain energy and by recognizing the relation between flexural stiffness and material and geometric properties .euler also showed the existence of bifurcating solutions in a rod subject to compression , identifying its first buckling mode , while lagrange formalized the corresponding multi - modal solution .non - planar deformations of the elastica were first tackled by kirchhoff and clebsch who envisioned a rod as an assembly of short undeformable straight segments with dynamics determined by contact forces and moments , leading to three - dimensional configurations .later , love approached the problem from a lagrangian perspective characterizing a filament by contiguous cross sections that can rotate relative to each other , but remain undeformed and perpendicular to the centerline of the rod at all times ; in modern parlance this assumption is associated with dynamics on the rotation group so(3 ) at every cross - section .the corresponding equations of motion capture the ability of the filament to bend and twist , but not shear or stretch .eventually the cosserat brothers relaxed the assumption of inextensibility and cross - section orthogonality to the centerline , deriving a general mathematical framework that accommodates all six possible degrees of freedom associated with bending , shearing , twisting and stretching , effectively formulating dynamics on the full euclidean group se(3 ) .the availability of these strong mathematical foundations prompted a number of discrete computational models that allow for the exploration of a range of physical phenomena .these include , for example , the study of polymers and dna , elastic and viscous threads , botanical applications , elastic ribbons , woven cloth and tangled hair . because the scaled ratio of the stretching and shearing stiffness to the bending stiffness for slender filaments is , the assumption of inextensibility and unshearability is usually appropriate , justifying the widespread use of the kirchhoff model in the aforementioned applications .  however , new technologies such as soft robotics and artificial muscles are generating applications for highly deformable elastomeric filamentous structures for which the assumption of inextensibility and unshearability is no longer valid .motivated by these advancements , we move away from the kirchhoff model in favor of the complete cosserat theory .we present a numerical scheme that tracks both the rod centerline and local frame allowing for bending , twist , shear and stretch consistent with the full euclidean group se(3 ) , while retaining the hamiltonian structure of the system and fast discrete operators .this allows us to substantially increase the spectrum of problems amenable to be treated via this class of rod models .moving beyond the passive mechanics of single filaments , we also account for the interaction between filaments and complex environments with a number of additional biological and physical features , including muscular activity , self - contact and contact with solid boundaries , isotropic and anisotropic surface friction and viscous interaction with a fluid .finally , we demonstrate how our method can be embedded in an inverse optimization design cycle to characterize terrestrial and aquatic limbless locomotion .the paper is structured as follows . in section[ sec : govequations ] we review and introduce the mathematical foundations of the model . in section[ sec : discretization ] we present the corresponding discrete scheme . in section [ sec : additionalphysics ] we detail the physical and biological enhancements to the original model . in section [ sec : validation ]we validate our framework against a battery of benchmark problems . in section[ sec : applications ] we showcase the potential of our solver via the study of solenoids and plectonemes as well as limbless biolocomotion .all symbols employed throughout this work , additional validation test cases and mathematical derivations are summarized in the appendix .we consider filaments as slender cylindrical structures deforming in three - dimensions with a characteristic length which is assumed to be much larger than the radius ( ) at any cross section .then the filament can be geometrically reduced to a one - dimensional representation , and its dynamical behavior may be approximated by averaging all balance laws at every cross section .this approach is formalized in the cosserat rod theory .and couples line densities.,scaledwidth=85.0% ]  as illustrated in fig .[ fig : cosserat ] , a filament in the cosserat rod theory can be described by a centerline \in \mathbb{r},t\in \mathbb{r}^+)\rightarrow\mathbb{r}^3 ] equivalent to the orthonormal triad of unit vectors . here , is the centerline arc - length coordinate in its current configuration and is time .we introduce the notation to denote any generic vector represented in the eulerian frame and as the body - convected ( lagrangian ) frame of reference where eq .( [ eq : eulerianrep ] ) expresses in the laboratory canonical basis , while eq .( [ eq : lagrangianrep ] ) expresses it in the director basis .then , the matrix transforms any vector from the laboratory to the body - convected representation via and conversely , , since .the time and space derivatives of the centerline are associated with the velocity and tangent field  with , since is the current arc - length .similarly , time and space derivatives of the material frame , due to the orthonormality of the directors , are associated by definition with the angular velocity and generalized curvature vectors , so that  where the equivalences and hold .these kinematic equations combined with the linear and angular momentum balance laws at a cross section , yield the governing equations for the cosserat rod where is the constant material density , is the cross sectional area in its current state ( so that is the linear momentum line density ) , is the angular momentum line density , and are the internal force and torque resultants , and and are external body force and torque line densities that can be used to accommodate a range of biophysical phenomena , from self - contact and muscular activation , to surface friction and hydrodynamics .the internal force and torque resultants depend on the geometric and material properties of the filament .this dependence is embedded via the material or constitutive laws , which must be frame invariant , rendering their definition in a lagrangian setting most natural .moreover , we note that the angular momentum line density can be readily expressed in the material frame as , where the tensor is the second area moment of inertia which , assuming circular cross sections , takes the form   therefore , we rewrite eqs .( [ eq : vel]-[eq : angmoment ] ) in a more convenient mixed eulerian - lagrangian form , suitable to be tackled numerically . from the definition of eqs .( [ eq : transport1 ] , [ eq : transport2 ] ) , we can derive ( see appendix ) the identity so that the system of eqs .( [ eq : vel]-[eq : angmoment ] ) may be expressed ( see appendix ) as   this system of equations is now closer to the form we wish to numerically integrate , although the internal force and couple resultants are yet to be defined . because the arc - length coordinate corresponds to the current filament configuration , it may not coincide with the arc - length coordinate associated with the rest reference configuration of the filament ( fig .[ fig : cosserat ] - throughout the rest of this work the hat will denote quantities with respect to the reference rest configuration ) . as a consequence ,all geometric quantities ( a , , , etc . )must be rescaled appropriately , as addressed in the following sections .   in order to close the system of eqs .( [ eq : vel2]-[eq : angmoment2 ] ) and determine the kinematics of the rod , it is necessary to specify the form of the internal forces and torques generated in response to bending , twist , shear and axial strains . since we wish to account for all six deformation modes , six degrees of freedom are associated with each cross section along the rod and therefore six constitutive laws must be specified .the strains are the relative local deformations of the rod with respect to its rest reference configuration . bending and twist strainsare associated with the derivative in space of the material frame directors and are characterized by the generalized curvature ( eq . [ eq : transport2 ] ) .specifically , the components of the curvature projected along the directors ( ) coincides with bending ( ) and twist ( ) strains in the material frame ( table [ tab : strains ] ) .we wish to reiterate here that the constitutive laws are most simply expressed in a lagrangian form , due to translational and rotational invariance , hence the use of and not .shear and axial strains are associated with the derivative in space of the centerline coordinate and are characterized by the vector ( fig .[ fig : cosserat ] ) which , in the material frame of reference , takes the form and is a consequence of the non - orthogonality of the cross sections with respect to the centerline . here, the scalar field expresses the local stretching or compression ratio ( fig .[ fig : cosserat ] ) relative to the rest reference configuration ( ) and is the unit tangent vector , independent from the choice of arc - length or .if no axial extension or compression occurs , the arc - length coincides with at all times and therefore the dilatation factor becomes the constant .morevoer , if then and so that we recover the algebraic kirchhoff constraint for unshearable and inextensible rods .together , these provide the intuition for relating to shear ( ) and axial ( ) strains ( table [ tab : strains ] ) .l | k | e | l * deformation modes & * strains & * rigidities & * loads + bending about &  &  &  + bending about &  &  &  + twist about &  &  &  + shear along &  &  &  + shear along &  &  &  + stretch along &  &  &  + * * * *   assuming linear _ stress - strain _ relations , and integrating them over the cross sectional area , yields the rigidities associated with bending , stretching , shear and twist specified in table [ tab : strains ] .the rigidities can be expressed as the product of a material component , represented by the young s ( ) and shear ( ) moduli , and a geometric component represented by , and the constant for circular cross sections .then the resultant _ load - strain _ relations of table [ tab : strains ] can be generically expressed in vectorial notation as where ( , , ) is the bending / twist stiffness matrix with the flexural rigidity about , the flexural rigidity about , the twist rigidity about , and ( , , ) is the shear / stretch stiffness matrix with the shearing rigidity along , the shearing rigidity along , and the axial rigidity along . the vectors and are the intrinsic curvatures , twist , shears and stretch , and must be accounted for in the case of stress - free complex shapes . for simplicity , from now onwe assume that the filament is naturally straight in its stress - free state , so that .we note that the rigidity matrices and are assumed to be diagonal throughout this study , although off diagonal entries can be easily accommodated to model anisotropic materials such as composite elements . in general , this mathematical formulation can be readily extended to tackle a richer set of physical problems including viscous threads , magnetic filaments , etc ., by simply modifying the entries of and and introducing time dependent constitutive laws wherein and .whenever the filament undergoes axial stretching or compression the corresponding infinitesimal elements deform and all related geometric quantities are affected . by assuming that the material is incompressible and that the cross sections retain their circular shapes at all times , we can conveniently express governing equations and energies with respect to the rest reference configuration of the filament ( denoted by the hat ) in terms of the local dilatation .then , the following relations hold   multiplying both sides of eqs .( [ eq : linmoment2],[eq : angmoment2 ] ) by and substituting the identities of eqs .( [ eq : scaledquantities ] ) into eqs .( [ eq : vel2]-[eq : angmoment2 ] ) , yields the final system where is the infinitesimal mass element , and is the infinitesimal mass second moment of inertia .we note that the left hand side and the unsteady dilatation term of eq .( [ eq : angmomentfinal ] ) arise from the expansion of the original rescaled angular momentum via chain rule .we also note that the external force and couple are defined as and ( with and the force and torque line densities , respectively ) so as to account for the dependency on .the external loads and allows us to accommodate additional physical effects , such as dissipation , muscular activity , surface friction , self - contact and hydrodynamics .  combined with some initial and boundary conditions , eqs .( [ eq : velfinal]-[eq : angmomentfinal ] ) express the dynamics and kinematics of the cosserat rod with respect to its initial rest configuration , in a form suitable to be readily discretized as described in section [ sec : discretization ] .   in the simplest setting ,linear constitutive relations are consistent with energies being quadratic relative to a given natural or rest reference state . by accounting for the local dilatation through eqs .( [ eq : scaledquantities ] ) , the shear and stretch energy and the bending and twist energy may therefore be written as while translational and rotational energies may be expressed as   we note that the governing eqs .( [ eq : vel2]-[eq : angmoment2 ] ) that follow from the kinematic eqs .( [ eq : velocities][eq : transport1 ] ) and force and torque balances , can be equivalently obtained from the energy functionals via unconstrained variational derivatives with respect to the strains .to derive the numerical method for the time evolution of a filament in analogy with the continuum model of section [ sec : govequations ] , we first recall a few useful definitions for effectively implementing rotations . we then present the spatial discrete model of the rod , and the time discretization approach employed to evolve the governing equations .it is important to notice that the rotation axis is expressed in the material frame of reference associated with the matrix ( or ) . with these tools in hand, we now proceed to outline our numerical procedure .inspired by previous studies of unshearable and inextensible rods , we capture the deformation of a filament in three - dimensional space via the time evolution of a discrete set of vertices  ] , as illustrated in fig .[ fig : dicretizedmodel ] .each vertex is associated with the following discrete quantities where is the velocity , is a pointwise concentrated mass , and is the external force given in eq .( [ eq : linmomentfinal ] ) .each material frame is associated with an edge connecting two consecutive vertices , and with the related discrete quantities where , , are the edge current length , reference length and dilatation factor , is the discrete tangent vector , is the discrete shear / axial strain vector , is the discrete angular velocity , , , , are the edge reference cross - section area , mass second moment of inertia , bending / twist matrix and shear / stretch matrix , and finally is the external couple given in eq .( [ eq : angmoment ] ) .  while in the continuum setting of section [ sec : govequations ] all quantities are defined pointwise , in a discrete setting some of them , and in particular , are naturally expressed in an integrated form over the domain along the filament . any integrated quantity divided by the corresponding integration domain length is equivalent to its pointwise average . in the context of our discretizationthe domain becomes the voronoi region of length which is defined only for the _ interior _ vertices .each interior vertex is then also associated with the following discrete quantities where is the voronoi domain length at rest and is voronoi region dilatation factor .we recall that the generalized curvature expresses a rotation per unit length about its axis , so that the quantity naturally expresses the rotation that transforms a material frame to its neighbour over the segment size along the rod .therefore , the relation holds , so that .finally , we introduce the bending / twist stiffness matrix consistent with the voronoi representation .  then , we may discretize the governing eqs .( [ eq : velfinal]-[eq : angmomentfinal ] ) so that they read \label{eq : velfinaldiscr}\\ \frac{\partial \mathbf{d}_{i , j}}{\partial t } & = & ( \mathbf{q}_i^t\boldsymbol{\omega}^i_{\mathcal{l } } ) \times \mathbf{d}_{i , j},\hspace{6.25cm}i=[1,n ] , ~j=1,2,3\label{eq : framefinaldiscr}\\ m_i \cdot \frac{\partial \mathbf{v}_i}{\partial t } & = & \delta^h \left(\frac{\mathbf{q}_i^t\hat{\mathbf{s}}_i\boldsymbol{\sigma}^i_{\mathcal{l}}}{e_i}\right ) + \mathbf{f}_i,\hspace{6.5cm}i=[1,n+1]\label{eq : linmomentfinaldiscr}\\ \frac{\hat{\mathbf{j}}_i}{e_i }\cdot \frac{\partial \boldsymbol{\omega}^i_{\mathcal{l}}}{\partial t } & = & \delta^h\left(\frac{\hat{\boldsymbol{\mathcal{b}}}_i\hat{\boldsymbol{\kappa}}_{\mathcal{l}}^{i}}{\mathcal{e}_i^3}\right ) + \mathcal{a}^h\left(\frac{\hat{\boldsymbol{\kappa}}_{\mathcal{l}}^i\times\hat{\boldsymbol{\mathcal{b}}}_i\hat{\boldsymbol{\kappa}}_{\mathcal{l}}^i}{\mathcal{e}_i^3}\hat{\mathcal{d}}_i\right ) + \left(\mathbf{q}_i\mathbf{t}_i\times\hat{\mathbf{s}}_i\boldsymbol{\sigma}^i_{\mathcal{l}}\right)\hat{\ell}_i\nonumber\\ & & + \left(\hat{\mathbf{j}}_i\cdot\frac{\boldsymbol{\omega}^i_{\mathcal{l}}}{e_i}\right)\times \boldsymbol{\omega}^i_{\mathcal{l } } + \frac{\hat{\mathbf{j}}_i\boldsymbol{\omega}^i_{\mathcal{l}}}{e_i^2}\cdot\frac{\partial e_i}{\partial t } + \mathbf{c}^i_{\mathcal{l}},\hspace{4cm}i=[1,n]\label{eq : angmomentfinaldiscr}\end{aligned}\ ] ] where the discrete operators and take the form  we note that and operates on a set of vectors and return vectors , consistent with eqs .( [ eq : velfinaldiscr]-[eq : angmomentfinaldiscr ] ) .  similarly , we may write the discrete potential and kinetic energies as    in order to advance the discrete hamiltonian system of eqs .( [ eq : velfinaldiscr]-[eq : angmomentfinaldiscr ] ) , we employ the energy conserving , second order position verlet time integration scheme .this allows us to write a full iteration from time to as \label{eq : xupdate1}\\ \mathbf{q}_i\left(t+\frac{\deltat}{2}\right)&= & \exp{\left[\frac{\delta t}{2}\boldsymbol{\omega}^i_{\mathcal{l}}(t)\right]}\cdot \mathbf{q}_i(t),\hspace{6cm}i=[1,n]\label{eq : qupdate1}\\ \mathbf{v}_i(t+\delta t)&= & \mathbf{v}_i(t)+\delta t\cdot\frac{d\mathbf{v}_i}{d t}\left(t+\frac{\delta t}{2}\right ) , \hspace{4.75cm}i=[1,n+1]\\ \boldsymbol{\omega}^i_{\mathcal{l}}(t+\delta t)&= & \boldsymbol{\omega}^i_{\mathcal{l}}(t)+\delta t \cdot \frac{d \boldsymbol{\omega}^i_{\mathcal{l}}}{d t}\left(t+\frac{\delta t}{2}\right ) , \hspace{5cm}i=[1,n]\label{eq : accupdate}\\ \mathbf{r}_i(t+\delta t)&= & \mathbf{r}_i\left(t+\frac{\delta t}{2}\right)+\frac{\delta t}{2}\cdot\mathbf{v}_i\left(t+\frac{\delta t}{2}\right)\label{eq : xupdate2}\hspace{3.75cm}i=[1,n+1]\label{eq : angaccupdate}\\ \mathbf{q}_i(t+\delta t)&= & \exp{\left[\frac{\delta t}{2}\boldsymbol{\omega}^i_{\mathcal{l}}\left(t+\frac{\delta t}{2}\right)\right]}\cdot \mathbf{q}_i\left(t+\frac{\delta t}{2}\right).\hspace{3.5cm}i=[1,n]\label{eq : qupdate2}\end{aligned}\ ] ] as can be noticed the time integrator is structured in three blocks . a first half step position update ( eqs .[ eq : xupdate1 ] , [ eq : qupdate1 ] ) , followed by the evaluation of local accelerations ( eqs .[ eq : accupdate ] , [ eq : angaccupdate ] ) , and finally the second half step position update ( eqs . [ eq : xupdate2 ] , [ eq : qupdate2 ] ) .therefore , the second order position verlet scheme entails only one right hand side evaluation of eqs .( [ eq : linmomentfinaldiscr ] , [ eq : angmomentfinaldiscr ] ) , the most computationally expensive operation . we also emphasize that for the numerical integration of eqs .( [ eq : qupdate1 ] , [ eq : qupdate2 ] ) the rodrigues formula is employed , implying the direct use of instead of . all together, this algorithm thus strikes a balance between computing costs and numerical accuracy .to expand the range of applications for our formalism , we now show how to include additional physical effects , from viscous hydrodynamic forces in the slender - body limit and surface solid friction to self - contact and active muscular activity . as a general strategy ,all new physical interactions are accounted for by simply lumping their contributions into the external forces and couples and on the right hand side of the linear and angular momentum balances of eqs .( [ eq : linmomentfinal ] , [ eq : angmomentfinal ] ) .   the governing eqs .( [ eq : velfinal]-[eq : rotenergyfinal ] ) correspond to a hamiltonian system , and therefore they are energy conserving . however , real materials are subject to internal friction and viscoelastic losses , which can be modeled by modifying the constitutive relations so that the internal toques and forces of eqs .( [ eq : bendinglaws ] , [ eq : shearlaws ] ) become functions of both strain and rate of strain , i.e. and . keeping track of the strain ratesincreases computational costs and the memory footprint of the solver .however , for the purpose of purely dissipating energy , a simple alternative option is to employ rayleigh potentials . in this caseviscous forces and torques per unit length are directly computed as linear functions of local and angular velocities through the constant translational and rotational internal friction coefficients , so that this approach does not model the physical nature of viscoelastic phenomena , although it does dissipate internal energy , effectively mimicking overall internal friction effects . in the context of our numerical investigations , we did not observe any appreciable difference between the two outlined methods , so that , for the sake of simplicity and computational efficiency , we opted for the second one . throughout the remainder of the textwe will then employ eqs .( [ eq : dissipationvel ] , [ eq : dissipationangvel ] ) with a single dissipation constant , therefore assuming .   to study limbless biolocomotion on solid substrates and in fluids ,we allow our soft filaments to be active , by generating internal forces and torques corresponding to coordinated muscular activity driven , for example , by a central pattern generator .following the approach detailed in , we express the muscular activity magnitude as a traveling wave propagating head to tail along the filament where is the phase , is time , and are , respectively , the activation period and wavelength .the amplitude of the traveling wave is represented by the cubic b - spline characterized by control points with , as illustrated in fig .[ fig : muscularactivity ] .the first and last control points are fixed so that and , therefore assuming the ends of the deforming body to be free .one of the main advantages of the proposed parametrization is that it encompasses a large variety of patterns with a relatively small number of parameters .a given activation mode can be achieved by multiplying the scalar amplitude with the appropriate director .for example , if we wish to study earthworm - like locomotion we may employ a wave of longitudinal dilatation and compression forces , so that where the difference is taken to account for the net force acting on each element of the filament .conversely , if we wish to investigate a slithering snake characterized by a planar kinematic wave , we may consider a torque activation of the form ,\ ] ] assuming and to be coplanar to the ground .  in the most general case ,all deformation modes can be excited by enabling force and torque muscular activity along all directors , and , providing great flexibility in terms of possible gaits .     to prevent the filament from passing through itself , we enforce a `` soft '' self - contact model by introducing additional forces acting between the discrete elements in contact . to determine whether any two cylindrical elements are in contact , we calculate the minimum distance between edges by parameterizing their centerlines so that }||c_i(h_1 ) - c_j(h_2)||.\ ] ]if is smaller than the sum of the radii of the two cylinders , then they are considered to be in contact and penalty forces are applied to each element as a function of the scalar overlap , where and are the radii of edges and .if is smaller than zero , then the two edges are not in contact and no penalty is applied . denoting as the unit vector pointing from closest point on edge to the closest point on edge , the self - contact repulsion force is given by \mathbf{d}_{min}^{ij}\ ] ] where denotes the heaviside function and ensures that a repulsion force is produced only in case of contact ( ) .the first term within the square brackets expresses the linear response to the interpenetration distance as modulated by the stiffness , while the second damping term models contact dissipation and is proportional to the coefficient and the interpenetration velocity .   in the previous sections we focused on forces and torques that arise exclusively from the internal mechanical and geometric properties of the rod .since we wish to investigate scenarios in which filaments interact with the surrounding environment , a first natural extension is to account for solid boundaries . as a general strategy , we avoid enforcing the presence of boundaries via lagrangian constraints as their formulation may be cumbersome , impairing the modularity of the numerical solver , compromising its design and performance .we instead resort to calculating forces and torques directly and replacing hard constraints with ` soft ' displacement - force relations .obstacles and surfaces are then modeled as soft boundaries allowing for interpenetration with the elements of the rod ( fig .[ fig : walls ] ) .the wall response balances the sum of all forces that push the rod against the wall , and is complemented by other two components which help prevent possible interpenetration due to numerics . the interpenetration distance triggers a normal elastic response proportional to the stiffness of the wall while a dissipative term related to the normal velocity component of the filament with respect to the substrate accounts for a damping force , so that the overall wall response reads where denotes the heaviside function and ensures that a wall force is produced only in case of contact ( ) . here is the boundary outward normal ( evaluated at the contact point , that is the contact location for which the normal passes through the center of mass of the element ) , and and are , respectively , the wall stiffness and dissipation coefficients .   to contact .we note that balances the sum of all forces that push the rod against the wall , and is complemented by other two components which allow to amend to possible interpenetration due to numerics .these components are an elastic one ( ) and a dissipative one ( ) , where and are , respectively , the wall stiffness and dissipation coefficients.,scaledwidth=40.0% ]   solid boundaries also affect the dynamics of the filament through surface friction . this is a complex physical phenomenon in which a range of factors are involved , from roughness and plasticity of the surfaces in contact to the kinematic initial conditions and geometric setup . here , we adopt the amonton - coulomb model , the simplest of friction models .this model relates the normal force pushing a body onto a substrate to the friction force through the kinetic and static friction coefficients , depending on whether the contact surfaces are in relative motion or not .  despite the simplicity of the model, its formulation and implementation may not be necessarily straightforward , especially in the case of rolling motions . given the cylindrical geometry of our filaments , the effect of surface friction is naturally decomposed into a longitudinal component associated with purely translational displacements , and a lateral component associated with both translational and rotational motions ( fig .[ fig : frictionmodel ] ) .we use the notation , , to denote the projection of the vector in the directions , , , as illustrated in fig .[ fig : frictionmodel ] ., , denotes the projection of the vector in the directions , , .( b , c ) kinematic and dynamic quantities at play at any cross section in case of rolling and slipping ( b ) and pure rolling ( c ) motion .red arrows correspond to forces and torques , green arrows correspond to velocities , and black arrows correspond to geometric quantities . ]the longitudinal friction force is opposite to either the resultant of all forces acting on an element ( static case ) or to the translational velocity ( kinetic case ) along the direction ( fig .[ fig : frictionmodel ] ) .the amonton - coulomb model then reads where is the absolute velocity threshold value employed to distinguish between static ( ) and kinetic ( ) case .we define in a limit form to accommodate the fact that inequalities are numerically evaluated up to a small threshold value . as can be noticed , the static friction force is always equal and opposite to up to a maximum value proportional to the normal force though the coefficient .the kinetic friction force is instead opposite to the translational velocity , but does not depend on its actual magnitude while is proportional to via . in general , so that it is harder to set a body into motion from rest than dragging it .the lateral displacement of a filament in the direction is associated with both translational ( ) and rotational ( ) motions , as illustrated in fig .[ fig : frictionmodel]b , c . in this casethe distinction between static and kinetic friction does not depend on , but on the relative velocity ( also referred to as slip velocity ) between the rod and the substrate where is the local velocity of the filament at the contact point with the substrate , due to the axial component of the angular velocity .  in the static or no - slip scenario ( ) ,the linear momentum balance in the direction , and the angular momentum balance about the axis express a kinematic constraint between the linear acceleration and angular acceleration , so that where and are the forces and torques acting on the local element , and is the rolling friction force at the substrate - filament interface necessary to meet the no - slip condition . by recalling that a disk mass second moment of inertia about  , the above system can be solved for the unknown and , yielding   therefore the lateral friction force and the associate torque can be finally expressed as where and are , respectively , the rolling static and kinetic friction coefficients .   in the previous section we considered isotropic friction by assuming that the coefficients and are constant and independent from the direction of the total acting forces ( static case ) or relative velocities ( kinetic case ) .nevertheless , frictional forces may be highly anisotropic .for example , the anisotropy caused by the presence of scales on the body of a snake crucially affects gaits and performance .the amonton - coulomb model can be readily extended to account for anisotropic effects by simply assuming the friction coefficients and to be functions of a given reference direction .the nature of these functions depends on the specific physical problems under investigation .an example of this approach is illustrated in section [ sec : limblesslocomotion ] in the context of limbless locomotion .we also extend our computational framework to address flow - structure interaction problems .in particular we consider the case in which viscous forces dominate over inertial effects , i.e. we consider systems in which the reynolds number where and are the density and dynamic viscosity of the fluid , and is the characteristic velocity of the rod . in these conditions , the drag forces exerted by the fluid on our filaments can be analytically determined within the context of slender - body theory . at leading order resistive forces line densities scale linearly with the local rod velocities according to we note that the matrix introduces an anisotropic effect for which where and are , respectively , tangential and orthogonal viscous drag components .the coupling of liquid environment , filament mechanics and muscular activity provides a powerful quantitative platform to characterize biological locomotion at the microscopic scale ( bacteria , protozoa , algae , etc ) as well as to design propulsion strategies in the context of artificial micro - swimmers .before moving to biophysical applications , we validate our proposed methodology against a number of benchmark problems that have analytic solutions and examine the convergence properties of our approach .examples incude euler and mitchell buckling of a slender filament that is compressed or twisted , nonlinear helical buckling , stretching and twisting vibrations , and bending and shear in a timoshenko beam .euler buckling involves a single straight isotropic , inextensible and unshearable rod subject to an axial load , as depicted in fig .[ fig : eulerbuckling]a .the critical axial load that the rod can withstand before bending can be analytically expressed as where is the modulus of elasticity of the rod , is the area moment of inertia , is the length , and is a constant which depends on the boundary conditions . if both ends are fixed in space but free to rotate then , thus where is the bending stiffness .we test our solver against the above analytical solution by simulating the time evolution of an inextensible and unshearable rod . in fig .[ fig : eulerbuckling]a , we show the results of our computations in the limit when both ends are free to rotate and all their spatial degrees of freedom are fixed except for one which allows the top end to slide vertically . the inextensible and unshearable conditions are enforced numerically by setting the entries of the matrix to be much larger than those of ( details in fig .[ fig : eulerbuckling ] ) .we explore the phase spaces - and - and determine the probability of a randomly perturbed rod to undergo a buckling event , characterized by the bending energy exceeding the small threshold value . as can be seen in fig .[ fig : eulerbuckling]b , c the obtained probability landscapes exhibit a sharp transition in agreement with the exact solution of eq .( [ eq : criticaleulerforce ] ) .     the euler buckling benchmark allows us to test the capability of our solver to capture the onset of an instability relative to the bending modes .next we consider the mitchell buckling instability that simultaneously accounts for both bending and twist . when the ends of an isotropic , inextensible and unshearable filament are joined together , the resulting configuration is a planar circular shape . if the two ends are twisted by a given angle and glued together , a circular shape with uniform twist density is obtained .when the total twist , i.e. the integrated twist line density along the filament , exceeds a critical value the rod buckles out of plane .this critical total twist can be analytically expressed as where and are , respectively , the bending and twist rigidities .we explore the phase space - and determine the probability of a randomly perturbed rod to undergo a buckling event , characterized by the translational energy exceeding a small threshold value . as can be seen in fig .[ fig : mitchellbuckling ] , our results show a sharp transition in agreement with the exact solution of eq .( [ eq : criticalmitchell ] ) .the euler and mitchell buckling benchmarks test only the onset of instability .to validate our discrete derivative operators beyond the onset of instability , we consider a long straight , isotropic , inextensible , and unshearable rod undergoing bending and twisting .the filament is characterized by the length and by the bending and twist stiffnesses and .the clamped ends of the rod are pulled together in the axial direction with a slack and simultaneously twisted by the angle , as illustrated in fig .[ fig : helicalbuckling_spaceconv]a . under these conditionsthe filament buckles into a localized helical shape ( fig .[ fig : helicalbuckling_spaceconv]e ) .the nonlinear equilibrium configuration of the rod can be analitycally determined in terms of the total applied slack and twist .we denote the magnitude of the twisting torque and tension acting on both ends and projected on by and , respectively .their normalized counterparts and can be computed via the ` semi - finite ' correction approach by solving the system then , the analytical form of can be expressed as \mathbf{i}\nonumber\\ & & -l\left[\frac{1}{2\pi t_h}\sqrt{4t_h - m^2_h } \text { sech}\left(\pi \bar{s } \sqrt{4t_h - m^2_h}\right)\cos(m_h\pi \bar{s})\right]\mathbf{j}\label{eq : helicalanal}\\ & & + l\left[\bar{s}-\frac{1}{2\pi t_h}\sqrt{4t_h - m^2_h } \text { tanh}\left(\pi \bar{s } \sqrt{4t_h - m^2_h}\right)\right]\mathbf{k}\nonumber,\end{aligned}\ ] ] where is the normalized arc - length . herewe make use of eq .( [ eq : helicalanal ] ) to investigate the convergence properties of our solver in the limit of refinement .to compare analytical and numerical solutions , a metric invariant to rotations about is necessary .following bergou et al. , we rely on the definition of the envelope  where is the angular deviation of the tangent from the axial direction , and is the corresponding maximum value along the filament . the envelope relative to the analytical solution of eq .( [ eq : helicalanal ] ) , and relative to a numerical model of discretization elements can be estimated easily via finite differences .this allows us to determine the convergence order of the solver by means of the norms , and of the error .we simulate the problem illustrated in fig .[ fig : helicalbuckling_spaceconv ] at different space - time resolutions .the straight rod originally at rest is twisted and compressed at a constant rate during the period .subsequently , the ends of the rod are held in their final configurations for the period to allow the internal energy to dissipate ( according to the model of section [ sec : dissipation ] ) until the steady state is reached .simulations are carried out progressively refining the spatial discretization by varying and the time discretization is kept proportional to , as reported in fig .[ fig : helicalbuckling_spaceconv ] .  as can be seen in fig .( [ fig : helicalbuckling_spaceconv])b , c , e the numerical solutions converge to the analytical one with second order in time and space , consistent with our spatial and temporal discretization schemes .moreover , to further validate the energy conserving properties of the solver , we turn off the internal dissipation ( fig .[ fig : helicalbuckling_spaceconv]d ) and observe that the total energy of the filament is constant after and matches its theoretical value .so far we have considered benchmark problems entailing various combinations of bending and twisting modes .we now proceed to validate our discrete model in the presence of stretching and shear .we consider a system in which a rod hanging from one end and subject to gravity oscillates due to a mass suspended at the other end , and due to its own mass , as depicted in fig .[ fig : oscillationgravity]a , d .this system is analogous to a mass - spring oscillator .the static solution is then obtained by integrating the infinitesimal elongations along the spring due to the local load , yielding the total equilibrium extension where is the spring constant , is a constant factor , and is the equivalent mass .thus , the final equilibrium length of the rod reads , with being the rest unstretched length .the dynamic solution is instead characterized by oscillations of period and by a time varying length of the spring \delta l^*.\ ] ] in this case , unlike the static solution , the factor depends on the ratio .in fact it can be shown that for , and for .the obtained analytical results rely on the assumption of being constant in space and time , given a fixed ratio .however , this condition is not met here since is a function of space and time , due to dilatation and mass conservation .nevertheless , as the young s modulus , that is as a soft filament becomes stiff , the constant and our rod model must recover the behavior of the mass - spring oscillator .indeed , fig .[ fig : oscillationgravity]b , c , e , f shows how the proposed numerical method converges to the analytical oscillation period and normalized longitudinal displacement as increases .next we examine the problem of twisting waves generated in a rod axially stretched , as illustrated in fig .[ fig : longwaveload_conv]a .the coupling between stretching and the other dynamic modes tests the rescaling in terms of the dilatation factor of eqs .( [ eq : linmomentfinal ] , [ eq : angmomentfinal ] ) .the rod is clamped at one end , stretched by the quantity , and forced to angularly vibrate about the axial direction by applying at the free end the couple , where and are the corresponding forcing amplitude and frequency . in the case of no internal dissipation and constant circular sections ,the induced standing angular wave can be determined analytically .the dynamics of twisting yields the wave equation for the angular displacement  where is the shear wave velocity , is the shear modulus , and is the density . by assuming a solution of the form , and by applying the boundary conditions and with twisting torque and second area moment of inertia about the axial direction, we can solve eq .( [ eq : twistwave ] ) obtaining   as can be seen in fig .[ fig : longwaveload_conv]b , our numerical method recovers the derived analytical solution for the twist angular displacement along the stretched rod . moreover, the solver consistently exhibits a second order convergence in time and space given the error metric , where represents our numerical solutions in the limit of refinement ( fig .[ fig : longwaveload_conv]c ) .we consider now the effect of bending and shear simultaneously by validating our numerical methods against the timoshenko cantilever of fig .[ fig : timoshenko_conv]a .timoshenko s model accounts for bending elasticity , rotary inertia and shear deformations , building on classical beam theories by rayleigh ( bending elasticity and rotary inertia ) and euler - bernoulli ( bending elasticity only ) .the model captures the behavior of short or composite beams in which shear deformations effectively lower the stiffness of the rod .we consider a beam clamped at one end and subject to the downward force at the free end , as illustrated in fig .[ fig : timoshenko_conv]a .the static solution for the displacement along the vertical direction of the rod can then be analytically expressed as where as usual is the length of the rod , is the constant cross sectional area , is the area second moment of inertia about the axis , and are the young s and shear moduli , and is the timoshenko shear factor for circular sections and accounts for the fact that the shear stress varies over the section . furthermore , the timoshenko ( as well as rayleigh and euler - bernoulli ) theory relies on the assumption of small deflections , so that the horizontal coordinate along the direction can be approximated by the arc - length ( fig .[ fig : timoshenko_conv]a and _ appendix _ for further details and derivation ) , hence the use of in the above equation .if the shear modulus approaches infinity or if the ratio , then the timoshenko model in the static case reduces to the euler - bernoulli approximation , yielding where the shear term of eq .( [ eq : displacementtimo ] ) becomes negligible .we compare our numerical model with these results by carrying out simulations of the cantilever beam of fig .[ fig : timoshenko_conv]a in the time - space limit of refinement . as can be noticed in fig .[ fig : timoshenko_conv]b the discrete solution recovers the timoshenko one .therefore , the solver correctly captures the role of shear that reduces the effective stiffness relative to the euler - bernoulli solution .moreover , our approach is shown to converge to the analytical solution in all the norms , , of the error , where is the vertical displacement numerically obtained in the refinement limit .we note that the norms and exhibit first order convergence , while decays with a slope between first and second order .we attribute these results to the fact that while the timoshenko solution does not consider axial extension or tension , it does relies on the assumption of small deflections ( ) , therefore effectively producing a dilatation of the rod . on the contrary , our solver does not assume small deflections and does not neglect axial extension , since the third entry of the matrix has the finite value ( see fig . [fig : timoshenko_conv ] for details ) .this discrepancy is here empirically observed to decrease the convergence order .this completes our validation of the proposed numerical scheme and demonstrates the robustness and accuracy of our methodology in simulating soft filaments in simple situations .we now proceed to illustrate the potential of our framework by means of three different applications .we consider first a static problem in which self - contact , bending and twist give rise to the classic out - of - plane configurations denoted as plectonemes , while the addition of stretching and shearing produces a different type of experimentally observed solutions , known as solenoids .then we turn our attention to two dynamic biophysical problems in which an active filament interacts with a solid and a liquid environment , exhibiting qualitatively different optimal biolocomotion strategies .when an inextensible rod is clamped at one end and twisted a sufficiently large number of times at the other end , it becomes unstable , coils up and generates a characteristic structure known as plectoneme .while this behavior has been well characterized both theoretically and experimentally , its analog for highly extensible filaments has been ignored . in particular , for large extensional and twisting strains qualitatively different solutions arise , such as those corresponding to tightly packed solenoidal structures whose properties are as yet poorly understood .    given the broad scope of our computational framework for the investigation of soft filaments dynamics , we now study the formation of solenoids and plectonemes . as illustrated in fig .[ fig : solenoidsplectonemes]a , a soft rod of young s modulus  pa is clamped at one end , and subject to an axial load , while also being twisted times at the other end . asexperimentally and theoretically observed for , i.e. in the absence of stretching ( ) , plectonemes are generated ( fig .[ fig : solenoidsplectonemes]b ) . when the load is increased so that the elongation of the rod approaches , solenoids arise as predicted in and illustrated in fig .[ fig : solenoidsplectonemes]c .this test case , therefore , shows the ability of our solver to capture qualitatively different instability mechanisms , driven by the competition between the different modes of deformation of the rod .we leave the details of the explanation of the phase diagram for the formation of plectonemes , solenoids and intermediate structures for a later study .the mechanics of slithering locomotion typical of snakes has been extensively investigated experimentally , theoretically and computationally .while biological experiments have provided quantitative insights , theoretical and computational models have been instrumental to characterize qualitatively the working principles underlying snake locomotion .although these models implement different levels of realism , they generally rely on a number of key simplifications .typically , theoretical models assume planar deformations and/or disregard mechanics by prescribing body kinematics .computational models offer a more realistic representation , but they have mostly been developed for and tailored to robotic applications .for example , snakes are often modeled as a relatively small set of hinges and/or springs representing pointwise localized actuators that connect contiguous rigid segments .therefore , they do not account for the continuum nature of elastic body mechanics and biological muscular activity .moreover , in robot replicas the critical feature of friction anisotropy ( section [ sec : isovsani_app ] of the _ appendix _ ) is commonly achieved through the use of wheels . as a consequence computational models often assume only two sources of anisotropy , in the tangential and lateral direction with respect to the body .this is in contrast with biological experiments that highlight the importance of all three sources of anisotropy , namely forward , backward and lateral .our approach complements these previous attempts by accounting for physical and biological effects within a continuum framework ( eqs .[ eq : velfinal]-[eq : angmomentfinal ] ) . in this sectionwe demonstrate the qualitative and quantitative capabilities of the proposed method by reverse engineering optimal slithering gaits that maximize forward speed .we consider a soft filament of unit length actuated via a planar traveling torque wave of muscular activity in the direction perpendicular to the ground .the interaction with the substrate is characterized by the ratios and with , as experimentally observed for juvenile pueblan milk snakes on a moderately rough surface .the actual value of the friction coefficient is set so that the ratio between inertial and friction forces captured by the froude number is , as measured for these snakes .  in the spirit of , we wish to identify the fastest gaits by optimizing the filament muscular activity . the torque wave generated by the snake is parameterized according to section [ sec : muscularactivity ] and is characterized by control points and a unit oscillation period , so that overall we optimize for five parameters , four of which are responsible for the amplitude profile along the rod ( , , , ) , while the last one represents the wavenumber ( see section [ sec : muscularactivity ] ) .  these parameters are let free to evolve from an initial zero value , guided by an automated optimization procedure that identifies the optimal values that maximize the snake s forward average speed over one activation cycle .the algorithm of choice is the covariance matrix adaptation - evolution strategy ( cma - es ) which has been proven effective in a range of biophysical and engineering problems , from the optimization of swimming gaits , morphologies and collective dynamics to the identification of aircraft alleviation schemes or virus traffic mechanisms .the cma - es is a stochastic optimization algorithm that samples generations of parameter vectors from a multivariate gaussian distribution . hereeach parameter vector represents a muscular activation instance , and every generation entails the evaluation of different gaits .the covariance matrix of the distribution is then adapted based on successful past gaits , chosen according to their corresponding cost function value , until convergence to the optimum .the course of the optimization is reported in fig .[ fig : optimizedsnake ] together with the kinematic details of the identified fastest gait .as can be noticed in fig .[ fig : optimizedsnake]e , f the forward scaled average speed approaches , consistent with experimental evidences .moreover , cma - es finds that the optimal wavelength is ( fig .[ fig : optimizedsnake]g ) , again consistent with biological observations .thus , this value of wavelength strikes a balance between thrust production and drag minimization within the mechanic constraints of the system .we note that a rigorous characterization of slithering locomotion from an optimality standpoint would require the knowledge of a number of biologically relevant parameters ( young s and shear moduli of muscular tissue , maximum attainable torques , etc ) and environmental conditions ( terrain asperities , presence of pegs , etc ) and goes beyond the scope of the present work .nevertheless , this study illustrates the robustness , quantitative accuracy and suitability of our methodology for the characterization of bio - locomotion phenomena .we finally turn to apply the inverse design approach outlined in the previous section to the problem of swimming at low reynolds numbers where viscous forces dominate inertial effects .we maintain the exact same set up as in the slithering case , while we change the environment from a solid substrate to a viscous fluid .the flow - filament interaction is then modeled via slender - body theory , as illustrated in section [ sec : hydro ] .once again we inverse design planar optimal gaits for forward average speed within one activation cycle , by employing the same muscular activity parameterization as for slithering . in order to verify _ a - posteriori _ the biological relevance of the identified optimal solution , we consider the case of the sea urchin spermatozoon _ echinus esculentus _ which swims by means of helical or planar waves traveling along its flagella of length  m. the gait corresponding to planar swimming is characterized by kinematic undulations of wavelength and frequency . at spermatozoon attains the scaled velocity , where is the dimensional cruise speed .although this gait may not be the absolute optimal planar locomotion pattern , the fact that it is replicated in a large number of organisms suggests that it captures some effective features that we expect to qualitatively recover via our numerical optimization .the course of the optimization is reported in fig .[ fig : optimizedstokeslateral ] together with the kinematic details of the identified fastest gait . as can be noticed in fig .[ fig : optimizedstokeslateral]e , f the forward average scaled speed and wavelength approach and , qualitatively and quantitatively consistent with experimental evidences .as in the previous section , we note that a rigorous characterization of swimming at low reynolds numbers from an optimality standpoint would require the knowledge of a number of biologically relevant parameters and environmental conditions , and goes beyond the scope of the present work .nevertheless , this and the previous study illustrate how the interplay between filament mechanics and the surrounding environment crucially affects propulsive gaits , as is biologically evident and automatically recovered via our numerical inverse design approach .this provides us with further confidence in the reliability of our approach .we have presented a generic numerical method for the simulation of soft filaments deforming in three dimensional space .our scheme accounts at any given cross section for all possible deformation degrees of freedom , namely normal and orthonormal bending and shearing , twisting and stretching .furthermore , we enhance it to handle self - contact , muscular activity , solid boundaries , isotropic and anisotropic friction as well as hydrodynamics .the outcome is a relatively simple algorithm able to simulate a plethora of physical and biological phenomena .we validate the proposed method over a battery of benchmark problems entailing different physical aspects and boundary conditions , and we examine its convergence properties in depth .we further showcase the capabilities of our approach by studying the formation of solenoids and plectonemes , and by combining it with an evolution optimization strategy for the characterization of terrestrial limbless locomotion and swimming .our results demonstrate the flexibility and robustness of our discrete model as well as its qualitative and quantitative accuracy .ongoing work involves its coupling to realistic high reynolds number flow solvers as well as its integration with sensory feedback models for the characterization of locomotory neural circuitry .definition of material frame   definition of time and space derivatives of frame directors   time and space derivative relationships between laboratory and material frames   angular momentum governing equation ( lab frame )   because the second moment of inertia is defined in the material frame , the governing equation for the angular momentum is most naturally expressed in the material frame as well ( in the lab frame is a function of space ant time rendering its use cumbersome , while is a constant and , in our isotropic case , diagonal matrix in the material frame ) .we can use eqs .  and to convert all of the terms in eq .  to the material frame .  multiplying by and noting that yields our final governing equation for the angular momentum , expressed in the material frame   briefly derive here the analytical expression of the vertical displacement of eq .( [ eq : displacementtimo ] ) for the cantilever beam problem of fig .[ fig : timoshenko_conv]a . in order to doso we make use of the free body diagram of fig .[ fig : freebodydiagram_app ] , and of the constitutive relations of table [ tab : strains ] and eqs .( [ eq : bendinglaws ] , [ eq : shearlaws ] ) . moreover , we disregard axial extension and assume small deformations so that the coordinate ( along the direction ) is approximated by the arc - length .  recalling that the bending strain is the space derivative of the bending angle ( fig .[ fig : freebodydiagram_app ] ) , we may write where is the bending moment , the young s modulus , and is the second area moment of inertia about the axis ( see fig .[ fig : timoshenko_conv]a ) . the shear angle , as illustrated in fig .[ fig : freebodydiagram_app ] , is the difference between the bending angle and the slope of the centerline , so that where is the shear force , is the cross sectional area , is the shear modulus , and is the timoshenko factor . if a point load is applied downward at , where is the length of the rod , a free body diagram of the beam yields and , so that   by integrating eq .( [ eq : beamelastic2_app ] ) with boundary conditions at , injecting the solution into eq .( [ eq : beamshear2_app ] ) , and integrating again with boundary conditions at , we obtain we validate the friction model introduced in section [ sec : friction ] on three test cases that can be analytically characterized . in all benchmarkswe consider a rigid , unshearable , inextensible straight rod of mass , length , radius , axial mass second moment of inertia .the rod interacts with a surface characterized by static and kinetic friction coefficients and , thus assuming isotropic friction .    in the first testthe rod is initially at rest on a plane inclined of the angle , as depicted in fig .[ fig : surfcefriction_app]a .due to the gravitational acceleration the rod starts rolling or slipping , depending on , down the plane .the linear and angular velocities of the filament , and therefore the corresponding translational and rotational energies can be analytically determined .  by recalling eq .( [ eq : noslipforcerotation ] ) , the force necessary to ensure rolling without slip takes the form . given the maximum static friction force in the case we have .therefore , at the time after releasing the rod , linear and angular velocities read , respectively , and expressing the no slip kinematic constraint between linear and angular accelerations . on the contrary , if the rod starts slipping and linear and angular accelerations are no longer coupled , so that after the time we have , , .therefore , translational and rotational energies as a function of finally read ^ 2}{2 }        & \text{if }  |f_{\text{noslip}}|>|f_s| \end{dcases}\ ] ] and as can be noticed in fig .[ fig : surfcefriction_app]b , our numerical approach faithfully reproduces the derived analytical solution , accurately capturing the discontinuity at the transition between pure rolling and slipping .  the second test case of fig .[ fig : surfcefriction_app]c , d entails a rod set in motion by the external couple on a horizontal plane .depending on the magnitude of the load the filament exhibits pure rolling or slipping motion . by recalling eq .( [ eq : noslipforcerotation ] ) , the force necessary to ensure rolling without slip takes the form . given the maximum static friction force in the case we have .therefore , at the time after releasing the rod , linear and angular velocities read , respectively , and expressing the no slip kinematic constraint between linear and angular accelerations . on the contrary , if the rod starts slipping and linear and angular accelerations are no longer coupled , so that after the time we have , , . therefore , translational and rotational energies as a function of finally read and as can be noticed in fig .[ fig : surfcefriction_app]d , again our numerical approach faithfully reproduces the derived analytical solution , accurately capturing the discontinuity at the transition between pure rolling and slipping .  in the last test case we consider a rod of initial velocity in the direction parallel to a horizontal plane and perpendicular to the filament axis ( fig .[ fig : surfcefriction_app]e ) , and we vary the relative mass moment of inertia ratio .initially the rod slips on the surface and gradually slows down , due to the effect of the kinetic friction , to a point for which linear and angular velocity meet the kinematic constraint characteristic of pure rolling motion .the frictional force induces the torque , so that over a period of time we have and . by enforcing the no slip kinematic constraint , we have that .this allows us to directly compute and and the corresponding translational and rotational energies , yielding as depicted in fig .[ fig : surfcefriction_app]f , our numerical approach accurately reproduces the predicted energies as a function of .   after validating our rolling friction model, we turn to its longitudinal counterpart .here we consider a straight , rigid , inextensible and unshearable rod which is axially pulled or pushed with force for a fixed period of time ( fig .[ fig : surfcefrictionaxial_app ] ) .anisotrpy is captured through the forward , and backward , static and kinetic coefficients . for rod translational energy takes the form while for we have as can be seen in fig .[ fig : surfcefrictionaxial_app ] , our numerical method reproduces the above theoretical predictions .     in this sectionwe illustrate the effect of symmetry breaking via anisotropic friction in a system constituted by a soft filament interacting via surface friction with a solid substrate .if we consider isotropic friction and a specular muscular activation pattern by setting the control values and and the wave number ( see section [ sec : muscularactivity ] ) , then the system is symmetric ( up to inertial effects that can be neglected for small froude numbers ) .therefore , over any activation cycle the snake center of mass does not move . on the contrary ,if we introduce anisotropy the snake will be able to slowly move ( the capability to effectively move is impaired by the absence of the traveling gait component since ) .  as can be observed in fig .[ fig : isoanisotrpicfriction_app ] , this prediction is captured by our numerical scheme , which accurately resolves the physical mechanisms at play . moreover, this test shows once again how our methodology is robust in terms of numerical noise as no spurious displacements or rotations are generated in the symmetric case ( fig .[ fig : isoanisotrpicfriction_app]a , b ) .> p2cm|>p12 cm * symbol & * description + &  length of filament + &  reference length of filament + &  radius of filament + &  centerline position + &  arc length coordinate  ] + &  infinitesimal arc length coordinate + &  reference infinitesimal arc length coordinate + &  time + &  material frame of reference + &  generic vector in the laboratory frame of reference + &  generic vector in the material frame of reference + &  scalar dilatation field + &  shear and stretch + &  internal force density + &  internal torque density + &  external force density + &  external torque density + &  velocity + &  unit tangent vector + &  angular velocity in the material frame + &  generalized curvature in the material frame + &  constant material density + &  cross sectional area + &  area second moment of inertia + * *   > p2cm|>p12 cm * symbol & * description + &  young s modulus + &  shear modulus + &  4/3 + &  bending / twist stiffness matrix ( , , ) + &  shear / stretch stiffness matrix ( , , ) + &  shear / stretch in the material frame + &  bending / twist load in the material frame + &  shear / stretch load in the material frame + &  intrinsic curvature / twist in the material frame + &  intrinsic shear / stretch in the material frame + &  stretching potential energy + &  bending potential energy + &  translational kinetic energy + &  rotational kinetic energy + * *   > p2cm|>p12 cm * symbol & * description + &  reference infinitesimal arc length + &  reference cross section area + &  reference area second moment of inertia + &  reference bending / twist stiffness matrix + &  reference stretch / shear stiffness matrix + &  reference generalized curvature + &  infinitesimal mass element + &  infinitesimal mass second moment of inertia + &  external couple in the material frame + &  external force in the laboratory frame + * *   > p2cm|>p12 cm * symbol & * description + &  unit rotation axis vector ( ) + &  rotation angle about + &  skew - symmetric matrix generated from ( ) + {\times} ] + &  material frames ,  ] + &  pointwise concentrated mass ,  ] + &  discrete edge ,  ] + &  reference edge length ,  ] + &  discrete unit tangent vector ,  ] + &  discrete angular momentum in the material frame ,  ] + &  reference discrete area second moment of inertia ,  ] + &  reference discrete stretch / shear matrix ,  ] + &  smooth integration domain + &  smooth integration domain size + &  discrete voronoi region ,  ] + &  interior nodes ,  ] + &  discrete voronoi region dilatation ,  ] + &  reference discrete voronoi stiffness matrix , $ ] + &  discrete difference operator + &  discrete area operator + * *   > p2cm|>p12 cm * symbol & * description + &  viscous force per unit length + &  viscous torque per unit length + &  translational dissipation coefficient + &  rotational dissipation coefficient + &  single dissipation constant ( = ) * *   > p2cm|>p12 cm * symbol & * description + &  muscular activity magnitude + &  phase + &  time + &  activation period + &  wavelength + &  discrete on - filament spline control point locations + &  discrete on - filament spline control values + &  continuous cubic b - spline + &  number of control points + &  muscular longitudinal compression and dilatation forces + &  muscular torque activation + * *   > p2cm|>p12cm * symbol & * description + &  self - contact prevention force + &  minimal distance between edges and + &  parameterization of a single edge + &  radius of edge + &  scalar overlap between edges and + &  unit vector pointing along minimal distance direction + &  `` soft - core '' stiffness coefficient + &  `` hard - core '' stiffness coefficient + * *   > p2cm|>p12 cm * symbol & * description + &  incident force on the boundary + &  repulsive force from the boundary + &  interpenetration distance + &  heaviside function + &  wall boundary outward normal + &  wall stiffness coefficient + &  wall dissipation coefficient + * *   > p2cm|>p12 cm * symbol & * description + &  coefficient of kinetic friction + &  coefficient of static friction + &  unit vector normal to the substrate interface + &  unit vector lateral to the filament and parallel to the substrate + &  unit vector along the filament and parallel to the substrate + &  longitudinal friction force along + &  resultant of all forces acting on filament element along + &  translational velocity in centerline direction along + &  threshold velocity to distinguish between static and kinetic + &  normal force along + &  lateral velocity of the filament centerline along + &  relative velocity between the filament and the substrate along + &  local velocity of the filament at contact point with substrate along + &  angular velocity of the filament about + &  total force acting on the filament along + &  rolling friction force along necessary to meet no - slip condition + &  torque acting on the rod element about + &  lateral friction force along + &  lateral friction torque about + &  rolling static friction coefficient + &  rolling kinetic friction coefficient + * *   > p2cm|>p12 cm * symbol & * description + &  reynolds number + &  density + &  characteristic velocity of the filament + &  characteristic length of the filament + &  dynamic viscosity of the fluid + &  resistive force density ( viscous drag ) + &  tangential viscous drag component + &  orthogonal viscous drag component + * *   > p2cm|>p12 cm * symbol & * description + &  critical axial load + &  young s modulus + &  area moment of inertia about radial direction + &  boundary condition constant + &  length of the rod + &  bending stiffness + &  bending energy + &  buckling threshold energy + &  total twist + &  critical total twist + &  twisting stiffness + &  axial direction + &  slack + &  twist angle + &  equilibrium configuration + &  twisting torque projected onto ( normalized ) + &  twisting tension projected onto ( normalized ) + &  normalized arc - length + &  analytical envelope + &  numerical envelope given discrete elements + &  angular deviation of tangent from axial direction + &  maximum value along the filament + &  solver error + &  twisting bc application time + &  relaxation time + &  total energy of the filament + &  discretization length + &  error norms + * *   > p2cm|>p12 cm * symbol & * description + &  total equilibrium extension + &  rod mass + &  attached mass + &  equivalent mass + &  constant factor to compute equivalent mass + &  rest length of the rod + &  length of the rod + &  spring constant + &  oscillation period + &  acceleration due to gravity + &  young s modulus + &  forcing amplitude + &  forcing frequency + &  wave velocity + &  shear modulus + &  density + &  analytical standing angular wave + &  numerical standing angular wave given discrete elements + &  twisting torque + &  reference area second moment of inertia about axial direction + &  dilatation factor + &  analytical vertical displacement + &  downward force + &  timoshenko constant coefficient + &  constant reference cross sectional area + &  reference area second moment of inertia about + &  numerical vertical displacement + * *   > p2cm|>p12 cm * symbol & * description + &  young s modulus + &  downward vertical load + &  number of twists + &  number of control points + &  oscillation period + &  forward kinetic friction + &  backward kinetic friction + &  rolling kinetic friction + &  forward static friction + &  backward static friction + &  rolling static friction + &  froude number + &  b - spline control values characterizing muscular activity + &  wavelength of applied traveling wave + &  maximum forward speed + &  activation cycle + &  number of candidate solutions per generation during optimization + &  multivariate gaussian distribution + &  cost function value + &  length of flagella + &  frequency + &  dimensional cruise speed + &  reynolds number + &  length of filament + * *                  w. arne , n. marheineke , a. meister , and r. wegener .numerical analysis of cosserat rod and string models for viscous jets in rotational spinning processes ._ mathematical models and methods in applied sciences _ , 200 ( 10):0 19411965 , 2010 .b. audoly , n. clauvelin , p.t .brun , m. bergou , e. grinspun , and m. wardetzky . a discrete geometric approach for simulating the dynamics of thin viscous threads . _ journal of computational physics _ , 253:0 1849 , 2013 .k. ward , f. bertails , t.y .kim , s.r .marschner , m.p .cani , and m.c .a survey on hair modeling : styling , simulation , and rendering ._ visualization and computer graphics , ieee transactions on _ , 130 ( 2):0 213234 , 2007 .haines , m.d .lima , n. li , g.m .spinks , j. foroughi , j.d .w. madden , s.h .kim , s. fang , m. jung de andrade , f. goktepe , o. goktepe , s.m .mirvakili , s. naficy , x. lepr , j. oh , m.e .kozlov , s.j .kim , x. xu , b.j .swedlove , g.g .wallace , and r.h .artificial muscles from fishing line and sewing thread . _science _ , 3430 ( 6173):0 868872 , 2014 .doi : 10.1126/science.1246906 .olinde rodrigues .des lois gomtriques qui rgissent les dplacements dun systme solide dans lespace : et de la variation des cordonnes provenant de ces dplacements considrs indpendamment des causes qui peuvent les produire . _ journal de mathmatique pures et appliques _ , 5:0 380440 , 1840 .s. neukirch , g.h.m .van der heijden , and j.m.t .writhing instabilities of twisted rods : from infinite to finite length . _ journal of the mechanics and physics of solids _ , 500 ( 6):0 11751191 , 2002 .van der heijden , s. neukirch , v.g.a .goss , and j.m.t .instability and self - contact phenomena in the writhing of clamped rods ._ international journal of mechanical sciences _ , 450 ( 1):0 161196 , 2003 .thompson and a.r . champneys . from helixto localized writhing in the torsional post - buckling of elastic rods ._ proceedings of the royal society of london a : mathematical , physical and engineering sciences _ , 4520 ( 1944):0 117138 , 1996 .i. tanev , t. ray , and a. buller .automated evolutionary design , robustness , and adaptation of sidewinding locomotion of a simulated snake - like robot ._ ieee transactions on robotics _ , 210 ( 4):0 632645 , 2005 .  wim m. van rees , mattia gazzola , and petros koumoutsakos .optimal morphokinematics for undulatory swimmers at intermediate reynolds numbers ._ journal of fluid mechanics _ , 775:0 178188 , 2015 .doi : 10.1017/jfm.2015.283 .n. hansen , s. d. muller , and p. koumoutsakos . reducing the time complexity of the derandomized evolution strategy with covariance matrix adaptation ( cma - es ) ._ evolutionary computation _ , 110 ( 1):0 118 , 2003 .m. gazzola , c.j .burckhardt , b. bayati , m. engelke , u.f .greber , and p. koumoutsakos .a stochastic model for microtubule motors describes the in vivo cytoplasmic transport of human adenovirus ._ plos computational biology _ , 50 ( 12):0 e1000623 , 2009 .r. shine , h.g .cogger , r.r .reed , s. shetty , and x. bonnet .aquatic and terrestrial locomotor speeds of amphibious sea - snakes ( serpentes , laticaudidae ) ._ journal of zoology _ , 2590 ( 03):0 261268 , 2003 .m. gazzola , p. chatelain , w.m .van rees , and p. koumoutsakos .simulations of single and multiple swimmers with non - divergence free deforming geometries . _ journal of computational physics _ , 2300 ( 19):0 70937114 , 2011 .

Abstract: soft slender structures are ubiquitous in natural and artificial systems and can be observed at scales that range from the nanometric to the kilometric , from polymers to space tethers . we present a general numerical approach to simulate the dynamics of filaments that , at every cross - section , can undergo all six possible modes of deformation , allowing the filament to bend , twist , shear and stretch , consistent with dynamics on the full euclidean group se(3 ) . additionally , we also account for the interaction of an active filament with itself and the environment via self - contact , surface friction and hydrodynamics . we examine the accuracy of our energy preserving and second order spatio - temporal method by means of a number of benchmark problems with known analytic solutions . finally , we demonstrate the capabilities of our approach both on passive physical problems related to solenoid and plectoneme formation in twisted , stretched filaments , and active biophysical problems in the context of limbless locomotion on solid surfaces and in bulk liquids . all together , our approach allows for a broad computational generalization of available methods to study the dynamics of soft filaments .