Deficits in the ankle plantarflexor muscles, such as weakness and contracture, occur commonly in conditions such as cerebral palsy, stroke, muscular dystrophy, Charcot-Marie-Tooth disease, and sarcopenia. While these deficits likely contribute to observed gait pathologies, determining cause-effect relationships is difficult due to the often co-occurring biomechanical and neural deficits. To elucidate the effects of weakness and contracture, we systematically introduced isolated deficits into a musculoskeletal model and generated simulations of walking to predict gait adaptations due to these deficits. We trained a planar model containing 9 degrees of freedom and 18 musculotendon actuators to walk using a custom optimization framework through which we imposed simple objectives, such as minimizing cost of transport while avoiding falling and injury, and maintaining head stability. We first generated gaits at prescribed speeds between 0.50 m/s and 2.00 m/s that reproduced experimentally observed kinematic, kinetic, and metabolic trends for walking. We then generated a gait at self-selected walking speed; quantitative comparisons between our simulation and experimental data for joint angles, joint moments, and ground reaction forces showed root-mean-squared errors of less than 1.6 standard deviations and normalized cross-correlations above 0.8 except for knee joint moment trajectories. Finally, we applied mild, moderate, and severe levels of muscle weakness or contracture to either the soleus (SOL) or gastrocnemius (GAS) or both of these major plantarflexors (PF) and retrained the model to walk at a self-selected speed. The model was robust to all deficits, finding a stable gait in all cases. Severe PF weakness caused the model to adopt a slower, "heel-walking" gait. Severe contracture of only SOL or both PF yielded similar results: the model adopted a "toe-walking" gait with excessive hip and knee flexion during stance. These results highlight how plantarflexor weakness and contracture may contribute to observed gait patterns.