Skip to main content

Design Optimization

Design Optimization empowers researchers, clinicians, and practitioners to customize and tailor treatment strategies based on specific needs and goals. By allowing the modification of cost functions, path constraints, and terminal conditions, Design Optimization provides a flexible framework for exploring and optimizing control strategies, ultimately leading to optimized outcomes and improved patient care.

Problem Formulation

Time

Time is typically set to experimental time, however, design optimization allows for free final time.

States:

Joint Angles  q\ q,

Joint Velocities  u\ u,

Joint Accelerations u˙\dot u

Controls:

Joint Jerk u¨\ddot u,

Synergy Activations,

External Joint Torque Controls (optional)

Parameters:

Synergy Weights (optional)

Built In Parameter Terms (optional)

Dynamics:

[quu˙]=[uu˙u¨]\begin{bmatrix} q \\ u \\ \dot u \end{bmatrix} = \begin{bmatrix} u \\ \dot u \\ \ddot u \end{bmatrix}

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>
Metabolic Cost Minimization: calculates and minimizes metabolic cost based on ProbeSet Settings in osim model.
<RCNLCostTerm>
<type>metabolic_cost_minimization</type>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in W/kg -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Propulsive Force Maximization: calculates and maximizes propulsive force for the indicated foot.
<RCNLCostTerm>
<type>propulsive_force_maximization</type>
<!-- true or false -->
<is_left_foot></is_left_foot>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in 1/Newtons -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Propulsive Force Minimization: calculates and minimizes propulsive force for the indicated foot.
<RCNLCostTerm>
<type>propulsive_force_minimization</type>
<!-- true or false -->
<is_left_foot></is_left_foot>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Newtons -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Breaking Force Maximization: calculates and maximizes breaking force for the indicated foot.
<RCNLCostTerm>
<type>breaking_force_maximization</type>
<!-- true or false -->
<is_left_foot></is_left_foot>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in 1/Newtons -->
</RCNLCostTerm>
Breaking Force Minimization: calculates and minimizes breaking force for the indicated foot.
<RCNLCostTerm>
<type>breaking_force_minimization</type>
<!-- true or false -->
<is_left_foot></is_left_foot>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Newtons -->
</RCNLCostTerm>
Step Length Maximization: calculates and maximizes step length for the indicated foot.
<RCNLCostTerm>
<type>step_length_maximization</type>
<!-- true or false -->
<is_left_foot></is_left_foot>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in 1/Meters -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Step Length Asymmetry Minimization: calculates step length asymmetry ratio and minimizes the difference between the predicted step length ratio and the indicated goal (error_center). An error_center of 1 would encourage step length symmetry.
<RCNLCostTerm>
<type>step_length_asymmetry_minimization</type>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- unitless -->
<max_allowable_error></max_allowable_error>
<!-- unitless, set to 1 for step length symmetry -->
<error_center></error_center>
</RCNLCostTerm>
Single Support Time Maximization: calculates and maximizes single limb support time for the indicated foot.
<RCNLCostTerm>
<type>single_support_time_maximization</type>
<!-- true or false -->
<is_left_foot></is_left_foot>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in 1/seconds -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Single Support Time Goal: calculates the difference between the predicted percent of the gait of single limb support phase and the error_center for the specified foot. On average, single limb support phase is around 37% to 39% of the gait cycle.
<RCNLCostTerm>
<type>single_support_time_goal</type>
<!-- true or false -->
<is_left_foot></is_left_foot>
<!-- unitless, percent in decimal form, set between 0.37 and 0.39 for a normal gait average -->
<error_center></error_center>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- unitless -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Step Time Asymmetry Minimization: calculates step time asymmetry ratio and minimizes the difference between the predicted step time ratio and the indicated goal (error_center). An error_center of 1 would encourage step time symmetry.
<RCNLCostTerm>
<type>step_time_asymmetry_minimization</type>
<!-- unitless, set to 1 for step time symmetry-->
<error_center></error_center>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- unitless -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Joint Power Minimization: calculates and minimizes joint power for the specified coordinate.
<RCNLCostTerm>
<type>joint_power_minimization</type>
<!-- load name ex. hip_flexion_r_moment, knee_angle_r_moment -->
<load></load>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in N*m/s -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Trailing Limb Angle Minimization: calculates and minimizes the trailing limb for the specified foot. The trailing limb angle is the angle between OpenSim's vertical axis and a vector created between the greater trochanter and the fifth metatarsal head. The location of the greater trochanter and the fifth metatarsal is required. The name of the bodies that each location is in reference to must also be assigned.
<RCNLCostTerm>
<type>trailing_limb_angle_minimization</type>
<!-- true or false -->
<is_left_foot></is_left_foot>
<!-- location of greater trochanter on femur ex. 0 0 0 -->
<femur_point></femur_point>
<!-- name of femur body ex. femur_r -->
<femur_body></femur_body>
<!-- location of fifth metatarsal on toe ex. 0 0 0 -->
<toe_point></toe_point>
<!-- name of toe body ex. toes_r -->
<toe_body></toe_body>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in radians -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Trailing Limb Angle Maximization: calculates and maximizes the trailing limb for the specified foot. The trailing limb angle is the angle between OpenSim's vertical axis and a vector created between the greater trochanter and the fifth metatarsal head. The location of the greater trochanter and the fifth metatarsal is required. The name of the bodies that each location is in reference to must also be assigned.
<RCNLCostTerm>
<type>trailing_limb_angle_maximization</type>
<!-- true or false -->
<is_left_foot></is_left_foot>
<!-- location of greater trochanter on femur ex. 0 0 0 -->
<femur_point></femur_point>
<!-- name of femur body ex. femur_r -->
<femur_body></femur_body>
<!-- location of fifth metatarsal on toe ex. 0 0 0 -->
<toe_point></toe_point>
<!-- name of toe body ex. toes_r -->
<toe_body></toe_body>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in 1/radians -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Muscle Activation Minimization: minimizes the activation for the specified muscle.
<RCNLCostTerm>
<type>muscle_activation_minimization</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>
Muscle Activation Maximization: maximizes the activation for the specified muscle.
<RCNLCostTerm>
<type>muscle_activation_maximization</type>
<!-- OpenSim muscle name ex. addbrev_r, psoas_r -->
<muscle></muscle>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- unitless, set as 1/value -->
</RCNLCostTerm>
Center of Mass Velocity X Minimization: calculates and minimizes the center of mass velocity in the x direction..
<RCNLCostTerm>
<type>center_mass_velocity_x_minimization</type>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in m/s -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Center of Mass Velocity Y Minimization: calculates and minimizes the center of mass velocity in the y direction..
<RCNLCostTerm>
<type>center_mass_velocity_y_minimization</type>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in m/s -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Center of Mass Velocity Z Minimization: calculates and minimizes the center of mass velocity in the z direction..
<RCNLCostTerm>
<type>center_mass_velocity_z_minimization</type>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in m/s -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Kinematic Symmetry: calculates kinematic symmetry, or the difference between two joint angles. Kinematic symmetry is calculated as the difference between one joint angle and the second joint angle with a 50% phase shift. To use this term, an even number is encouraged for the "setup_mesh_phase_intervals" tag in the optimal control settings. Additionally, two coordinate names are required to calculate the difference.
<RCNLCostTerm>
<type>kinematic_symmetry</type>
<!-- coordinate name ex. hip_flexion_r -->
<coordinate1></coordinate1>
<!-- coordinate name ex. hip_flexion_l -->
<coordinate2></coordinate2>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in radians -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Walking Speed Goal: calculates the difference between the walking speed and the goal or error_center specified by the user. On average, normal walking speed is around 1.2 to 1.4 meters per second.
<RCNLCostTerm>
<type>walking_speed_goal</type>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set walking speed goal in m/s -->
<error_center></error_center>
<!-- Set in m/s -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Belt Speed Goal: calculates the difference between the belt speed and the goal or error_center for the specified foot. Can be used if belt_speed is optimized, see Built In Parameter Terms.
<RCNLCostTerm>
<type>belt_speed_goal</type>
<!-- true or false -->
<is_left_foot></is_left_foot>
<!-- Set belt speed goal in m/s -->
<error_center></error_center>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set to discrete -->
<cost_term_type>discrete</cost_term_type>
<!-- Set in m/s-->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
Synergy Vector Tracking: calculates the difference between the original and current synergy weights. Can be used if the "optimize_synergy_vectors" tag is set to true.
<RCNLCostTerm>
<type>synergy_vector_tracking</type>
<!-- Set to discrete -->
<cost_term_type>discrete</cost_term_type>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- unitless -->
<max_allowable_error></max_allowable_error>
</RCNLCostTerm>
External Torque Control Minimization: minimizes the external torque controls for the specified coordinate(s). Recommended for synergy driven formulations where the "enable_external_torque_controls" is set to true.
<RCNLCostTerm>
<type>external_torque_control_minimization</type>
<!-- coordinate name ex. hip_flexion_r, knee_angle_r -->
<coordinate></coordinate>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Newton meters -->
<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>
Limit Muscle Activations: This constraint bounds the muscle activations to the user defined values for the specified muscle.
<RCNLConstraintTerm>
<type>limit_muscle_activation</type>
<!-- OpenSim muscle name ex. addbrev_r, psoas_r -->
<muscle></muscle>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- unitless -->
<max_error></max_error>
<!-- unitless -->
<min_error></min_error>
</RCNLConstraintTerm>
Limit Normalized Fiber Length: This constraint bounds the normalized muscle fiber length to the user defined values for the specified muscle.
<RCNLConstraintTerm>
<type>limit_normalized_fiber_length</type>
<!-- OpenSim muscle name ex. addbrev_r, psoas_r -->
<muscle></muscle>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- unitless -->
<max_error></max_error>
<!-- unitless -->
<min_error></min_error>
</RCNLConstraintTerm>
Muscle-Produced Moments with External Aid and Inverse Dynamic Moments Consistency: This constraint ensures that the moments produced by the muscles, with the aid of an external torque controller, align with the inverse dynamic moments calculated from the model. Use if the "enable_external_torque_controls" tag is set to true for the coordinates listed in "external_control_coordinate_list".
<RCNLConstraintTerm>
<type>external_control_muscle_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>
Final State Position: this constraint ensures that the final state position for the specified coordinate is within range of the specified targer error.
<RCNLConstraintTerm>
<type>final_state_position</type>
<!-- coordinate name ex. hip_flexion_r, knee_angle_r -->
<coordinate></coordinate>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Radians -->
<target_error></target_error>
<!-- Set in Radians -->
<max_error></max_error>
<!-- Set in Radians -->
<min_error></min_error>
</RCNLConstraintTerm>
Final State Velocity: this constraint ensures that the final state velocity for the specified coordinate is within range of the specified targer error.
<RCNLConstraintTerm>
<type>final_state_velocity</type>
<!-- coordinate name ex. hip_flexion_r, knee_angle_r -->
<coordinate></coordinate>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in Radians/s -->
<target_error></target_error>
<!-- Set in Radians/s -->
<max_error></max_error>
<!-- Set in Radians/s -->
<min_error></min_error>
</RCNLConstraintTerm>
Final Point Position: this constraint ensures that the final point position for the specified coordinate is within range of the specified targer error.
<RCNLConstraintTerm>
<type>final_point_position</type>
<!-- point location ex. 0 0 0 -->
<point></point>
<!-- body name ex. femur_r, humerus_r -->
<body></body>
<!-- final point position with respect to ground -->
<target_position></target_position>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in m/s -->
<max_error></max_error>
<!-- Set in m/s -->
<min_error></min_error>
</RCNLConstraintTerm>
Final Point Velocity: this constraint ensures that the final point velocity for the specified coordinate is within range of the specified targer error.
<RCNLConstraintTerm>
<type>final_point_velocity</type>
<!-- point location ex. 0 0 0 -->
<point></point>
<!-- body name ex. femur_r, humerus_r -->
<body></body>
<!-- final point velocity with respect to ground -->
<target_velocity></target_velocity>
<!-- true or false -->
<is_enabled></is_enabled>
<!-- Set in m/s -->
<max_error></max_error>
<!-- Set in m/s -->
<min_error></min_error>
</RCNLConstraintTerm>