The two-dimensional sagittal-plane musculoskeletal model and the synergy-based control framework. The musculoskeletal model included flexion and extension of hip, knee, and ankle of each leg, and horizontal and vertical translations and rotation of trunk. The model had nine kinematic degrees-of-freedom (DOFs) and eight muscles per leg. The synergy-based control applied a direct collocation algorithm to find the optimal synergy activation profiles and gait dynamics. All state and input variables including synergy activations and kinematics, and the dynamic equations of motion were discretized via a 51-node temporal grid for half a gait cycle. These variables were subsequently optimized such that both the differences between simulated and experimental kinematics, and the neural excitation effort over the gait cycle were minimized. Individual muscle excitations were calculated by adding the contribution of each synergy to that specific muscle.