  Undulatory locomotion is ubiquitous in nature and observed in different
media, from the swimming of flagellated microorganisms in biological fluids, to
the slithering of snakes on land, or the locomotion of sandfish lizards in
sand. Despite the similarity in the undulating pattern, the swimming
characteristics depend on the rheological properties of different media.
Analysis of locomotion in granular materials is relatively less developed
compared with fluids partially due to a lack of validated force models but
recently a resistive force theory in granular media has been proposed and shown
useful in studying the locomotion of a sand-swimming lizard. Here we employ the
proposed model to investigate the swimming characteristics of a slender
filament, of both finite and infinite length, undulating in a granular medium
and compare the results with swimming in viscous fluids. In particular, we
characterize the effects of drifting and pitching in terms of propulsion speed
and efficiency for a finite sinusoidal swimmer. We also find that, similar to
Lighthill's results using resistive force theory in viscous fluids, the
sawtooth swimmer is the optimal waveform for propulsion speed at a given power
consumption in granular media. The results complement our understanding of
undulatory locomotion and provide insights into the effective design of
locomotive systems in granular media.
