Aspherical surface profile fitting based on the relationship between polynomial and inner products

Abstract. High-precision aspherical polynomial fitting is essential to image quality evaluation in optical design and optimization. However, conventional fitting methods cannot reach optimal fitting precision and may somehow induce numerical ill-conditioning, such as excessively high coefficients. For this reason, a projection from polynomial equations to vector space was here proposed such that polynomial solutions could be obtained based on matrix and vector operation, so avoiding the problem of excessive coefficients. The Newton–Raphson iteration method was used to search for optimal fitting of the spherical surface. The profile fitting test showed that the proposed approach was able to obtain results with high precision and small value, which solved the numerical ill-conditioning phenomenon effectively.


Introduction
With the rapid development of optical design and manufacturing technology, aspherical profiles have seen extensive use because of their lower rate of aberrations relative to spherical profiles. [1][2][3][4] Improving the precision of fitting projects would facilitate the evaluation of image quality in optical design and optimization significantly. This is commonly done by increasing the number of samples or using highorder polynomials. Currently, there are a number of articles that discuss improving the precision of polynomial fitting. Because increasing the number of samples beyond a certain point will not markedly improve fitting precision, 5 highorder polynomials have seen widespread use. The least square method will usually produce ill-conditioned Gram matrixes and so introduce large errors in solution. To solve the problem, the Gram-Schmidt process was used to generate mutually orthogonal polynomials in the unit circle. 6,7 The Gauss-Newton algorithm was used to solve nonlinear least squares problems through iterations to reduce fitting errors. This method was reported to be able to further improve fitting precision. 8,9 However, when fitting rotational symmetric surfaces using the nonorthogonal polynomials and least square method, the peak polynomial coefficient increases with increasing polynomial order such that massive coefficients may be derived in some cases. 10 These coefficients are usually randomly oriented and several orders of magnitude higher than rise of arch, which might result in a much smaller number from the subtraction of two large numbers when calculating the rise of arch. In this way, the limited accuracy of numerical storage in computers leads to losses of effective numbers during computation. Specifically, it compromises the accuracy of the calculation of the surface slope, thereby rendering ray tracing inaccurate. In optical optimization processes, the loss of effective numbers causes numeric instability of the optimization algorithm, which is unacceptable in practical applications. 11 Although the methods listed above could improve fitting precision, it is not possible to prevent the loss of effective numbers because of large coefficients. In this way, a projection from polynomial equations to vector space was proposed in this study, thereby introducing a new fitting method, achieving the optimal quadric fitting surface with better fitting errors as well as minimizing the magnitude of the aspheric coefficient.
In order to improve fitting precision effectively and solve the problem of excessive coefficients, it is necessary to analyze the sources of fitting errors and their relationship with the coefficients of polynomials. The coefficient of each order of polynomials is not directly correlated to fitting errors, so direct analysis is not efficient. Based on the characteristics of homogeneity and additivity of polynomials and vectors and on the similar definition of inner products and the simple linear relationship between components and modulus length of each vector and error in least square calculation, the problem can be solved by projecting polynomials into vectors. It is inevitable to calculate the inner products of polynomials while conducting profile fitting with either the linear or the nonlinear least square method. Because the definition of fitting error is directly related to inner products, the projection from polynomials to vector space can be built based on its relationship with inner products such that the polynomials are analyzed using vector analysis methods, thereby transforming the polynomial problem into a vector problem.

