## 8 Discussion  
The estimation of model parameters using the Trust Region Algorithm for Nonlinear Least Squares optimization method for the known structure of the planar kinematic system model derived based on Lagrange formalism was intended to improve the validation results. As mentioned above, the limits of the estimated parameters were set to \(\pm 30\%\) of the original value of each parameter (excluding friction). This value was set because deviations could occur within the parameters specified by the CAD software, e.g., the resulting weights can be skewed, as an element, such as a chain or muscles, is not included in the CAD. CAD, therefore, determined the parameters only based on the modeled construction. A summary and comparison of validation results before and after parameter estimation is given in Table 9 for link 1 and in Table 10 for link 2. It is clear from the indicators that the estimation of parameters significantly helped to achieve better model  
Figure 28: Model output after parameter estimation for the joint angle 40\({}^{\circ}\)—link 2. Figure 26: Model output after parameter estimation for the joint angle 20\({}^{\circ}\)—link 2. Figure 27: Model output after parameter estimation for the joint angle 30\({}^{\circ}\)—link 2.  
outputs in the process validation. If the indicators for link 1 are compared, the most significant improvement occurred at the initial joint angle 40\({}^{\circ}\), when the original output of the model reached MAE = 6.1717 and NRMSE = 16.69%, while after estimation, the output of the model was obtained at MAE = 1.1045 and NRMSE = 84.62%. For link 2, the results in the initial validation were even worse than for link 1. As mentioned above, the cause could be a more pronounced oscillation in this axis. Therefore, this fact was expected to play a role in the results even after optimization. However, it is clear from the results that the optimization within the parameter estimation helped the model so much that the outputs not only achieved much better results than before the estimation, but within the NRMSE indicator, they were also similar in value (stable) at different initial rotation angles. However, the most significant change after the determination occurred at an initial angle of 40\({}^{\circ}\) (taking into account the values of both indicators). Since the process of estimating the parameters took place simultaneously for both axis 1 and axis 2, from the results of the estimation, it was necessary to select the model that achieved the best results as a whole (not separately for axis 1 and axis 2). As already mentioned at the beginning of this chapter, the most significant progress in the results occurred at the initial angle of rotation of the joint of 40\({}^{\circ}\), so this model was chosen as the best. Figure 29 shows the time courses of the joint angle for both axes at the initial joint angle of 40\({}^{\circ}\) before the model optimization process. For both axes, you can see that the output model (blue solid curve) is different compared to the required mean response (red dashed curve). After optimizing the model, however, significant differences (improvements) for both axes can be seen in the model outputs in Figure 30. The output of the model no outrun the required output (this phenomenon was visible especially for axis 1 before estimation). The model also achieves the amplitude of the measured values much better (especially with axis 2 before estimation, this problem is visible). \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & \multicolumn{2}{c}{**Before**} & \multicolumn{2}{c}{**After**} \\ \hline
**Angle of Rotation** & **MAE** & **NRMSE** & **MAE** & **NRMSE** \\ \hline
10\({}^{\circ}\) & 0.5655 & 14.94\% & 0.2407 & 79.64\% \\
20\({}^{\circ}\) & 1.1078 & 16.36\% & 0.3401 & 82.82\% \\
30\({}^{\circ}\) & 1.7524 & 18.14\% & 0.5159 & 81.98\% \\
40\({}^{\circ}\) & 2.8270 & 16.88\% & 0.7207 & 82.69\% \\ \hline \hline \end{tabular}
\end{table} 
Table 10: Comparison of results validation before and after parameter estimation for link 2.