Versions Compared

Key

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

...

For the following exercise, it is recommended that you have a program capable of recognizing XML tags and folding code (e.g., Notepad++ on Windows, TextMate on Mac, Sublime Text on either platform).

Tip
titleTip for new Notepad++ users

To teach Notepad++ to recognize XML tags in .osim files, go to SettingsStyle Configurator…, select "XML" from the Language list, type "osim" in the User ext. box, and click Save & Close. (You will need to re-open your .osim file for the change to take effect.)

...

The necessary files are located in the "Models/Tug_of_War" folder of the OpenSim Resources directory (by default, C:/Users/<username>/Documents/OpenSim/4.14).  Locate Locate the model file 'Tug_of_War_Millard.osim', the controls file 'Tug_of_War_Millard_controls.xml' , and the initial states file 'Tug_of_War_Millard_initial_states.sto' and copy them into your working directory. Copy the model and save it with the filename Tug_of_War_Millard_Iso.osim.

Note
titleCorrection for time constants in OpenSim 4.0 and 4.1

In the Tug_of_War_Millard.osim file packaged with OpenSim 4.0 and 4.1, the activation_time_constant and deactivation_time_constant properties are erroneously within the MuscleFirstOrderActivationDynamicModel element; move these two properties out of MuscleFirstOrderActivationDynamicModel and into Millard2012EquilibriumMuscle. This model file contains the fix: Tug_of_War_Millard.osim

An OpenSim model is created using a series of XML elements. An XML element consists of a start tag, a value, and an end tag. The value between the start and end tags can be a string, a number, or another XML element.

Open the model file 'Tug_of_War_Millard_Iso.osim' in your favorite text editor. At the top of the file, you will find a block that indicates the presence of XML content, then an XML element called OpenSimDocument. Within the OpenSimDocument element is a Model element consisting of several model components. You may recognize the model components as categories shown in the Navigator Pane of the OpenSim GUI.

...

titleClick to Expand: Basic Model XML

...

languagehtml/xml

...

An OpenSim model is created using a series of XML elements. An XML element consists of a start tag, a value, and an end tag. The value between the start and end tags can be a string, a number, or another XML element.

Open the model file 'Tug_of_War_Millard_Iso.osim' in your favorite text editor. At the top of the file, you will find a block that indicates the presence of XML content, then an XML element called OpenSimDocument. Within the OpenSimDocument element is a Model element consisting of several model components. You may recognize the model components as categories shown in the Navigator Pane of the OpenSim GUI.

Expand
titleClick to Expand: Basic Model XML


Code Block
languagehtml/xml
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSimDocument Version="30000">
    <Model name="Tug_of_War_Millard">
		...
		<BodySet> ... </BodySet>
		<ConstraintSet> ... </ConstraintSet>
		<ForceSet> ... </ForceSet>
		<MarkerSet> ... </MarkerSet>
		<ContactGeometrySet> ... </ContactGeometrySet>
		<ControllerSet> ... </ControllerSet>
		<ComponentSet> ... </ComponentSet>
		<ProbeSet> ... </ProbeSet>
    </Model>
</OpenSimDocument>


...

You win the competition by getting the center of the block onto your side of the arena at the end of a 1.0-second simulation. For this competition, start with a copy of the original Tug_of_War_Millard.osim model file. 

The design variables that you can modify to create your competitor are:

...

1.0-second simulation. For this competition, start with a copy of the original Tug_of_War_Millard.osim model file. 

The design variables that you can modify to create your competitor are:

  • Mathinline
    bodyF_{\mathrm{o}}^{\mathrm{M}}
     – Maximum isometric muscle fiber force

  • Mathinline
    body\ell_{\mathrm{o}}^{\mathrm{M}}
     – Optimal muscle fiber length

  • Mathinline
    body\ell_{\mathrm{s}}^{\mathrm{T}}
      – Tendon slack length

  • Mathinline
    body\alpha_{\mathrm{o}}^
      – Muscle fiber pennation angle at optimal fiber length

  • Mathinline
    bodyu(t)
      – Muscle excitation time history

  • Mathinline
    body\ell^{\mathrm{MMT}}
     – Maximum isometric muscle fiber forceTotal length of muscle–tendon actuator

  • Mathinline
    body\elltau_{\mathrm{oact}}^{\mathrm{M}}
     – Optimal muscle fiber lengthActivation time constant 

  • Mathinline
    body\elltau_{\mathrm{sdeact}}^{\mathrm{T}}
      – Tendon slack length
     – Deactivation time constant

  • Mathinline
    body\alpha_{\mathrm{o}}
      – Muscle fiber pennation angle at
    \tilde{v}_{\mathrm{max}}^{\,\mathrm{M}}
     – Maximum contraction velocity normalized by optimal fiber length

  • Mathinline
    bodyu(t)
      – Muscle excitation time history
    Mathinline
    body\ell^V^{\mathrm{MTM}}
     – Total length of muscle–tendon actuatorMuscle volume

  • Mathinline
    body\tautext{Z}_{\mathrm{actorigin}}
     – Activation time constant The Z-coordinate of the muscle's attachment point on the ground body

The muscle must obey the following physical relationships:

  • Mathinline
    body\tausigma_{\mathrm{deacto}}
     – Deactivation time constant
    Mathinline
    body\tilde{v}^{\mathrm{M}} = \frac{F_{\mathrm{maxo}}^{\,\mathrm{M}}}
     – Maximum contraction velocity normalized by optimal fiber length
    Mathinline
    bodyV^{A^{\mathrm{M}}}
     – Muscle volume
    Mathinline
    body= 35\,\text{ZN}_{/\mathrm{origin}}
     – The Z-coordinate of the muscle's attachment point on the ground body

...

  • text{cm}^2
     – The specific tension of the muscle at its maximum isometric force (from Zajac, 1989).

  • Mathinline
    body\sigma_V^{\mathrm{oM}} ^= A^{\mathrm{M}} = \frac{Fell_{\mathrm{o}}^{\mathrm{M}} }{A^{\mathrm{M}}} = 35\,\text{N}/\text{cm}^2
     – The specific tension of the muscle at its maximum isometric force (from Zajac, 1989).
    Mathinline
    bodyV^{\mathrm{M}} = A^{\mathrm{M}} \ell_{\mathrm{o}}^{\mathrm{M}}
     
      , where
    Mathinline
    body--uriencoded--A%5e%7B\mathrm%7BM%7D%7D
    is the cross-sectional area of the muscle,
    Mathinline
    body--uriencoded--\ell_%7B\mathrm%7Bo%7D%7D%5e%7B\mathrm%7BM%7D%7D
    is the optimal fiber length of the muscle, and
    Mathinline
    body--uriencoded--V%5e%7B\mathrm%7BM%7D%7D
    is the muscle volume.

  • Mathinline
    body\ell_{\mathrm{initial}}^{\mathrm{MT}} = \ell_{\mathrm{s}}^{\mathrm{T}} + \ell_{\mathrm{o}}^{\mathrm{M}}
    , where 
    Mathinline
    body\ell_{\mathrm{initial}}^{\mathrm{MT}}
     is the distance between the origin of the muscle (on the ground) and its attachment point (on the block) at the beginning of the simulation. Note that 
    Mathinline
    body\text{Z}_{\mathrm{origin}}
     must be set so this constraint is satisfied.

...