Abstract The ability to fully discern how the brain orchestrates behavior requires the development of successful computational approaches to integrate and inform in-vivo investigations of the nervous system. To effectively assist with such investigations, computational approaches must be generic, scalable and unbiased. We propose such a comprehensive framework to investigate the interaction between the nervous system and the body for the nematode Caenorhabditis elegans (C. elegans) . Specifically, we introduce a model that computationally emulates the activity of the complete somatic nervous system and its response to stimuli. The model builds upon the full anatomical wiring diagram, the connectome , and integrates it with additional layers including intra-cellular and extra-cellular bio-physically relevant neural dynamics, layers translating neural activity to muscle forces and muscle impulses to body postures. In addition, it implements inverse integration which modulates neural dynamics according to external forces on the body. We validate the model by in-silico injection of currents into sensory- and inter-neurons known to play a role in locomotion behaviors (e.g. posterior/anterior touch) and by applying external forces on the body. We are able to generate characteristic baseline locomotion behaviors (forward and backward movements). Inclusion of proprioceptive feedback, implemented through inverse integration, shows that feedback can entrain and sustain movements initiated by neural or mechanical triggers. We further apply neural stimuli, experimentally known to modulate locomotion, and show that our model supports natural behavioral responses such as turns, reversals and avoidance. The proposed model can be utilized to infer neural circuits involved in sensorimotor behavior. For this purpose, we develop large-scale computational ablation approaches such as (i) ablation survey and (ii) conditional ablation . Our results show how an ablation survey can identify neurons required for a ventral turning behavior. We also show how conditional ablation can identify alternative novel neural pathways, e.g. propose neurons which facilitate steering behavior towards olfactory attractants. The outcomes of our study show that the framework can be utilized to identify neural circuits, which control, mediate and generate natural behavior.