Children voluntarily adopt a frequency and movement pattern for walking. The force-driven harmonic oscillator (FDHO) model was used in this study for accurate prediction of the preferred walking frequency of nondisabled children and children with spastic hemiplegic cerebral palsy. Four potential optimality criteria with which the preferred walking pattern was forced to comply were examined: minimization of physiological costs, maximization of mechanical energy conservation, minimization of asymmetry in lower limb movements and minimization of variability of interlimb and intralimb coordination. Age and gender-matched nondisabled children (n = 6) and children with spastic hemiplegic cerebral palsy (n = 6) were tested under six frequency conditions of walking at a constant speed on a treadmill. For the nondisabled children, the results indicated that their preferred walking frequency could be accurately predicted by the FDHO model. They freely adopted a walking pattern that minimized physiological costs, asymmetry, and variability of inter- and intralimb coordination. For the children with spastic hemiplegic cerebral palsy, the prediction of preferred overground walking frequency required that the FDHO model be modified to account for muscle mass and leg length discrepancies between limbs and increased stiffness. Most of the children achieved the same optimality goals as the nondisabled when walking at the preferred frequency. However, the children were found to use different mechanisms to attain these goals: for example, a steeper increase observed in physiological cost at higher frequencies; a lowered center of gravity of the body, which allowed for angular symmetry; and greater variability of between-joint coordination in the nonaffected limb and less variability in the affected limb.