Projection of Polynomials into Vector Space
The polynomial equations consisting of n polynomials were here projected into n-dimension vector space, with each polynomial projected into the n-dimension vector. The polynomials are written as φ 1 ; φ 2 ; · · · ; φ n , and the corresponding vectors as v 1 ; v 2 ; · · · ; v n . In order to facilitate future calculations, the following projection principles were here adopted: E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 1 ; 6 3 ; 6 4 0 ; m i2 ; · · · ; m ii ; 0; · · · ; 0Þ T : (1) The vectors are integrated as matrix M E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 2 ; 6 3 ; 5 6 2 M ¼ ½v 1 ; v 2 ; · · · ; v n : One algorithm is to obtain matrix M that satisfies the projection principles through "Cholesky" decomposition of the "Gram" matrix in Eq. (3). From the Cholesky decomposition, a lower triangular matrix and an upper triangular matrix, which are mutual symmetric, could be obtained, where M is the upper triangular matrix. The polynomials coefficient matrix derived from fitting is recorded as A, and the projected vector is v. The coefficient matrix and the corresponding vector have the relationships as where A ¼ ðA 1 ; A 2 ; : : : ; A n Þ T .

Principles of Aspheric Polynomial Surface Fitting
In aspheric polynomial surface fitting, the profile expression conforming to ISO 10110 standard is adopted 12 E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 5 ; 6 3 ; 3 1 7 z ¼ Here, r ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi is the perpendicular distance from surface points to the optic axis; z is the rise of the arch, i.e., the perpendicular distance between surface points to the xy plane; c is the curvature of surface apex; k is the conical constant; and A j is the polynomial coefficient.
Using optimal spherical surface methods, traditional fitting methods, based on surface features, first employed apex curvature and edge rise of arch to calculate quadric surface parameters c and k. 13,14 dðrÞ: dðrÞ ¼ zðrÞ − is the difference between fitting surface zðrÞ and optimal fitting quadric surface. The least square method is also generally used to fit residuals. The polynomials are represented as φ 0 ðrÞ, φ 1 ðrÞ; : : : ; φ n−1 ðrÞ in rectangular coordinate systems; the fitted residual function is fðrÞ, and WðrÞ is a weight function. The least square calculation is used to derive A 0 ; A 2 ; : : : ; A n−1 , which makes P ðd − P A j r 2jþ2 Þ 2 minimal. The solution equations are as follows: 9,10 E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 6 ; 3 2 6 ; 7 5 2 GA ¼ b: The coefficients of every polynomial A 1 ; A 2 ; · · · ; A n , are obtained by solving Eq. (6), where G is the Gram matrix and its elements are given by Eq. (7), and b is the calculation matrix and defined by b ¼ ½ P d · r 4 ; · · · ; P d · r 2nþ2 T . And A is the vector of coefficients defined by A ¼ ½A 1 ; · · · ; A n T . E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 7 ; 3 2 6 ; 6 6 3

Optimal Quadric Fitting Surface
As stated in Sec. 2.2, during the fitting process, the optimal quadric fitting surface is determined first, and then the least square method is used to fit the residuals. Using polynomials with more terms involves more dimensions of the corresponding vector space. The data to be fitted can be said to correspond to an infinite dimensional vector. The optimal quadric fitting surface is also represented by an infinite dimensional vector, as shown in Eq. (8), where v f is the corresponding vector of the surface to be fitted, and v s is the vector of the optimal quadric fitting surface.
During the fitting process, the use of one additional polynomial produces an additional vector component, and the fitting error v e is proportional to the component modulus value in the undescribed dimension E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 1 0 ; 3 2 6 ; 2 9 7 v e ¼ lim i→∞ ð0; · · · ; α n − β n ; α nþ1 − β nþ1 ; · · · ; α i − β i Þ T : When the components of vector v e that exceeds n dimensions have minimal modulus value, the modulus length of v e is minimal, and the fitting precision is maximal. In this way, it can be deduced that there is an optimal quadric fitting surface that can yield the minimal modulus value of undescribed components The determination of optimal quadric fitting surface is a nonlinear least square problem, which is commonly solved using the Gauss-Newton algorithm. The principle is to perform the first-order Taylor expansion on the base function to linearize it. Then the linear least square method is used in fitting, and the final results can be obtained upon iteration convergence. However, this method has several drawbacks. For example, it uses local quadratic convergence for the zero residual fitting problem, the convergence speed is low for small residual fitting problems, and there is no convergence for large residual fitting problems. Here, the residual refers to the discarded high-order terms in Taylor expansion. For this reason, the Newton-Raphson method was used in this study to perform the second-order Taylor expansion based on the definition formula of fitting residual. Because one more order of Taylor expansion was performed than in the Gauss-Newton method, more information from the function was preserved, so the method showed good convergence. The procedure is as follows: The square sum s of fitting residual d is defined as fol- The target of the algorithm is to find c and k that conform to ∂s ∂c ¼ ∂s ∂k ¼ 0. First, the initial values of c and k are obtained based on conventional methods. Then, Eq. (11) was used in iteration so as to obtain new values of c and k.
Because in the fitting process, A j is determined once c and k are determined, A j is correlated to c and k.
The partial derivative of k is obtained with similar method. The second-order partial derivative matrix was obtained based on the calculation of the first-order partial derivative. New values of c and k are continuously obtained according to the iteration formula until the iteration termination standard is achieved.

