Remember to update your bookmarks with our new URL.
If you find missing content or broken links, let us know: opensim@stanford.edu

The Strength of Simulation: Estimating Leg Muscle Forces in Stance and Swing


OpenSim is a freely available, user-extensible software system for developing musculoskeletal models and for simulating and analyzing movement. By creating dynamic simulations of movement that combine anatomical models with the physics of the musculoskeletal system, researchers can investigate elements of biomechanics that are difficult to study through experimentation alone.


This tutorial will take you through a typical workflow using OpenSim. You will use several of the OpenSim Tools to estimate the muscle forces of a human leg model during stance and swing phases of gait. In Part I: Leg Muscle Force Estimation in Swing, you will

  • Visualize an Inverse Kinematics (IK) solution,
  • Use the Excitation Editor to generate muscle excitations for a forward dynamic simulation,
  • Use the Static Optimization Tool to estimate muscle excitations when muscle–tendon dynamics are ignored, and
  • Use the Computed Muscle Control (CMC) Tool to estimate muscle excitations in a forward dynamic simulation.

In Part II: Leg Muscle Force Estimation in Stance, you will

  • Use the Inverse Dynamics (ID) Tool to estimate joint torques and residual forces,
  • Use the Residual Reduction Algorithm (RRA) to find model parameter values that reduce the residual forces predicted by the ID solution, and
  • Use CMC to estimate muscle excitations in a forward dynamic simulation.

If you are completing this example as a laboratory exercise for a course on human movement, you will need to submit answers to the questions on the Questions: Leg Muscle Force Estimation page.


This example was created by Ajay Seth, Samuel Hamner, Kat Steele, Jennifer Hicks, Matt DeMers, Thomas Uchida, Daniel Jacobs, and Scott Delp. It was developed for teaching a workshop at the International Society of Biomechanics and refined for Prof. Delp's class at Stanford University.



This is a simplified, single-leg model (leg6dof9musc.osim – 6 degrees of freedom, 9 muscles) that is packaged with the OpenSim distribution. The leg model consists of 7 bodies representing four physiological segments (pelvis, thigh, shank, and foot). The configuration of the system is described by 6 generalized coordinates (pelvis_tilt, pelvis_tx, pelvis_ty, hip_flexion_r, knee_angle_r, and ankle_angle_r). The musculoskeletal forces are generated by 9 muscles (psoas major, gluteus maximus, rectus femoris, vastus intermedius, biceps femoris long head, biceps femoris short head, tibialis anterior, medial gastrocnemius, and soleus).

This simple model is not intended for research.

Getting Started

The files required for this example can be found in the Models directory of your OpenSim Resources Folder (e.g., Documents\OpenSim\4.0\Models\Leg6Dof9Musc).

A copy of these instructions can be saved as a .pdf or a Word document by selecting "Export to PDF" or "Export to Word" from the Tools menu in the top-right corner of this page.


OpenSim is supported by the Mobilize Center , an NIH Biomedical Technology Resource Center (grant P41 EB027060); the Restore Center , an NIH-funded Medical Rehabilitation Research Resource Network Center (grant P2C HD101913); and the Wu Tsai Human Performance Alliance through the Joe and Clara Tsai Foundation. See the People page for a list of the many people who have contributed to the OpenSim project over the years. ©2010-2024 OpenSim. All rights reserved.