Modeling and simulation of normal and hemiparetic gait