Spline-Based Formulas for the Determination of Equation of Time and Declination Angle

This paper presents new approximation formulas for the determination of the equation of time and declination angle. The proposed approach is based on the cubic spline interpolation techniques defined for sixteen or twenty chosen knots over the whole year. The results obtained by the proposed formulas for both equation of time and declination angle show marked improvements in terms of speed and sum of squared errors and maximum absolute error over the whole year in comparison with other five existing methods for analytical evaluation of equation of time and two existing methods for analytical evaluation of declination angle.


Introduction
The quantity of solar radiation reaching any particular part of the earth's surface is determined by the position of the point, time of year, atmospheric diffusion, cloud cover, shape of the surface, and reflectivity of the surface [1].At any given time, the position of the sun relative to the plane of celestial equator describes the declination angle (DA) [2].
Different time systems are in use.Legal clock time differs from solar time.Solar time is determined from the movements of the sun.This time system is usually called local apparent time (LAT).Local mean time (LMT), often called clock time or civil time, differs from the LAT.The conversion of time systems requires knowledge both of the longitude of the site and the reference longitude of the time system being used.The conversion also requires the application of the equation of time (EOT), which accounts for certain perturbations in the rotation of the earth about its polar axis [3].
In the present work two new interpolating formulas are suggested for the determination of the EOT and the DA which are based on cubic spline functions.This form of interpolating technique has been successfully implemented for variety of engineering applications where fast and reliable evaluations of some mathematical functions are the main objectives [4][5][6].

