# On a Nonsmooth Gauss-Newton Algorithms for Solving Nonlinear Complementarity Problems
## 3 Numerical Results  
In this section, we present results of our numerical experiments, obtained by coding both algorithms in Code:Blocks. We use double precision on an Intel Core i7 3.2 GHz running under the Windows Server 2016 operating system. We applied the generalized damped Gauss-Newton method to solve three nonlinear complementarity problems. In the following examples: \(N_{1}\) and \(N_{2}\) denote the number of performed iterations to satisfy the stopping criterion \(\left|\mathbf{x}^{(k+1)}-\mathbf{x}^{(k)}\right|<10^{-7}\), using Algorithms 1 and 2, respectively. The forcing terms in Algorithm 2 were chosen as follows: \(\eta_{k}=(10k)^{-1}\) for all \(k\). **Example 1** (from [PERSON] and [PERSON] [20]). : _Let the function \(F:R^{4}\to R^{4}\) have the form_  
\[F^{1}(\mathbf{x}) = 3x_{1}^{2}+2x_{1}x_{2}+2x_{2}^{2}+x_{3}+3x_{4}-6,\] \[F^{2}(\mathbf{x}) = 2x_{1}^{2}+x_{1}+x_{2}^{2}+10x_{3}+2x_{4}-2,\] \[F^{3}(\mathbf{x}) = 3x_{1}^{2}+x_{1}x_{2}+2x_{2}^{2}+2x_{3}+9x_{4}-9,\] \[F^{4}(\mathbf{x}) = x_{1}^{2}+3x_{2}^{2}+2x_{3}+3x_{4}-3.\]Problem (NCP) with the above function \(F\) has two solutions: \[\mathbf{x}^{*}=(1,0,3,0)^{T}\text{ and }\mathbf{x}^{**}=(\sqrt{6}/2,0,0,0.5)^{T}\] for which \[F(\mathbf{x}^{*})=(0,31,0,4)^{T}\text{ and }F(\mathbf{x}^{**})=\left(0,2+\frac{ \sqrt{6}}{2},0,0\right)^{T}.\] Thus, \(\mathbf{x}^{*}\) is a non-degenerate solution of (NCP) because \[\text{L}:=\left\{i:x_{i}^{*}=0,\ F^{i}(\mathbf{x}^{*})=0\right\}=\emptyset,\] but \(\mathbf{x}^{**}\) is a degenerate solution. Depending upon the starting point, we obtained the convergence iteration process to both solutions (see Table 1 or Figure 1). **Example 2**. : _Let function \(F:R^{2}\to R^{2}\) be defined as follows:_  
\[F(\mathbf{x})=\left[ \begin{array}{c}2x_{1}+x_{2}^{2}-6\\ -x_{1}^{2}+4x_{1}+\frac{1}{2}x_{2}-3\end{array} \right].\] \begin{table}
\begin{tabular}{l c c c} \hline \(\mathbf{x}^{(0)}\) & \(\mathbf{N_{1}}\) & \(\mathbf{N_{2}}\) & **Solution** \\ \hline \((1,0,0,0)^{T}\) & 9 & 11 & \(\mathbf{x}^{**}\) \\ \((0,0,1,0)^{T}\) & failed & 18 & \(\mathbf{x}^{**}\) \\ \((0,0,0,1)^{T}\) & failed & failed & - \\ \((1,0,1,0)^{T}\) & 7 & 10 & \(\mathbf{x}^{*}\) \\ \((1,0,0,1)^{T}\) & 7 & 9 & \(\mathbf{x}^{**}\) \\ \((1,0,1,-5)^{T}\) & 6 & 8 & \(\mathbf{x}^{**}\) \\ \hline \end{tabular}
\end{table} 
Table 1: Results for Example 1. Figure 1: Number of iterations for various starting points (for Example 1). _Then, problem (NCP) has two solutions:_  
* _non-degenerate_ \[\mathbf{x}^{*}=(0,6)^{T}\text{ for which }F(\mathbf{x}^{*})=(30,0)^{T}\]
* _degenerate_ \[\mathbf{x}^{**}=(3,0)^{T}\text{ for which }F(\mathbf{x}^{**})=(0,0)^{T}.\]  
_Similar to Example 1, we obtained the convergence iteration process for both solutions, depending on the starting point (see Table 2 or Figure 2)._  
**Example 3** (from [PERSON] and [PERSON] [21]). : _Let function \(F:R^{n}\to R^{n}\) has the form \(F(\mathbf{x})=\mathbf{M}\mathbf{x}+\mathbf{q}\), where_  
\[\mathbf{M}=\left[ \begin{array}{cccccc}4&-1&0&...&0&0\\ -1&4&-1&...&0&0\\ 0&-1&4&...&0&0\\...&...&...&...&...&...\\ 0&0&0&...&4&-1\\ 0&0&0&...&-1&4\end{array} \right],\ \mathbf{q}=\left(-1,...,-1\right)^{T}.\]  
_Because \(F\) is strictly monotonic, the proper problem (NCP) has exactly one solution._  
_Calculations have been made for various \(n\) with one starting point \(\mathbf{x}^{(0)}=(0,...,0)^{T}\). For all tests, we obtain the same number of iterations \(N_{1}=3\) and \(N_{2}=4\)._ \begin{table}
\begin{tabular}{l c c c} \hline \hline \(\mathbf{x}^{(0)}\) & \(\mathbf{N_{1}}\) & \(\mathbf{N_{2}}\) & **Solution** \\ \hline \((0,0)^{T}\) & 5 & 7 & \(\mathbf{x}^{*}\) \\ \((1,0)^{T}\) & 1 & 2 & \(\mathbf{x}^{**}\) \\ \((0,1)^{T}\) & 4 & 7 & \(\mathbf{x}^{*}\) \\ \((1,-1)^{T}\) & 2 & 4 & \(\mathbf{x}^{**}\) \\ \((-1,1)^{T}\) & 4 & 7 & \(\mathbf{x}^{**}\) \\ \((5,5)^{T}\) & 3 & 5 & \(\mathbf{x}^{*}\) \\ \((100,100)^{T}\) & 3 & 6 & \(\mathbf{x}^{*}\) \\ \hline \hline \end{tabular},  
\end{table} 
Table 2: Results for Example 2.