Tutorial: using NEURON for neuromechanical simulations - Fietkiewicz, Chris; McDougal, Robert A.; Corrales Marco, David; Chiel, Hillel J.; Thomas, Peter J. (Frontiers in Computational Neuroscience, 2023)
The dynamical properties of the brain and the dynamics of the body strongly influence one another. Their interaction generates complex adaptive behavior. While a wide variety of simulation tools exist for neural dynamics or biomechanics separately, there are few options for integrated brain-body modeling. Here, we provide a tutorial to demonstrate how the widely-used NEURON simulation platform can support integrated neuromechanical modeling. As a first step towards incorporating biomechanics into a NEURON simulation, we provide a framework for integrating inputs from a "periphery" and outputs to that periphery. In other words, "body" dynamics are driven in part by "brain" variables, such as voltages or firing rates, and "brain" dynamics are influenced by "body" variables through sensory feedback. To couple the "brain" and "body" components, we use NEURON's pointer construct to share information between "brain" and "body" modules. This approach allows separate specification of brain and body dynamics and code reuse. Though simple in concept, the use of pointers can be challenging due to a complicated syntax and several different programming options. In this paper, we present five different computational models, with increasing levels of complexity, to demonstrate the concepts of code modularity using pointers and the integration of neural and biomechanical modeling within NEURON. The models include:(1) a neuromuscular model of calcium dynamics and muscle force, (2) a neuromechanical, closedloop model of a half-center oscillator coupled to a rudimentary motor system, (3) a closed-loop model of neural control for respiration, (4) a pedagogical model of a nonsmooth "brain/body" system, and (5) a closed-loop model of feeding behavior in the sea hare Aplysia californica that incorporates biologically-motivated nonsmooth dynamics. This tutorial illustrates how NEURON can be integrated with a broad range of neuromechanical models.