\chapter{Results}
\label{ch:results}

\section{Reflexes in Simple Leg Model}

The simulation of the \emph{Simple Leg Model} led to the expected stretch reflex behavior. Given an initial 
activation of the \emph{Rectus Femoris}, the \emph{Biceps Femoris} was caused to shorten proportional to the 
speed of the shortening of the \emph{Rectus Femoris}. Since this will again cause \emph{Rectus Femoris} to be 
shortened, the reflex is triggered in the other direction. For initial tests, the knee joint in the model was 
fixed in all but one degree of freedom (pin joint) in order to permit flexion and tension. Unfortunately this 
didn't lead to a realistic behavior with respect to the movement of the lower leg, as the knee joint remained 
fixed during the entire simulation (see figure \ref{fig:simpleleg_sequence} for a sequence of two stretch 
cycles). However since this simulation served as a test of the principal methods and the results were 
satisfying enough, this problem was not further investigated.

\begin{figure}[htb!]
\centering
\includegraphics[width=\textwidth]{images/simple_leg_sequence.png}
\caption{Sequence of the \emph{SimpleLeg} model during simulation of two cycles of the stretch reflex.}
\label{fig:simpleleg_sequence}
\end{figure}

\section{Random Data in Two-Legged Model}

In order to validate the principal working of the two-legged musculoskeletal model (see section 
\ref{subsec:two_legged_model}) and to test the corresponding controller (see section 
\ref{subsec:locomotor_primitives_controller}), random data resembling muscle activation patterns was generated 
for all the 32 muscles of the model. In the initial version, the data contained discontinuities and the 
activation values were generally too high. As a consequence, the simulation of the model took very long or in 
some situations didn't complete at all.

Thus the script used to generate the data was adjusted in order to smoothen the data and provide smaller 
activation values. With this second set of data, the simulation succeeded, but of course showed unrealistic 
behavior. Since the simulation now completed with any type of generated pattern, the model and controller were 
considered ready for usage with the real data.

\section{Locomotor Primitive Patterns in Two-Legged Model}

Only results for an adult subject was obtained using the locomotor primitive patterns (rightmost two columns in figure \ref{fig:dominici_patterns_graphs}). The simulation was run for $1.5$, $2.0$, $2.5$ and $3.0$ seconds respectively. The locomotor patterns were scaled to the according timespan. The visualization of a part of the simulation run is shown in figure \ref{fig:locomotor_primitives_sequence}.

It can be seen from the sequence that the muscle activations lead to an unrealistic movement of the legs (knees 
bending backwards, twisting of the feet). Part of the effect can be attributed to the improper scaling of the 
muscle activations. Thus different scalings factors were tried ($0.25$, $0.33$, $0.5$, $0.66$ and $0.75$) but 
with all of them the basic improper movement pattern remained.

\begin{figure}[htb!]
\centering
\includegraphics[width=\textwidth]{images/locomotor_primitives_sequence.png}
\caption{Sequence of the two-legged \emph{LocomotorPrimitives} model. Only the first $1.2$ seconds are 
         visualized. Total duration of simulation: $3.0$ seconds.}
\label{fig:locomotor_primitives_sequence}
\end{figure}

When looking at the exerted muscle forces for a simulation run with the muscle activations scaled by $0.25$  
(figure \ref{fig:locomotor_primitives_reported_forces}), the activations are only partially reflected. For the 
\emph{Biceps Femoris-Long Head} and the \emph{Semimembranosus} (which are both part of the hamstring muscle 
group, see section \ref{subsec:two_legged_model}) the reported forces match the muscle activation patterns (see 
figure \ref{fig:dominici_patterns_graphs}) quite closely, while in the case of the \emph{Soleus} and the 
\emph{Rectus Femoris}, the patterns don't directly reflect the activations. Overall the exerted forces don't 
show unrealistically high values.

\begin{figure}[htb!]
\centering
\includegraphics[width=\textwidth]{images/locomotor_primitives_reported_forces.png}
\caption{Muscle forces exerted on the model during simulation for the muscles \emph{Soleus (soleus)}, 
         \emph{Rectus Femoris (rect\_fem)}, \emph{Semimembranosus (semimem)} and \emph{Biceps Femoris-Long Head 
         (bifemlh)} in both legs. X-axis is time from $0.0$--$3.0$ seconds, Y-axis is force in $N$.}
\label{fig:locomotor_primitives_reported_forces}
\end{figure}