Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Static Optimization is a method for estimating muscle activations and muscle forces that satisfy the positions, velocities, accelerations, and external forces (e.g., ground reaction forces) of a motion. The technique is called  "static" since calculations are performed at each time frame, without integrating the equations of motion between time steps. Because there is no integration, Static Optimization can be very fast and efficient, but it does ignore activation dynamics and tendon compliance. (See Hicks et al., (2015) for more details regarding this and similar modeling and simulation choices and their pros and cons.)  

...

 

  • Launch OpenSim and load the model subject01 included in the WorkingWithStaticOptimization folder. This is a simplified, planar, scaled gait model that has only a few degrees of freedom and lumped muscle groups (e.g., the medial gastrocnemius and lateral gastrocnemius are combined into a single gastrocnemius muscle). 
  • Open the Static Optimization tool by choosing Tools > Static Optimization from the drop-down menu.

You must specify the three inputs to Static Optimization: (i) the model, (ii) the motion of interest, and (iii) any external forces (e.g., ground reaction forces).

The tool is using the current model in the GUI (subject01), so you just need to input motion and any external forces.

  • For the motion, you will use a previously calculated inverse kinematics result found in your working folder, subject01_walk_IK.mot. Leave the Filter Coordinates box unchecked (we'll come back to this in Study 2). 
  • Set the Time Range to Process from 0.3 to 1.5 seconds
  • For the Output Directory, add \/ResultsSO to the current directory.
  • On the 'Actuators and External Loads' tab, Check the External Loads box and then select subject01_walk_grf.xml as the External Loads. See here for more details about specifying external loads.
  • Save the setup file as StaticOptimization_Setup.xml, then hit Run to begin the analysis. 

The tool will now step through each time frame of the input motion. At each time, updating the model coordinates, external loads, and calculating the muscle forces and activations needed to generate the model's accelerations.

 


 

 

Warning
While the analysis was running (or when it was finished), you may have noticed the following output in the GUI's "Messages" window. You may have also seen that the analysis ran very slowly.

Once the Static Optimization tool has finished, the results are saved to your ResultsSO folder:

  • Launch the plotter
  • Select Y Quantity and choose Load file
  • Navigate to the ResultsSO folder and select the file Scaled_Model_StaticOptimization_activation.sto
  • Plot the Gastrocnemius muscle activations versus time for the right leg.
  • Minimize the plot – we'll come back to it later.

 

...

  • Re-open the Static Optimization tool (if you have already closed it), and load your saved setup file. 
  • You can add additional actuation by going to the Actuators input box in the Actuators and External Loads tab, clicking Edit... > Add and selecting the gait10dof18musc_Strong_actuators.xml from your working folder. The actuator file is a pre-made file that contains specifications for actuators for each coordinate in the model (i.e., reserves and residuals plus an actuator to control the lumbar extension degree of freedom).  
  • We want to append these actuators to the existing set of muscles, rather than replacing the muscles, so select the button Append to model's force set
  • Go to Main Settings, change the output directory to \/ResultsSO_StrongActuators, so you don't print over your previous results. 
  • Save this new version of the setup file and rerun the analysis. Looking into the GUI message window you will see that the last error message is now gone, meaning that the model can generate sufficient forces.

...

  • Launch the Static Optimization tool and load your setup file, making sure you're still appending the file with reserve and residual actuators. 
  • Use the motion subject_adjusted_Kinematics_q.sto (these are the kinematics generated by RRA).
  • Be sure to NOT filter the kinematic data
  • Change the step interval to 10 
  • Make sure the time is set to 0.3 to 1.5s
  • Change the output folder to \/ResultsSO_StrongActuators_RRA
  • Save a new version of the setup file (e.g., StaticOptimization_SetupRRA)

...

Code Block
<optimal_force>100</optimal_force>

Edit the actuators file and change each actuator's optimal force from 100 to 1. The easiest way to change this is by editing the file directly in a text editor like Notepad++ (download Notepad++). However, you can use any text editor.

  • Open the actuators file gait10dof18musc_Strong_actuators.xml in a text editor
  • Find all the XML tags for optimal_force and change their value from 100 to 1.

  • Save the actuators file as gait10dof18musc_Actuators_Normal.XML


 

 

Perform another Static Optimization analysis using the RRA adjusted kinematics.

  • Load your StaticOptimization_SetupRRA file from the previous Study
  • Change the output directory to \ /ResultsSO_NormalActuators_RRA
  • Edit the Additional force set files. Delete the old actuators file and add thew new one that you created, Make sure you are still "Appending to the model's force set."

  • Save the setup file
  • Run the analysis

Once the analysis finished plot the Gastrocnemius activation when using the strong actuators (optimal force at 100) vs the normal actuators (optimal force at 1).

 

 

 

Plot and compare the lumbar actuator moment, ankle reserve actuator force and the Fx residual force when using the strong actuators (optimal force at 100) and normal actuators (optimal force at 1)

...