From bc0cd1b7807d3e22c72a4534f3cee11198e0e4f5 Mon Sep 17 00:00:00 2001
From: Tobias Klauser <tobias.klauser@uzh.ch>
Date: Sun, 21 Apr 2013 14:43:28 +0200
Subject: doc: Finish methods

---
 doc/methods.tex | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

(limited to 'doc/methods.tex')

diff --git a/doc/methods.tex b/doc/methods.tex
index 517138d..c29522d 100644
--- a/doc/methods.tex
+++ b/doc/methods.tex
@@ -30,6 +30,7 @@ In order to get familiar with modeling and controlling models in OpenSim, a simp
 \end{figure}
 
 \subsection{Two-legged Model}
+\label{subsec:two_legged_model}
 
 In the study by Dominici et al. \cite{Dominici2011} EMG activity of the following set of 12 muscles was recorded for each leg of the subject:
 
@@ -135,9 +136,9 @@ Vastus Intermedius & vas\_int & - & removed from model \\
 \end{longtable}
 \end{center}
 
-Because no data was available for the \emph{External Oblique (OE)} muscle -- one of the muscles which connects the torso to the pelvis -- the torso was removed from the model because otherwise only the back muscles, the \emph{Erector Spinae (ES)} would connect the torso to the pelvis, but would have no antagonist. Therefor OE and ES were removed for the final model, which then included 17 muscles for each leg. 
+Because no data was available for the \emph{External Oblique (OE)} muscle -- one of the muscles which connects the torso to the pelvis -- the torso was removed from the model because otherwise only the back muscles, the \emph{Erector Spinae (ES)} would connect the torso to the pelvis, but would have no antagonist. Therefor OE and ES were removed, resulting in a total of 16 muscles per leg (32 total) in the final version of the model. 
 
-The joints were left as in the original \emph{Gait2354 models}. For initial experiments the ``joint'' connecting the pelvis to the world was fixed in space.
+The joints were left as in the original \emph{Gait2354 models}. For initial experiments the ``joint'' connecting the pelvis to the world was fixed in space using the \emph{WeldJoint} joint type of OpenSim.
 
 Figure \ref{fig:screenshot_opensim_locomotorprimitives} shows the resulting musculoskeletal model.
 
@@ -171,14 +172,24 @@ The following parameters are used to characterize each Thelen-type muscle: maxim
 
 \subsection{Simple Leg Controller}
 
-The Simple Leg Controller was used in order to create a simulation using the Simple Leg model described in \ref{subsec:simple_leg_model} in order to get familiar with the OpenSim workflow.
+The \emph{Simple Leg Controller} was used in order to create a simulation using the Simple Leg model described in \ref{subsec:simple_leg_model} in order to get familiar with the OpenSim workflow.
 
 It implements a behavior similar to the stretch reflex (\emph{myotatic reflex}): An increase of muscle length causes the muscle spindles to be stretched, leading them to increase neural activity. This increases the activity of alpha motor neurons, which cause the muscle fibers to contract  in order to regain the original muscle length. Using a second set of neurons, the antagonist muscle is caused to relax \cite{Bear2007}.
 
 \subsection{Locomotor Primitives Controller}
 \label{subsec:locomotor_primitives_controller}
 
-\TODO{Describe ideas behind it}
+All the predefined controllers available with OpenSim require a specific set of input data typically resulting from biomechanics studies using EMG, tracker systems and force plates. Since such data was not available in the context of this project, a custom controller for the simulation of the musculoskeletal model was developed in order to account for the limited availability of data.
+
+The \emph{Locomotor Primitives Controller} allows to actuate the model described in section \ref{subsec:two_legged_model} using only the activation patterns for its 32 muscles (16 per leg). The data can be fed into the controller using the \emph{OpenSim Storage file format} (file extension \texttt{.sto}), which is the standard format to store and read data in OpenSim\footnote{The file format is explained in \url{http://simtk-confluence.stanford.edu:8080/display/OpenSim/Storage+(.sto)+Files}, but there are some subtleties to the be considered when generating \texttt{.sto} files outside of OpenSim. Thus looking at the implementation of the class \texttt{OpenSim::Storage} is suggested when generating \texttt{.sto} files using external scripts.}.
+
+All the activation data from the storage file are read into the controller and are accessible using the column name, which corresponds to the muscle name according to table \ref{table:muscles_correspondence} with the proper postfix. The controller checks the availability of activation data for all muscles for the entire simulation time and is then able to retrieve the corresponding activation for each muscle at each time step. 
+
+The time step resolution in OpenSim by default is dynamic and determined by the integrator used. For this project a Runge-Kutta integrator in the implementation of \texttt{SimTK::RungeKuttaMersonIntegrator} was used. This is the suggested default integrator in OpenSim.
+
+Since the time step is not constant when using this integration method, OpenSim allows to interpolate the data read from the storage file in order to provide activation values at all possible time steps during the simulation.
+
+For most of the muscles in the model, the \emph{Locomotor Primitives Controller} applies the activation value directly. For some special cases however (see column ``Activation Usage'' in table \ref{table:muscles_correspondence}), the muscle activation is split among a set of muscles, because they were measured in combination. Furthermore, the controller allows to scale the activation for each muscle individually by a constant value.
 
 \section{Data Preparation}
 
-- 
cgit v1.2.3-54-g00ecf

