We developed a computational framework for the prediction of knee contact forces, knee kinematics, and leg muscle forces simultaneously using surrogate modeling and optimization. A novel method for surrogate joint contact modeling based on artificial neural networks was devised and implemented into an open-source toolbox called SCMT. Together with surrogate models of muscle geometry, surrogate models of joint contact were generated and incorporated into a patient-specific musculoskeletal model. We simulated forces and motion by means of two types of optimization, one being a quasi-static approach for gait and the other a direct collocation optimal control approach for knee extension. The two approaches were compared. The resulting contact forces, muscle activations, and knee kinematics obtained for gait were compared to the available in-vivo data.