Equation of Time (EOT).
The first expression for the EOT in minutes reported in [7] is given in terms of sine function defined over three different sections of the year as follows: ( n is the day number of the year (e.g., n = 1 on January 1 and n = 33 on February 2).
The second expression for the EOT in minutes reported in [8] is based on five terms of the Fourier expansion and is given by EOT(n) = 229.18[0.000075+ 0.001868 cos(w) − 0.032077 sin(w) − 0.014615 cos(2w) where w is the day angle in radian (w = 2π(n − 1)/365) and n is the day number.The third expression for the EOT reported in [9] is given by EOT(n) = 9.87 sin 2β − 7.67 sin β + 78.7 where n is the day number of the year (e.g., n = 1 on January 1 and n = 33 on February 2).The fifth and final expression for the EOT reported in [11] is given by EOT(n) = 9.87 sin 2β − 7.53 cos β − 1.5 sin β , (5) where β = 360(n − 81)/364 degrees and n is the day number.

Declination Angle (DA).
The first expression for the DA in degrees reported in [2] is given in terms of the following sine function approximation formula: where n is the day number of the year (e.g., n = 1 on January 1 and n = 33 on February 2).

New Approach
Polynomial approximation is most often recommended for function evaluation as any continuous function can be approximated in this way, and the implementation only consists of additions, multiplications, and powers [12].This paper introduces a new approach for the fast and reliable determination of the EOT and DA based on cubic spline polynomial interpolation functions.Instead of approximating a given function and approximate f (x) by different polynomials on each subinterval.For example, we may recall that the repeated midpoint, trapezoidal, and parabolic rules for approximate integration result from the process of replacing the integrand by piecewise polynomial approximations of degrees 0, 1, and 2, respectively, with subintervals of uniform length.In the first case the approximation (a step function) generally is discontinuous at each division point x k ; in the other two cases this statement applies instead to the derivative.For some purposes, particularly for numerical differentiation, it is highly desirable that the joins of the separate arcs be as smooth as possible.Specifically, if it is required that in each subinterval the approximation s(x) be a polynomial of maximum degree 3; that is, s(x) agrees with f (x) at each of the n + 1 points (x 0 = a, x 1 , x 2 , . . ., x n−1 , x n = b) and that the first and second derivatives s (x) and s (x) be continuous on [a, b]; then, s(x) is called a cubic spline [13][14][15].Assume that the values of the EOT and DA at n days (x 1 , x 2 , . . ., x n ), where x 1 is 1 and x n is 366, are given to be (y 1 , y 2 , . . ., y n ), respectively.Then the cubic spline functions are defined as set of third-degree polynomials that goes through each of the n data points (knots) and has continuous first-and secondorder derivatives.Consider the subinterval (x i to x i+1 ), and let Then the cubic spline function f (x) on this interval may be given by where s i = f (x i )/6 (i = 2, 3, . . ., n − 1), In this form s 1 is taken as linear extrapolation from s 2 and s 3 and s n as linear extrapolation from s n−1 and s n−2 , respectively [14].
These n spline coefficients (s i , i = 1, 2, . . ., n) are then determined numerically by implementing a MATLAB program based on Gaussian elimination without scaling or pivoting [15].

Results and Discussion
The spline coefficients of (9) for the EOT and DA were determined by implementing a MATLAB program.Tables 1  and 2 show the 16 and 20 knots taken in calculating the spline coefficients, respectively.These knots were selected from the full tabular values of EOT and DA given in [16,17].A comparative study was performed for the five expressions for EOT considered in (1) to ( 5) with the proposed spline formula of (9), respectively.A similar comparative study was also performed for DA for the two expressions  2) Equation ( 3) Equation ( 4) Equation ( 5) of DA considered in equation ( 6), equation (7) with the proposed spline formula of (9), respectively.
MATLAB programs were implemented to evaluate the Sum of Squared Errors (SSE), Maximum Absolute Error (MAE) and Average Absolute Error (AAE) calculated over the whole year for all the cases considered above with respect to the data given in [16,17] which represents the reference values of the equation of time and declination angle.Further details for these expressions are given in the appendix.The results are shown in Tables 3 and 4 for the EOT and DA, respectively.A graphical representation of the errors over the whole year with reference to the tabulated data of [16,17] for the six expressions of the EOT, and the three expressions of the DA are displayed in Figures 1 and 2, respectively.
It can be seen from the results in Tables 3 and 4 and also from the graphs of Figures 1 and 2 that the use of the cubic spline functions reported in this paper offers the best results in terms of sum of the squared errors and maximum errors.Hence, it can be concluded that the use of cubic spline functions promises to be very useful mathematical tools in applications where speed and accuracy are of the prime objectives.
Many new high-performance field programmable gate array (FPGA) technologies provide built-in multifunction modules that have general applicability to a wide range of applications [18].The fast and reliable determination of the EOT and the DA plays an important role in various fields of solar energy.It follows that the approach proposed in this paper may play an important role in the FPGA based applications used for the fast and accurate calculations of the position of the sun over the year [19].

Conclusion
The use of cubic spline approximation method has been developed for solar tracking applications as well as those  concerned with classical navigation.The main benefits of using the cubic spline functions are the following (i) it is a relatively smooth curve, (ii) it never overshoots intermediate values, and (iii) interpolated values can be calculated directly without solving a system of equations.Cubic spline interpolation is a powerful data analysis tool.Splines correlate data efficiently and effectively no matter how random the data may seem.
For systems requiring little data-processing capability such as microcontrollers and low-range microprocessors the spline approach can be the best choice.If the computation needs are greater, more powerful microprocessors, or even digital signal processors (DSPs), should be considered.This type of solution (microprocessors and DSPs) is very flexible as the development work mainly consists in generating programs.Which number of knots are to be chosen in the determination of the equation of time and declination angle remains to be a tradeoff between the computation speed and the acceptable error level.
For getting higher performances, it may be necessary to develop specific algorithm.A first option is to use a programmable device, for example, a FPGA.

Figure 1 :
Figure 1: Errors of EOT over one year.

Figure 2 :
Figure 2: Errors of DA over one year.

Table 1 :
Selected points for the 16 knots for EOT and DA.

Table 2 :
Selected points for the 20 knots for EOT and DA.

Table 3 :
Comparison parameters for the EOT.

Table 4 :
Comparison parameters for the DA.