## 4 Conclusions  
The objective of this work was to propose and to describe step by step the procedure to achieve a general multibody approach able to solve the inverse dynamics problem of a musculoskeletal system, the upper limb, implemented in a novel code developed in the Matlab environment. By knowledge of the musculoskeletal system degrees of freedom together with the system's topology, the model allows a kinematical analysis based on the evaluation of the constraints' kinematical behaviour. Subsequently, associating an actuator for each degree of freedom and including the external forces, the inverse dynamics is solved by calculating the rheonomic Lagrange multipliers, related to the driving actions that lead the system to move following the known kinematics. The knowledge of the muscles' topology leads the kinematical analysis to evaluate the muscle paths between the bodies and around the wrapping surfaces fixed to the bodies: in the case of wrapped muscle, an algorithm based on the calculus of geodesic curves is used. The muscle paths are involved in the elaboration of the muscles' lengths, deformation velocities and pennation angles, in order to include in the equation of motion, through the Hill muscle model, the muscles' passive forces and the muscles' activations. The last step of the model is to analyse the muscular recruitment through static optimization: the evaluation of the set of muscles' activation levels and joint reaction forces, able to minimize the global activation and to satisfy the equation of motion. Figure 20: Upper limb joint reactions: (**a**) shoulder forces, and (**b**) torques, (**c**) elbow forces and (**d**) torques. The effectiveness of the model was examined by its application on an upper limb model subjected to a simple kinematics and to gravity forces. All the inputs data were taken from the OpenSim software and the simulation results were compared with the ones provided by the software, obtaining a general satisfactory qualitative and quantitative matching:  
* despite the kinematical analysis, exactness is noticeable, the only difference found was a small overestimation of the long biceps muscle fibre length, probably due to the different wrapping algorithm used by OpenSim;
* the inverse dynamics in terms of driving force results were almost completely matched;
* the static optimization was characterised by a general underestimation of the muscles' activations in all the cases considered (both physiological and non-physiological criterion in absence of passive muscles' forces and physiological criterion considering the passive muscle actions compared with the Computed Muscle Control tool of OpenSim). The underestimation was regained by comparing the muscle forces, the differences were probably due to the different approaches in the minimization techniques and, certainly, to the different approach to the inverse dynamics of the Computed Muscle Control;
* the good outcome of the comparison was also confirmed by the matching of the residual actuators. In summary, with the limitation of its validation with only one imposed upper limb kinematics, the model resulted as a suitable, open and fully controllable tool in the framework of the multibody musculoskeletal dynamics of the human upper limb. However, despite the model being characterised by the accurate analytical description of important muscular phenomena (muscle dynamics, recruitment and wrapping), it has to process more complex kinematics in order to perform a more accurate validation and to design a fully in silico optimization model of the artificial human joints.