Methods to Decrease Polynomial Coefficients
Once the optimal quadric fitting surface is determined, the least square method is used to find the polynomial coefficients. If the polynomials have a large number of terms or the surface space frequency is high, there might be too many coefficients in the fitting results, and these can be several orders of magnitude higher than rise of arch. This is unfavorable in practical applications, so it is necessary to decrease the polynomials coefficients without affecting the fitting precision. The solving principle of the least square method involves determining the minimal root-mean-square (RMS) error, so the obtained small fitting coefficients can cause increased RMS (the least square method assures minimal RMS, but the coefficients can be large, and none of the operations on the coefficients assure minimal RMS). As shown, the high fitting precision and small coefficients cannot be obtained simultaneously. In this way, small coefficients could be obtained when a low fitting precision is acceptable. Proper coefficients could be obtained by limiting RMS and the range of polynomial coefficients. However, solving the multivariable quadratic inequality is difficult and time consuming. The size of the coefficients could be reduced by controlling the variation in polynomial coefficients and error-associated variables.
As stated above, additive error can be introduced while reducing polynomial coefficients. The ΔA change in the polynomial coefficients matrix introduces error E:  Here, ΔA ¼ ðΔA 1 ; ΔA 2 : : : ΔA n Þ T , and ΔA i is the coefficient variation of the i polynomial. It is known from Eq. (4) that ΔA ¼ M −1 Δv. In general, the absolute values of M −1 row elements increases from the left to the right so the last component of Δv makes the largest contribution to the coefficient. In other words, given the same error, it can, to the greatest extent, change the polynomial coefficients if the error is allocated to the last component of the vector. For this reason, the unit error vector is written as u ¼ ð0 0: : : 1Þ T , and the variation of polynomial coefficients is B ¼ kM −1 u when k times the unit error is introduced. Thus, the coefficient of new polynomials is A þ B. The introduced error can be determined by taking minimal square sum of polynomials coefficients as the standard for coefficient reduction Finally, the coefficient matrix of new polynomials can be generated E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 1 5 ; 6 3 ; The fitting error of new polynomials can be calculated based on additive error and fitting error of original polynomials other than sample points' coordinates. From the perspective of vector dimensions, the fitting error of original polynomials is due to finite terms. For this reason, the dimension of corresponding vector is finite, resulting in undescribed high-dimension features. It is known that different dimensions of the corresponding vector of the additive error and original fitting error are orthogonal, which allows the errors to be integrated based on mean square synthesis method.

Examples
In this section, the examples are illustrated. The aplanatic Descartes oval profile was used to validate the feasibility, discussing the departure part, and the optimal quadric fitting surface part. Another two examples, an extreme and a mild aspheric profile, will perform comprehensive validation of the method. In the calculation procedure, the Eq. (15) was applied after the optimal quadric fitting surface was determined by using the proposed method and the polynomial coefficients were solved with the least square method.

