Tracking Optimization
Tracking optimization is a module within Treatment Optimization that aims to find optimal control strategies to reproduce experimental motion data while minimizing discrepancies between predicted and observed kinematic, kinetic, and muscle activation (if applicable) data. It is a powerful tool for understanding and analyzing human movement, enabling researchers and practitioners to optimize control strategies and generate accurate predictions.
Problem Formulation
- Synergy Driven Controller
- Torque Driven Controller
States:
Joint Angles , Joint Velocities , Joint Accelerations
Controls:
Joint Jerk , Synergy Activations
Parameters:
Synergy Weights (optional)
Dynamics:
Cost Function Terms:
Coordinate Tracking: evaluates the difference between the predicted and experimental joint positions.
<RCNLCostTerm>
<type>coordinate_tracking</type>
<!-- coordinate name ex. hip_flexion_r, knee_angle_r -->
<coordinate></coordinate>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Radians -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Inverse Dynamics Moment Tracking: evaluates the difference between the predicted and experimental joint moments.
<RCNLCostTerm>
<type>inverse_dynamics_load_tracking</type>
<!-- load name ex. hip_flexion_r_moment, knee_angle_r_moment -->
<load></load>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Newtons -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
External Force Tracking: evaluates the difference between the predicted and experimental external forces (e.g. ground reaction forces).
<RCNLCostTerm>
<type>external_force_tracking</type>
<!-- external force name ex. ground_reaction_force_x, ground_reaction_force_y1 -->
<force></force>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Newtons -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
External Moment Tracking: evaluates the difference between the predicted and experimental external moments (e.g. ground reaction moments).
<RCNLCostTerm>
<type>external_moment_tracking</type>
<!-- external force name ex. ground_reaction_moment_x, ground_reaction_moment_y1 -->
<moment></moment>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Newton meters -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Muscle Activation Tracking: evaluates the difference between the predicted and experimental muscle activations.
<RCNLCostTerm>
<type>muscle_activation_tracking</type>
<!-- OpenSim muscle name ex. addbrev_r, psoas_r -->
<muscle></muscle>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Unitless -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Joint Jerk Minimization: minimizes joint jerk (required for all joints).
<RCNLCostTerm>
<type>joint_jerk_minimization</type>
<!-- coordinate name ex. hip_flexion_r, knee_angle_r -->
<coordinate></coordinate>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Radians/m^3-->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Path Constraint Terms:
Bounding Root Segment Residuals: Residual forces and moments are experienced on the body segment connected to the ground, typically the pelvis. Limiting these residuals ensures that the net forces and torques acting on the root segment are close to zero, enforcing dynamic consistency.
<RCNLConstraintTerm>
<type>root_segment_residual_load</type>
<!-- residual load name ex. pelvis_tilt_moment, pelvis_tx_force -->
<load></load>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- set in Newtons or Newton meters, recommended setting: 0.1 Nm for residual moments and 1 N for residual forces -->
<max_error></max_error>
<!-- set in Newtons or Newton meters, recommended setting: -0.1 Nm for residual moments and -1 N for residual forces -->
<min_error></min_error>
</RCNLConstraintTerm>
Muscle-Produced Moments and Inverse Dynamic Moments Consistency: This constraint ensures that the moments produced by the muscles in the model align with the inverse dynamic moments calculated from the model. It ensures that the predicted movements are biomechanically possible. Apply to all joints actuated by muscles.
<RCNLConstraintTerm>
<type>muscle_model_moment_consistency</type>
<!-- load name ex. hip_flexion_r_moment, knee_angle_r_moment -->
<load></load>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- set in Newton meters, recommended setting: 0.1 Nm-->
<max_error></max_error>
<!-- set in Newton meters, recommended setting: -0.1 Nm-->
<min_error></min_error>
</RCNLConstraintTerm>
Terminal Constraint Terms:
State Position Periodicity: This constraint enforces the periodicity of joint positions, ensuring that the movement repeats in a cyclic manner.
<RCNLConstraintTerm>
<type>state_position_periodicity</type>
<!-- coordinate name ex. hip_flexion_r, knee_angle_r -->
<coordinate></coordinate>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Radians, recommended setting: 0.0087 Rad -->
<max_error></max_error>
<!-- Set in Radians, recommended setting: -0.0087 Rad -->
<min_error></min_error>
</RCNLConstraintTerm>
State Velocity Periodicity: This constraint enforces the periodicity of joint velocities.
<RCNLConstraintTerm>
<type>state_velocity_periodicity</type>
<!-- coordinate name ex. hip_flexion_r, knee_angle_r -->
<coordinate></coordinate>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Radians/s, recommended setting: 0.0175 Rad/s -->
<max_error></max_error>
<!-- Set in Radians/s, recommended setting: -0.0175 Rad/s -->
<min_error></min_error>
</RCNLConstraintTerm>
Root Segment Residual Load Periodicity: This constraint enforces the periodicity of root segment residual loads.
<RCNLConstraintTerm>
<type>root_segment_residual_load_periodicity</type>
<!-- residual load name ex. pelvis_tilt_moment, pelvis_tx_force -->
<load></load>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- set in Newtons or Newton meters, recommended setting: 0.1 N or 0.1 Nm -->
<max_error></max_error>
<!-- set in Newtons or Newton meters, recommended setting: -0.1 N or -0.1 Nm -->
<min_error></min_error>
</RCNLConstraintTerm>
External Force Periodicity: This constraint enforces the periodicity of external forces.
<RCNLConstraintTerm>
<type>external_force_periodicity</type>
<!-- external force name ex. ground_reaction_force_x, ground_reaction_force_y1 -->
<force></force>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- set in Newtons, recommended setting: 20 N -->
<max_error></max_error>
<!-- set in Newtons, recommended setting: 20 N -->
<min_error></min_error>
</RCNLConstraintTerm>
External Moment Periodicity: This constraint enforces the periodicity of external moments.
<RCNLConstraintTerm>
<type>external_moment_periodicity</type>
<!-- external force name ex. ground_reaction_moment_x, ground_reaction_moment_y1 -->
<moment></moment>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- set in Newton meters, recommended setting: 10 Nm -->
<max_error></max_error>
<!-- set in Newton meters, recommended setting: 10 Nm -->
<min_error></min_error>
</RCNLConstraintTerm>
Sum of Synergy Weights: In synergy-driven problems where the synergy vectors are optimized, this constraint ensures that the synergy solution is unique.
<RCNLConstraintTerm>
<type>synergy_weight_sum</type>
<!-- synergy group, ex. group1, group2 (reference labels of NCP synergy weights file) -->
<synergy_group></synergy_group>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- unitless, recommended setting: 1 -->
<max_error></max_error>
<!-- unitless, recommended setting: 1 -->
<min_error></min_error>
</RCNLConstraintTerm>
States:
Joint Angles , Joint Velocities , Joint Accelerations
Controls:
Joint Jerk , Joint Torques
Dynamics:
Cost Function Terms:
Coordinate Tracking: evaluates the difference between the predicted and experimental joint positions.
<RCNLCostTerm>
<type>coordinate_tracking</type>
<!-- coordinate name ex. hip_flexion_r, knee_angle_r -->
<coordinate></coordinate>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Radians -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Inverse Dynamics Moment Tracking: evaluates the difference between the predicted and experimental joint moments.
<RCNLCostTerm>
<type>inverse_dynamics_load_tracking</type>
<!-- load name ex. hip_flexion_r_moment, knee_angle_r_moment -->
<load></load>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Newtons -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
External Force Tracking: evaluates the difference between the predicted and experimental external forces (e.g. ground reaction forces).
<RCNLCostTerm>
<type>external_force_tracking</type>
<!-- external force name ex. ground_reaction_force_x, ground_reaction_force_y1 -->
<force></force>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Newtons -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
External Moment Tracking: evaluates the difference between the predicted and experimental external moments (e.g. ground reaction moments).
<RCNLCostTerm>
<type>external_moment_tracking</type>
<!-- external force name ex. ground_reaction_moment_x, ground_reaction_moment_y1 -->
<moment></moment>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Newton meters -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Joint Jerk Minimization: minimizes joint jerk (required for all joints).
<RCNLCostTerm>
<type>joint_jerk_minimization</type>
<!-- coordinate name ex. hip_flexion_r, knee_angle_r -->
<coordinate></coordinate>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Radians/m^3-->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Path Constraint Terms:
Bounding Root Segment Residuals: Residual forces and moments are experienced on the body segment connected to the ground, typically the pelvis. Limiting these residuals ensures that the net forces and torques acting on the root segment are close to zero, enforcing dynamic consistency.
<RCNLConstraintTerm>
<type>root_segment_residual_load</type>
<!-- residual load name ex. pelvis_tilt_moment, pelvis_tx_force -->
<load></load>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- set in Newtons or Newton meters, recommended setting: 0.1 Nm for residual moments and 1 N for residual forces -->
<max_error></max_error>
<!-- set in Newtons or Newton meters, recommended setting: -0.1 Nm for residual moments and -1 N for residual forces -->
<min_error></min_error>
</RCNLConstraintTerm>
Torque Controls and Inverse Dynamic Moments Consistency: This constraint ensures that the joint torque controls align with the inverse dynamic moments calculated from the model.
<RCNLConstraintTerm>
<type>torque_model_moment_consistency</type>
<!-- load name ex. hip_flexion_r_moment, knee_angle_r_moment -->
<load></load>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- set in Newton meters, recommended setting: 0.1 Nm-->
<max_error></max_error>
<!-- set in Newton meters, recommended setting: -0.1 Nm -->
<min_error></min_error>
</RCNLConstraintTerm>
Terminal Constraint Terms:
State Position Periodicity: This constraint enforces the periodicity of joint positions, ensuring that the movement repeats in a cyclic manner.
<RCNLConstraintTerm>
<type>state_position_periodicity</type>
<!-- coordinate name ex. hip_flexion_r, knee_angle_r -->
<coordinate></coordinate>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Radians, recommended setting: 0.0087 Rad -->
<max_error></max_error>
<!-- Set in Radians, recommended setting: -0.0087 Rad -->
<min_error></min_error>
</RCNLConstraintTerm>
State Velocity Periodicity: This constraint enforces the periodicity of joint velocities.
<RCNLConstraintTerm>
<type>state_velocity_periodicity</type>
<!-- coordinate name ex. hip_flexion_r, knee_angle_r -->
<coordinate></coordinate>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Radians/s, recommended setting: 0.0175 Rad/s -->
<max_error></max_error>
<!-- Set in Radians/s, recommended setting: -0.0175 Rad/s -->
<min_error></min_error>
</RCNLConstraintTerm>
Root Segment Residual Load Periodicity: This constraint enforces the periodicity of root segment residual loads.
<RCNLConstraintTerm>
<type>root_segment_residual_load_periodicity</type>
<!-- residual load name ex. pelvis_tilt_moment, pelvis_tx_force -->
<load></load>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- set in Newtons or Newton meters, recommended setting: 0.1 N or 0.1 Nm -->
<max_error></max_error>
<!-- set in Newtons or Newton meters, recommended setting: -0.1 N or -0.1 Nm -->
<min_error></min_error>
</RCNLConstraintTerm>
External Force Periodicity: This constraint enforces the periodicity of external forces.
<RCNLConstraintTerm>
<type>external_force_periodicity</type>
<!-- external force name ex. ground_reaction_force_x, ground_reaction_force_y1 -->
<force></force>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- set in Newtons, recommended setting: 20 N -->
<max_error></max_error>
<!-- set in Newtons, recommended setting: 20 N -->
<min_error></min_error>
</RCNLConstraintTerm>
External Moment Periodicity: This constraint enforces the periodicity of external moments.
<RCNLConstraintTerm>
<type>external_moment_periodicity</type>
<!-- external force name ex. ground_reaction_moment_x, ground_reaction_moment_y1 -->
<moment></moment>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- set in Newton meters, recommended setting: 10 Nm -->
<max_error></max_error>
<!-- set in Newton meters, recommended setting: 10 Nm -->
<min_error></min_error>
</RCNLConstraintTerm>