Versions Compared

Key

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


Tip

Download Static Optimization Example Folder

...

...


  • 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.


...