Aplanatic Descartes Oval Profile
The aplanatic Descartes oval profile which used by Forbes was used here to validate the feasibility of the method. 10 Using the conventional method, standard aspheric polynomial fitting was performed. Results are shown in Table 1. The curves of Descartes oval and their fitting errors are shown in Fig. 1. As stated in Forbes's article, standard aspheric polynomials are nonorthogonal, and the use of high-order terms in the fitting process can affect the coefficients of low-order terms, resulting in higher coefficients from more terms. In this way, the number of significant figures can decrease during fitting with more high-order polynomials, leading to nonsignificant increases in precision. In this paper, further analysis and deduction were conducted, and we demonstrate that the results were not optimal either in terms of precision or in terms of coefficient magnitude. The effectiveness of our proposed method was proved using two conditions: (1) excessive coefficients and (2) suboptimal fitting precision from optimal quadric fitting surface.
The data in the table show that, when there are eight polynomial terms, the coefficients are large, two orders of magnitude greater than the maximal value of the point of departure. These very large coefficients affect the system optimization process and so need to be decreased. According to the proposed method, taking the eight-term aspheric polynomials, e.g., the polynomials were projected into eight-dimensional vector space, and the eight vectors The associated variables between polynomial coefficients variation and introduced error can be defined and controlled for optimization, facilitating reduction of coefficient size. The results showed that the coefficients decreased into the same level as in fitting of five-term polynomials, while the fitting precision was kept at a level similar to that of the fitting of seven-term polynomials.
Similarly, based on the deduction shown in Sec. 3, the Newton-Raphson iteration method was used to search for optimal fitting spherical surface. Results are shown in Table 1. The optimal fitting spherical surface is distinct from that produced using conventional methods. After determining the optimal quadric fitting surface using the Raphson method, the polynomial coefficients were solved, and the fitting error was dramatically decreased.

Comprehensive Validation Using an Aspheric Surface
The examples given above are experimental validation of the new method in terms of the departure part and the optimal quadric fitting surface part. The following example will perform comprehensive validation for the above two parts. The surface as shown in Fig. 2 is the measured contour from a fabricated lens used in a cell phone. It was fitted with the proposed method, and the results are as shown in Table 2.
The results demonstrated that, due to the variation in the optimal quadric fitting surface, the vector corresponding to the point of departure shows high-dimensional components with lower values, resulting in more described surface information in the polynomials, so retaining high fitting precision. Associated variables between polynomials coefficients variation and introduced error were obtained, and this could significantly change coefficient range while keeping the error similar. The results also show that the proposed method is effective for a measured profile as well as the nominal starting values of a surface.

Validation Using a Mild Aspheric Surface
The examples in Secs. 3.1 and 3.2 are extreme aspheric surfaces. In this section, the proposed method is also applied to the aspheric surface fitting of a mild profile, the contour from   Fig. 3 The aspheric surface of a mild profile (red line "a": the aspheric surface, blue line "b": the error of traditional method, green line "c": the error of the proposed method).  (1) Cheng, Yang, and Hao: Aspherical surface profile fitting based on the relationship between polynomial. . . a imaging lens. The fitting results were shown in Fig. 3 and Table 3, which approved the efficiency of the method.

Conclusions
While performing surface fitting with the least square method, polynomial coefficients often become far larger than maximal rise of arch of the fitted data. This causes difficulties in optical system design and optimization. In this paper, a projection from polynomials to vector was proposed such that the polynomial problem was transformed into a vector problem. According to the proposed projection principle, the mutual projection between polynomials and vector could determine the relationship between the vector and the polynomial coefficients, and further determine the relationship between introduced errors and polynomial coefficient variation. The polynomial coefficients were reduced based on the standard of minimal square sum. For the first time, the Newton-Raphson method was used to search for optimal fitting surface, which not only improved the fitting precision but also had better convergence than the Gauss-Newton method. Through fitting tests of various surface profiles, the proposed method was proven to be effective in terms of fitting error and the range of the coefficients. Thus, it is of significance in practical application. The proposed algorithm has been programmed with MATLAB and available for a Dynamic Data Exchange connection to optical design software.