# Optimization Method of the Clamping Force for Large Cabin Parts
## 4 The Illustrative Example and Simulation
The principle of the penalty function algorithm is to define a penalty function outside the feasible domain and gradually approach the extreme point from the outside of the feasible domain. This method is suitable for optimization problems with equality constraints or inequality constraints. The principle of the Lagrange multiplier algorithm is to introduce the Lagrange multiplier and slack variable according to the KKT condition to combine the equality constraint, inequality constraint and objective function during optimization. The principle of the sequential quadratic programming algorithm is to simplify the nonlinear programming problem to a quadratic programming problem at the approximate solution of the objective function and find its optimal solution via quadratic programming. The principle of the genetic algorithm is to start from any initial population, generate a group of individuals more suitable for the environment via random selection, crossover and mutation operations and, finally, converge on a group of individuals most suitable for the environment to obtain the optimal solution to the problem. The application, calculation process and parameter settings of the above algorithms can be queried by analyzing and combining with the MATLAB 2018b help document [32]. In order to be expressed clearly, the calculated initial value vectors of each clamping mechanism are combined into a vector \(\mathbf{F}_{j}=[f_{1},f_{2},\ldots,f_{8}]^{\text{T}},j=1,\,2,\,3,\,4\); below, the \(\mathbf{F}_{\text{opt}}\) is combined in the same way. The numbering sequence of each clamping mechanism is the same as that in Figure 7. According to the penalty function algorithm, Lagrange multiplier algorithm, sequential quadratic programming algorithm and genetic algorithm, the initial value of the clamping force optimization is calculated successively. The initial value of the clamping force optimization \(\mathbf{F}_{j}\) obtained by calculation is shown in Table 1.  
According to Table 1, although differences exist in the initial optimized values of the clamping force calculated using the four algorithms, it can be known via verification that all four groups of the initial optimized values of the clamping force satisfy Equations (1) and (4), which means that the initial optimized values of the clamping force satisfy the unidirectional force constraint, friction cone constraint and the external force constraint. Then, the four groups of initial values are respectively applied to the gradient flow optimization method of the clamping force. The gradient flow optimization method of the clamping force is compiled using MATLAB 2018b. The relevant parameters required by the gradient flow optimization method are constantly adjusted. \(W_{\text{p}}\) and \(W_{\text{i}}\) are finally set as 2 and 0.1, respectively, and the convergence error is set as 0.001. The target function of the gradient flow optimization method and the changes in the normal contact force at the contact point between the surface of the clamping mechanism and the object are obtained, which are shown in Figures 8-11. Figure 7: The example model of 8 modular clamping mechanisms clamping the object: (**a**) The distribution of 8 clamping mechanisms; (**b**) simplified point contact model of the clamping mechanism and object’s surface. different optimizations are substituted into the gradient flow optimization method and the convergence values of the clamping force \(F_{\text{opt}j}\) are shown in Table 2.  
Figure 8: The iterative process of the gradient flow method in which the initial value is calculated using the penalty function algorithm: (**a**) Value of the target function; (**b**) normal contact force of the upper clamping mechanism; (**c**) normal contact force of the lower clamping mechanism.