OpenSim Moco  0.2.0
Examples

Moco's examples are categorized as beginner, intermediate, and advanced. Some examples are available from multiple interfaces. Use the links in the Interfaces column to view the code. In the Moco distribution, all examples are in the Resources/Code/ folder.

Note
The intent of all examples is to demonstrate Moco's interface. We do not validate the results of these examples. Users are responsible for validating their results before making any scientific claims.

Beginner

name model/motion description interfaces
SlidingMass point mass Moco's simplest example; MocoFinalTimeGoal MATLAB, Python, C++
SlidingMassAdvanced point mass MocoFinalTimeGoal, Setting solver settings, customizing the initial guess C++
Tracking double pendulum Using MocoStateTrackingGoal C++
MarkerTracking double pendulum Using MocoMarkerTrackingGoal C++
OptimizeMass point mass Parameter optimization with MocoMarkerFinalGoal and MocoParameter MATLAB, Python
MinimizeJointReaction pendulum MocoJointReactionGoal, MocoControlGoal, prescribeControlsToModel MATLAB

Intermediate

name model/motion description interfaces
MocoTrack lower-limb Using the MocoTrack tool for walking with marker tracking and state tracking; generating a PDF report MATLAB, Python, C++
MocoInverse lower-limb Using the MocoInverse tool for walking; generating a PDF report MATLAB, Python, C++
2DWalking walking MocoTrack, MocoStudy prediction, MocoControlGoal, MocoAverageSpeedGoal, MocoPerodicityGoal, createPeriodicSolution C++
MarkerTracking10DOF walking MocoControlGoal, MocoMarkerTrackingGoal MATLAB
SitToStand torque-driven single leg MocoStudy motion prediction, MocoInverse MATLAB
PredictAndTrack double pendulum MocoMarkerFinalGoal, MocoFinalTimeGoal, MocoMarkerTrackingGoal, MocoStateTrackingGoal Python
PrototypeCustomGoal N/A Sandbox for defining a custom MocoGoal MATLAB

Advanced

name model/motion description interfaces
CustomImplicitAuxiliaryDynamics N/A Creating a component with implicit auxiliary dynamics (like muscle tendon compliance) C++
CustomEffortGoal N/A Creating a plugin for a custom goal C++