Modeling, Simulation and Optimization of Bipedal Walking