## 2 Materials and Methods
### Synthesis Problem
#### 2.3.1 Formulation of the Problem  
The optimization problem can be established as the minimization of the error function \(E(F)\), which is the sum of the square distance between the _ith_ recorded position (\(R_{x_{iN}}\), \(R_{z_{iN}}\)) and the coordinates of point D of the mechanism (\(D_{x_{iN}}\), \(D_{z_{iN}}\)). The error function is expressed by Equation (12). This point corresponds to the end-effector of the slider-crank mechanism. Equation (13) defines the design vector \(F\), which contains the set of variables that should be computed during the optimization procedure.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Finger** & **Subject 1 \(\gamma_{max}\)** & **Subject 2 \(\gamma_{max}\)** & **Subject 3 \(\gamma_{max}\)** & **Subject 4 \(\gamma_{max}\)** & **Subject 5 \(\gamma_{max}\)** & **Subject 6 \(\gamma_{max}\)** \\ \hline Index & 119\({}^{\circ}\) & 104\({}^{\circ}\) & 101\({}^{\circ}\) & 92\({}^{\circ}\) & 116\({}^{\circ}\) & 104\({}^{\circ}\) \\ Middle & 106\({}^{\circ}\) & 117\({}^{\circ}\) & 120\({}^{\circ}\) & 92\({}^{\circ}\) & 122\({}^{\circ}\) & 130\({}^{\circ}\) \\ Ring & 110\({}^{\circ}\) & 108\({}^{\circ}\) & 119\({}^{\circ}\) & 95\({}^{\circ}\) & 113\({}^{\circ}\) & 119\({}^{\circ}\) \\ Small & 76\({}^{\circ}\) & 105\({}^{\circ}\) & 109\({}^{\circ}\) & 89\({}^{\circ}\) & 92\({}^{\circ}\) & 116\({}^{\circ}\) \\ \hline \hline \end{tabular}
\end{table}
Table 4: The angle (\({}^{\circ}\)) of movement of every finger among the subjects.  
Figure 15: (a) Real finger trajectory and the trajectory of the end-effector prototype. (b) The quadratic error between trajectories.  
\(f_{m}\) represents the individual in the genetic algorithm; \(H_{f}\) defines the lower and upper boundaries for each of the design variables; and \(g_{m1}\) and \(g_{m2}\) are constraints applied to the mechanism.  
\[E(F)\ =\ \frac{1}{N}\ \sum_{i=1}^{N}\sqrt{\left(D_{x_{i}}-R_{x_{i}}\right)^{2}+ \left(D_{z_{i}}-R_{z_{i}}\right)^{2}}. \tag{12}\]  
The optimization synthesis problem was formulated as follows with \(m=10\) parameters for a chosen objective function \(E(F)\):  
\[\text{Minimize}\ E(F),\]  
Subject to:  
\[F=\ [f_{1},\ldots,f_{m}],\,\text{m}=10,\,f_{m}\,\,\epsilon\ H_{f}=\ \left[f_{m}^{\ min},f_{m}^{\ max}\right]g_{m1}(F)\leq 1,g_{m2}(F)\leq 1, \tag{13}\]  
where \(H_{f}=\left[f_{m}^{\ min},f_{m}^{\ max}\right]\) is the bounding interval for each parameter of vector \(F\). The parameters of vector \(F\) are defined in Table 5; most of the parameters are defined in the kinematic section. The variables \(x_{t}\) and \(y_{t}\) represent an offset applied to the real trajectory to relocate it to the same work area of the existing mechanism, allowing for a comparison of both trajectories.  
The kinematic model of the slider-crank mechanism was defined by Equations (1)-(7) in previous sections. Equation (14) defines the inequality constraints to guarantee a feasible solution of the optimization problem and comes from the closed-loop equations. The constraints \(g_{m1}\) and \(g_{m2}\) are defined in the following formulation:  
\[g_{m1}=\ \left|\frac{a^{2}-c^{2}-b^{2}}{-2 bc}\right|\ \leq 1,g_{m2}=\ \left|\frac{b^{2}-c^{2}-a^{2}}{-2 ac}\right|\ \leq 1. \tag{14}\]