## 5 Numerical Examples
### Example 8  
In this example, we consider Equation (2) with a cyclic matrix, whose first row is given by \((1,\dots,n)\). The coefficient matrix can be generated by the following procedure:  
\[\mathrm{Do}\ i=1:n,\] \[\mathrm{Do}\ j=1:n,\] \[\mathrm{If}\ i=1,\ \mathrm{then}\ B_{i,j}=j;\ \mathrm{otherwise},\] \[B_{i,j}=B_{i-1,j}+1,\] \[\mathrm{If}\ B_{i,j}>n,\ \mathrm{then}\ B_{i,j}=B_{i,j}-n,\] \[\mathrm{Enddo}. \tag{145}\]  
The exact solution is \(x_{i}=1,\ i=1,\dots,n\). The non-square matrix \(\mathbf{A}\) is obtained by taking the first \(q\) rows from \(\mathbf{B}\). Since the right-hand side vector \(\mathbf{b}\) is obtained from Equation (2) after inserting \(\mathbf{A}\) and \(\mathbf{x}=\mathbf{1}=(1,\dots,1)^{\mathrm{T}}\), the non-square system is consistent. Therefore, we can compute the maximal error (ME) by  
\[\mathrm{ME}:=\max_{i=1,\dots,n}|x_{i}^{c}-x_{i}^{n}|,\]  
where \(x_{i}^{c}=1,\ i=1,\dots,n\) are the exact solutions and \(x_{i}^{n}\) are numerical solutions. For a large matrix of \(\mathbf{A}\) with \(n=2000\) and \(q=100\), Table 7 lists the computed ME for different values of \(m\) and the INs under \(\varepsilon=10^{-5}\) with the initial guesses \(x_{i}^{0}=1+0.1i,\ i=1,\dots,n\). If we take the initial guesses to be \(x_{i}^{n}=0,\ i=1,\dots,n\), the accuracy is poor with ME = 0.961 and the convergence is very slow. As shown in Corollary 6, for the zero initial value, we have \(\mathbf{r}_{0}=\mathbf{b}\) and for the cyclic matrix, we have \(\mathbf{r}_{0}=\mathbf{b}=c\mathbf{1}\), where \(c_{1}=\sum_{j=1}^{n}j\). Thus, \(\mathbf{A}^{\mathrm{T}}\mathbf{A}\mathbf{r}_{0}=c_{0}^{2}c_{2}\mathbf{r}_{0}\), where \(c_{2}=\sum_{j=1}^{q}j\). Hence, \(c_{0}=2001000^{2}\times 5050\) is a huge value, \begin{table}
\begin{tabular}{c c c c c c} \hline \((n,q)\) & (100,80) & (100,90) & (100,110) & (100,120) & (100,150) \\ \hline ME & \(1.88\times 10^{-8}\) & \(7.25\times 10^{-9}\) & \(7.67\times 10^{-8}\) & \(2.13\times 10^{-8}\) & \(4.45\times 10^{-8}\) \\ \hline \end{tabular}
\end{table} 
Table 6: For the MFS on the 2D Laplace equation, ME with different \((n,q)\) obtained by the DOA. which causes the failure of the DOA with a zero initial value for this problem. The same situation happens for the constant initial guesses \(x_{i}^{0}=c,\ i=1,\ldots,n\). It is apparent that the DOA is quite accurate and converges faster. It is interesting that a small \(m\) is enough to achieve accurate solutions; when \(m\) is smaller, the accuracy is better, but it converges slower. In contrast, when \(m\) is larger, the accuracy is worse but it converges faster. Next, we construct a large-sized matrix \(\mathbf{B}\) from Equation (145) with \(n\) replaced by \(n_{q}\). The non-square matrix \(\mathbf{A}\) is obtained by taking the first \(n\) columns from \(\mathbf{B}\). With \(n=500\) and \(q=2000\), Table 8 lists the computed ME for different values of \(m\), and IN under \(\varepsilon=10^{-5}\) with the initial guesses \(x_{i}^{0}=1+0.1i,\ i=1,\ldots,n\). It is apparent that the DOA is quite accurate and converges faster. When \(m\) is increased, the accuracy is better and convergence is faster. As mentioned, the QR is not applicable to the least-squares problem with \(q<n\); however, for \(q>n\), the QR is applicable. Table 9 lists the computed ME for different values of \((q,n)\). In the DOA, we take \(m=30\), \(\varepsilon=10^{-12}\), and \(x_{i}^{0}=1+0.1i,\ i=1,\ldots,n\). The DOA converges within 25 iterations for the first four cases, and 79 iterations for the last case. The DOA can improve the accuracy by about three and four orders compared to the QR. We also list the error \(\|\mathbf{Q}^{\mathrm{T}}\mathbf{Q}-\mathbf{I}_{n}\|\) for the QR method, which is very accurate. If we take \(\alpha_{0}=1\) in Equation (21), \(\mathcal{K}_{m}^{\prime}\) reduces to the usual affine Krylov subspace \(\mathbf{u}_{0}+\mathcal{K}_{m}\).