# Two-Dimensional Mechanical Model of Human Stability in External Force-Caused Fall
## 5 Data Preparation  
Knowing the current coordinates of the passive markers, one can determine the values of the angles \(\varphi_{i}\). The local horizontal axes, from which the directed angles are measured, are depicted in Figures 4-7. Except for the feet and hands, they pass through one of the joints belonging to the given body segment. The auxiliary horizontal axes that are needed to define the angles for hands and feet pass through the appropriate mass centre. Let the points through which all the auxiliary horizontal axes pass be the origins of the local coordinate systems. Denoting by \(Y_{i}\) and \(Z_{i}\) the coordinates of the opposite joint within the given local system, we can determine the directed angle \(\varphi_{i}\) employing the following formulas:  
\[\varphi_{i}=\left\{\begin{aligned} & for\;Z_{i}\geq 0:\;\;\left\{ \begin{aligned} & for\;Y_{i}\geq 0:\;\;2\text{atan}\left(\frac{Y_{i}}{Z_{i}+ \sqrt{Z_{i}^{2}+Y_{i}^{2}}}\right)\\ & dla\;Y_{i}<0:\;\;2\pi+2\text{atan}\left(\frac{Y_{i}}{Z_{i}+\sqrt{ Z_{i}^{2}+Y_{i}^{2}}}\right)\\ & for\;Z_{i}<0:\;\;\;\;\;\;\;\;\;\;\;\;\;\pi-2\text{atan}\left( \frac{Y_{i}}{-Z_{i}+\sqrt{Z_{i}^{2}+Y_{i}^{2}}}\right).\end{aligned} \right.\right. \tag{13}\]  
The Cartesian coordinates \(y_{i},\;z_{i}\) of the centres of mass are calculated based on the coordinates of the markers with the use of Dempster's data. The linear and angular accelerations are not measured directly in the experiment. It is, therefore, necessary to determine all the acceleration approximately based on the calculated values of the Cartesian coordinates \(y_{i},\;z_{i}\) and directed angles \(\varphi_{i}\). These quantities are affected by measurement error and random disturbances, including marker displacements caused by breathing movements and cameras' stand vibrations. To smooth the raw data and determine the derivatives needed, we applied a variant of function approximation. The method enables the simultaneous approximation of a function and its first and second derivatives. Let \(f(t)\) be any real-valued function of one variable that is smooth together with its derivatives of the first and second orders. Only approximate values of the function are known at points that are uniformly distributed over the interval \([a,b]\). Let \([t_{k-N},\;t_{k+N}]\subset[a,b]\) be a subinterval with a centre at point \(t_{k}\), where \(N\) is an integer number. We approximate the function \(f(t)\) on the subinterval \([t_{k-N},\;t_{k+N}]\) by the polynomial of the form  
\[w(t,t_{k})=A_{0}^{k}+A_{1}^{k}(t-t_{k})+\frac{1}{2}A_{2}^{k}(t-t_{k})^{2}, \tag{14}\]  
where \(A_{0}^{k},\;A_{1}^{k},\;A_{2}^{k}\) are unknown coefficients. Calculating the first and second derivatives of the polynomial \(w(t,t_{k})\), we obtain:  
\[w(t,t_{k})=A_{1}^{k}+A_{2}^{k}(t-t_{k}), \tag{15}\]  
\[w^{\prime\prime}(t,t_{k})=A_{2}^{k}. \tag{16}\]  
When the argument \(t\) takes the value \(t_{k}\), then  
\[w(t_{k},t_{k})=A_{0}^{k},\;w^{\prime}(t_{k},t_{k})=A_{1}^{k},\;w^{\prime\prime }(t_{k},t_{k})=A_{2}^{k}. \tag{17}\]  
From relationship (17) results that the unknown coefficients depict the estimated values of the function \(f\) and its both derivatives at the middle point of the subinterval \([t_{k-N},\;t_{k+N}]\), i.e.,  
\[f(t_{k})\approx A_{0}^{k},\;f^{\prime}(t_{k})\approx A_{1}^{k},\;f^{\prime \prime}(t_{k})\approx A_{2}^{k}. \tag{18}\]We define the following functional:  
\[B=\sum_{j=k-N}^{j=k+N}(f_{j}-w\big{(}t_{j},t_{k}\big{)})^{2}, \tag{19}\]  
where \(f_{j}=f\big{(}t_{j}\big{)},\ j=k-N,\ \ldots,k+N\), are the measured values of the function \(f\). The functional \(B\) depicts the total absolute squared error of the function approximation on the subinterval \([t_{k-N},\ t_{k+N}]\).