## 3 The Kane's Method and Autolev
### Unilateral Constraints and Collision  
As a consequence of switching between different non-holonomic models during gait, unilateral constraints and collisions cannot be ignored. Clearly, adopting non-holonomic dynamics assuming points of the feet fixed to the ground is valid for bilateral constraints (ignoring eventual detachment from the ground and slipping). In the approaches known as hybrid complementarity dynamical systems based on forward dynamics [22] the necessary conditions for satisfying unilateral constraints are directly embedded into the model. Vice versa, a minimalistic view is adopted here, noting that in a physiological gait, normally, bilateral constraints on the feet are not assumed to be violated. Hence, we design a priori walking strategies and we test through the simulator that this effectively occurs, by monitoring, a posteriori, reaction forces for the conditions:  
\[F_{z_{fou_{i}}}>0,i=1,2 \tag{9}\]  
and  
\[|F_{j_{fou_{i}}}|<\mu F_{z_{fou_{i}}},j=x,y,i=1,2. \tag{10}\]  
Obviously, the control we propose cannot adapt itself to pathological conditions, such as a slipping surface. For the second point, mechanics of the collision of the swing foot to the ground has to be considered, when switching to the next step causes the transfer of final conditions of the generalized speeds of one phase to the initial conditions of the successive. With reasonable assumptions of non-slipping and anelastic restitution the reaction impulsive force \(\mathbf{F}^{B}\) at the impact point \(B\) and the initial conditions of the generalized speeds for the new phase \(\mathbf{u}(t^{+})\) can be computed. Also for this aspect, Autolev offers all needed mechanical expressions. The following analysis is based on two concepts: _generalized impulse_ and _generalized momentum_[6; 23]. Indicate, as usual, with \(\mathbf{v}_{r}^{B}\) the r-th component of the partial velocity vectors of the point \(B\) (the swing foot), the _generalized impulse_ at the point \(B\) at the contact with the ground at instant \(t^{-}\) is defined as the scalar product of the integral of the reaction impulsive force \(\mathbf{F}^{B}\delta(t-\tau)\) in the time interval \(t^{-}\div t^{+}\) with the corresponding partial velocities  
\[I_{r}\approx\mathbf{v}_{r}^{B}(t^{-})^{T}\cdot\mathbf{F}^{B},r=1,\cdots,n, \tag{11}\]  
the _generalized momentum_ is defined as the partial derivative of the kinetic energy \(K\) with respect to the r-th generalized speed  
\[p_{r}(t)=\partial K/\partial u_{r},r=1,\cdots,n, \tag{12}\]  
then, [PERSON] proves that  
\[I_{r}\approx p_{r}(t^{+})-p_{r}(t^{-}). \tag{13}\]  
Indicate the matrices  
\[\mathbf{V}^{B}=(\mathbf{v}_{1}^{B}(t^{-})\cdots\mathbf{v}_{n}^{B}(t^{-})) \tag{14}\]\[\mathbf{P}=\{\partial p_{i}(t^{-})/\partial u_{j}\},i,j=1,\cdots,n \tag{15}\]  
of vectors of partial velocities, and of partial derivatives of \(p_{r}(t)\) with respect to the generalized speeds, and the vectors  
\[\mathbf{I}=[I_{1}\cdots I_{n}]^{T}=\mathbf{V}^{B}{}^{T}\cdot\mathbf{F}^{B} \tag{16}\]  
\[\mathbf{u}(t)=[u_{1}(t)\cdots u_{n}(t)]^{T} \tag{17}\]  
\[\mathbf{v}^{B}(t)=\mathbf{V}^{B}\cdot\mathbf{u}(t) \tag{18}\]  
\[|F_{j_{fou_{i}}}|<\mu F_{z_{fou_{i}}},j=x,y,i=1,2. \tag{10}\]0  
of _generalized impulses_, of _generalized speeds_, of the velocity of point \(B\) and of _generalized momenta_, respectively. Then, taking into account from (16) to (19), considering that \(\mathbf{v}^{B}(t^{-})\) is known and \(\mathbf{v}^{B}(t^{+})\) is zero, assuming non-slipping condition and inelastic collision, the following system of equations is solved to derive the unknown \(\mathbf{F}^{B}\) and \(\mathbf{u}(t^{+})\):  
\[ \begin{bmatrix}-\mathbf{Pu}(t^{-})\\ 0\end{bmatrix} = \begin{bmatrix}\mathbf{V}^{B}(t)^{T}&-\mathbf{P}\\ 0&\mathbf{V}^{B}(t)\end{bmatrix} \cdot \begin{bmatrix}\mathbf{F}^{B}\\ \mathbf{u}(t^{+})\end{bmatrix}  \tag{20}\]  
An essentially similar equation was discussed in [11].