# Gait Phase Identification and Damping Control for Knee Orthosis Using Time Series Forest Classifier
## 2 Musculoskeletal Simulation  
OpenSim 4.4 (SimTK: National Institutes of Health (NIH), Bethesda, MD, USA) is an open-source software developed at Stanford University for musculoskeletal simulation and biomechanical modeling. It enables the creation of detailed models to study human movement and assess joint movements, muscle forces, and energy consumption during activities. It is widely used in biomedical engineering and biomechanics, offering valuable insights into the effects of injuries, diseases, surgical interventions, and the design of prosthetics or therapeutic interventions [11]. The objective of the simulation is to perform inverse kinematics to obtain joint angles. With the results, inverse dynamics is performed to obtain joint reaction forces and moments. The simulation utilizes existing motion capture data for inverse kinematics, which is then combined with ground reaction force data sourced online and associated with a generic model. The objective is to obtain a normalized and scaled knee moment for one gait cycle, without requiring any experimental data input other than scaling the model to match the subject's specific anthropometry (physical dimensions), and the inertial parameters of the model are given in Table 1[12]. The simulation involves performing inverse kinematics on a scaled model of the subject's musculoskeletal system. The output knee flexion is shown in Figure 1; it was corrected for gait phase alignment and is scaled for one complete gait cycle. The process of inverse dynamic simulation encompasses 76 frames, which are captured using motion capture techniques. In this process, force data associated with the leg-mounted force plates, as shown in Figure 2, are obtained from the repository. These force plates provide measurements of forces in the X\({}^{\prime}\), Y\({}^{\prime}\), and Z\({}^{\prime}\) directions, corresponding to the frontal, transverse, and sagittal planes, respectively [13]. These techniques capture the subject's movements by strategically placing markers on their body to trace a complete gait cycle. To establish alignment between the knee flexion pattern simulated during the gait and the designated zero state (representing heel strike Figure 3c), a phase shift is implemented. The alignment process is shown in Figure 3 for synchronization between the simulated knee flexion and the defined starting state. The objective of inverse dynamics is the determination of the forces and moments responsible for a particular motion, thereby elucidating the muscular contributions underlying said motion. The attainment of these forces and \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Body Segment**} & \multirow{2}{*}{**Mass (kg)**} & \multicolumn{3}{c}{**Moments of Inertia**} \\ \cline{3-5}  & & **XX** & **YY** & **ZZ** \\ \hline Torso & 34.2366 & 1.4745 & 0.7555 & 1.4314 \\ Pelvis & 11.777 & 0.1028 & 0.0871 & 0.0579 \\ Right femur & 9.3014 & 0.1339 & 0.0351 & 0.1412 \\ Right tibia & 3.7075 & 0.0504 & 0.0051 & 0.0511 \\ Right patella & 0.0862 & 0.0000287 & 0.0001311 & 0.0001311 \\ Right talus & 0.1 & 0.001 & 0.001 & 0.001 \\ Right calcaneus & 1.25 & 0.0014 & 0.0039 & 0.0041 \\ Right toe & 0.2166 & 0.0001 & 0.0002 & 0.001 \\ Left femur & 9.3014 & 0.1339 & 0.0351 & 0.1412 \\ Left tibia & 3.7075 & 0.0504 & 0.0051 & 0.0511 \\ Left patella & 0.0862 & 0.0000287 & 0.0001311 & 0.00001311 \\ Left talus & 0.1 & 0.001 & 0.001 & 0.001 \\ Left calcaneus & 1.25 & 0.0014 & 0.0039 & 0.0041 \\ Left toe & 0.2166 & 0.0001 & 0.0002 & 0.001 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Model inertial parameters [12]. Figure 1: Simulated knee flexion of both legs. moments involves a methodical iterative solution of the system's equations of motion. These equations of motion encompass a comprehensive consideration of the kinematic characteristics and mass attributes inherent in a model of the musculoskeletal system.