The neuromechanical model integrates a mechanical body, with a muscular system, and a repeating neural unit. (A) Following previous work (Boyle et al., 2012), the mechanical body is modeled in 2D cross-section with a set of variable-width interconnected discrete segments. (B) Each segment consists of two cross-sectional rigid rods (black), damped spring lateral elements (gray), and damped spring diagonal elements (dashed). (C) Following previous work (Izquierdo and Beer, 2018), muscles are modeled as elements that lie along the cuticle that can contract and relax in the dorsoventral plane, staggered along the ventral and dorsal sides of the model worm. Muscle force is distributed across all lateral elements they intersect. Seven repeating neural units innervate three ventral and three dorsal muscles, except the most anterior and the most anterior subunits which innervate four muscles. (D) We modeled the motorneurons in the ventral nerve cord as a network composed of repeating identical subunits. The architecture of each subunit extends previous work (Olivares et al., 2018) and is based on the statistical analysis of the VNC motorneurons given the missing connectome data (Haspel and O'Donovan, 2011). One of seven repeating neural subunits is shown in complete detail. Intraunit connections shown in color; interunit connections shown in black. Chemical synapses shown with solid lines; gap junctions shown with dashed lines.