Skip to main content

Best Practices

Optimization Stages

As this is a complex optimization, this tool allows the personalization process to be divided into multiple stages to help the gradient-based optimizer find a search direction. We recommend using three stages as shown in the examples.

The focus of the first stage is determining the spring resting length (the height at which a spring marker comes into contact with the floor) and matching the experimental vertical ground reaction force. The resting length is determined in this stage, and it is not included as a design variable in future stages. All cost terms are included, but less emphasis is placed on horizontal ground reaction forces and moments.

In the second stage, the horizontal ground reaction forces have a more significant effect on the cost. In the third stage, the ground reaction moments also become more important. This gradual inclusion of tracking costs generally improves the performance of the tool, but the configuration of stages is fully customizable.

For a three-stage optimization as recommended above, the following table shows general recommendations for cost terms to include and their allowable errors in each stage.

Cost term type (units)Stage 1 allowable errorStage 2Stage 3
marker_position (m)0.0020.0020.002
rotation (radians)0.0050.0050.005
vertical_grf (N)555
horizontal_grf (N)2022
ground_reaction_moment (Nm)10100.5
neighbor_spring_constant (N/m)500500500

In addition to these allowable errors, we recommend setting the "neighborStandardDeviation" element in each stage to 0.2.

The marker_position cost penalizes deviations in X, Y, and Z coordinate positions of markers on the foot during motion. The rotation cost penalizes differences in rotational coordinate values (X, Y, and Z rotation, toe angle) of the foot from experimental motion. The neighbor_spring_constant cost prevents discontinuities in stiffness profile and is explained in more detail in the next section.

If you create a GCP settings file in the OpenSim GUI, these cost terms will be created automatically for you.

Spring Resting Length Initialization

In addition to user-defined stages, an optional preliminary optimization can calibrate the spring resting length. It finds the spring resting length that tracks vertical ground reaction force most accurately with other design variables fixed at their initial values. This can improve performance in the first optimization stage. It is recommended to have this enabled unless the initial value given for the spring resting length is intended to be used.