An Effective Approximation Algorithm for Second-Order Singular Functional Differential Equations

: In this research study, a novel computational algorithm for solving a second-order singular functional differential equation as a generalization of the well-known Lane–Emden and differential-difference equations is presented by using the Bessel bases. This technique depends on transforming the problem into a system of algebraic equations and by solving this system the unknown Bessel coefﬁcients are determined and the solution will be known. The method is tested on several test examples and proves to provide accurate results as compared to other existing methods from the literature. The simplicity and robustness of the proposed technique drive us to investigate more of their applications to several similar problems in the future.


Introduction
The primary concern of this research work is to develop a computationally effective technique, which relies on novel Bessel polynomials and a set of collocation points to find the solutions of the following second-order singular functional differential equations (SFDEs) where the constants a, b, c, d, e, f , and µ are in R. Moreover, is a positive real number and r(x), p(x) are given real-valued functions. The above SFDEs are accompanied with the initial conditions The study of the singular functional differential equations (SFDEs) is one of the most important areas of study with a variety of applications in engineering and science topics. The researcher community is continuously investigating the possible applications of these types of equations and numerous fields are reported including electrodynamics [1], models of infectious diseases [2], population growth models [3], the simulation of tumor growth [4], the processing of chemical systems [5], understanding the gene system [6], and viral 2 of 14 infectious models [7]. These models have attracted the attention of many scientists with their singularity at the origin or other points. One of the most important models that has this type of equation is the well-known Lane-Emden type equations (LEE) that have been used since they was named after the famous astrophysicists Jonathan Homer Lane and Robert Emden back in 1870. The Lane-Emden equations have some applications in the field of models of thermal explosion [8], models of isothermal gas spheres [9], stellar structure [10], and the study of thermionic current. These potential and important applications have motivated researchers to investigate the solution of these models more.
Finding the approximate solution of the LEE is one of the most interesting subjects for scientists and researchers. For obtaining the results for the solutions of these types of problems, some numerical and analytical techniques have been adapted, acquiring good results. For example, Mirazaee et al. in [11] investigated a Fibonacci polynomials based method for solving this problem. Moreover, Kadalbajoo et al. [12] adapted a method with Taylor series expansion for solving a similar type of equation. The asymptotic solutions are analyzed in [13] for a class of nonlinear singular perturbed equations. Sabir et al. [14] performed a neuro-swarm intelligent computing algorithm for solving a second-order type equation. Other reported methods can be found in [15][16][17][18][19] and references therein with multiple other applications of this problem. All of the above-mentioned methods, either analytical or numerical, have some advantages and disadvantages in terms of errors or computational costs. Thus, we searched for a suitable collocation based method to adapt and acquire more accurate results which urges us to use the Bessel collocation method.
The appearance of new Bessel functions related to the Bessel functions of the first type was systematically shown in a seminal paper [20]. Since then, many research papers have been devoted to discovering many characteristics of these polynomials from the algebraic point of view; for more details, see [20][21][22][23][24][25][26]. In recent years, the study of different models with the aid of these polynomials has witnessed a large increase of research due to their simplicity and the ability to provide good results. For the recent applications of the Bessel polynomials, we draw your attention to some recent works we have done in [27][28][29]. The main goal of this research work is to propose a spectral approach based on a combination of novel Bessel bases as well as some appropriate collocation points for an approximate treatment of the SFDEs in (1). Supposedly, the underlying model problem has a solution in terms of the Bessel series expansion on [0, ], the proper representations of the unknowns and their derivatives yield to find the unknown series coefficients, through solving an algebraic system of equations. Indeed, the explicit and original representation of the Bessel functions is It can be obviously observed that the coefficients of B m (ξ) are all positive. Contrary to the Bessel functions of the first kind [30], the novel Bessel functions B m (ξ) are the unique solutions of the following differential equation [27][28][29] The main capability of of the proposed Bessel spectral algorithm is that it converts the SFDEs (1) to a system of algebraic equations while reducing computational complexity. Usages of the proposed technique but with different bases such as Legendre, Chebyshev, Chelyshkov, alternative Bessel, and Jacobi functions can be found in [31][32][33][34][35][36][37][38][39][40].
The outline of this study is structured as follows. The next section provides the methodology of the Bessel matrix procedure for the SFDEs in an elegant manner. In Section 3, three test examples are solved in order to evaluate the reliability and accuracy of the presented matrix technique. In Section 4, we present a summary and conclusion.

The Bessel Matrix Technique
In order to utilize the Bessel functions on [0, ], we first make a change of variable in (3). We take ξ = x/ where > 0 in (3). Henceforth, the shifted Bessel functions will be denoted by B m, (x), which are orthogonal with respect to g (x) := exp(−2 /x); see [20,27]. Suppose that the unknown solution w(x) of (1) can be expanded in the Bessel polynomials form Now, the ultimate goal is to seek the coefficients c m for m = 0, 1, . . . , N. To proceed, we introduce the unknown vector and the vector containing the shifted Bessel functions of order m = 0 to m = N as Thus, on the other hand, we have the following expression for w N (x) in (4) in the form Next, we introduce the following Bessel matrix L, which has a low-triangular structure and is of size (N + 1) × (N + 1) . This allows us to write further the vector V V V N (x) in (5) in the product representation form where Ξ Ξ Ξ N (x) = 1 x x 2 . . . x N stands for the vector of monomials. Finally, we place relation (6) into (5) to arrive at the following form of approximate solution w N (x) in (4) as We now mention a pertinent result about the convergence of Bessel functions. The following theorem asserts that the approximate solution w N (x) is exponentially convergent (in the weighed L 2 norm) to the exact solution w(x) if we let N tend to infinity. Theorem 1. Let us denote by w N (x) = V V V N (x) C C C N the best square approximation to w(x) and also we have w(x) ∈ C N+1 (0, ]. Then, the following error estimate holds Proof. For a similar proof, we refer interested readers to [27,30]. We now associate a sequence of collocation points {x q } N q=0 on [0, ] to our approximation algorithm. In this respect, the following grid points are employed Once the preceding collocation points are placed into the relation (7), we get the matrix expression for the unknown solution itself as In order to express w(α x + β) and its derivatives in the matrix forms, we state and prove the next theorem.

Theorem 2.
For any constants α and β, the matrix representations of w(α x + β), d dx w(α x + β), and d 2 dx 2 w(α x + β) at the collocation points (8) can be represented as Here, the matrix B B B is defined in (15) and the matrix H H H α,β is given at (14). Moreover, we have Proof. According to (7), we may write Our aim is to express Ξ Ξ Ξ N (α x + β) in terms of Ξ Ξ Ξ N (x), which is defined in (6). With the help of the binomial expansion, where the matrix H H H T α,β is dependent on two parameters α and β and is defined as Now, we combine the relations (13) and (14) to obtain We are now ready to put the collocation points (8) into the preceding equation followed by utilizing the relation (9); the proof of (10) is done.
We then find a relationship between Ξ Ξ Ξ N (x) and d s dx s Ξ Ξ Ξ N (x) for s = 1, 2. For this purpose, we define the differentiation matrix B B B through defining .
It can be easily seen that [30] Differentiating the relation (15) once more, we get Our next aim is to differentiate (7) with respect to the variable x and utilize (15). Therefore, we will get the following approximation for d dx w N (α x + β) as In the same manner, after using (16) we get an approximation for d 2 dx 2 w N (α x + β) as follows We now replace the vector Ξ Ξ Ξ N (α x + β) in (17) and (18) via (14). Thus, we get the following matrix representation forms Axioms 2022, 11, 133 6 of 14 The proofs of (11) and (12) are straightforward after inserting the collocation points (8) into the foregoing (19).

Remark 1. It is worth mentioning the cost of calculating
. For practical applications, however, it would be very useful to consider an algorithm with linear complexity O(N + 1). This task can be accomplished by taking direct differentiation of the monomials Ξ Ξ Ξ N (x). Upon calling Algorithm 1, the s-order derivatives (s ≥ 1, s ∈ N) of Ξ Ξ Ξ N (x) can be achieved directly. Let us assume that Algorithm 1 takes (N = 4, s) as inputs. The outputs with s = 1 and s = 2 are as follows, respectively: In this work, we are particularly interested in computing the first and second derivatives of Ξ Ξ Ξ N (x) by Algorithm 1. This enables us to compute d s dx s Ξ Ξ Ξ N (α x + β) for s = 0, 1, 2 after invoking Algorithm 1 followed by substituting x → (α x + β) in them.

Algorithm 1:
The computation of s-derivative of the vector Ξ Ξ Ξ N (x).
end if end for end; The considered SFDE problem (1) will be collocated at the set of collocation points (8) to arrive at To express the former N + 1 equations in a matrix representation, we exploit the results of Theorem 2 to haveẄ Two matrices Q Q Q, R R R and the vector P P P are We finally obtain the so-called fundamental matrix equation for the underlying model (1).
Let us emphasize that the algebraic matrix Equation (23) is linear and the unknown coefficient C C C N can be calculated through solving it. However, the initial conditions (2) must be utilized in implementation of the fundamental matrix Equation (23). This aim will be considered below.

Initial Conditions in the Matrix Form
Analogously, we are able to approximate the initial conditions (2) in the matrix form, which allows us to find the solution of (1) via solving the fundamental matrix Equation (23). We first convert w(0) = w 0 into a matrix representation. To this end, let us tend t → 0 in (7) to arrive at For the second condition d dx w(0) = w 1 , we first differentiate (7). Hence, we combine the resultant equation with (15) Now, let t → 0 in the foregoing equation to obtain Now, to the fundamental matrix Equation (23), we add the initial conditions (2). For this purpose, the replacements of the first and the second row of the matrix [Z Z Z; P P P] are done by the row matrices [ Z Z Z 0 ; w 0 ] and [ Z Z Z 1 ; w 1 ]. Let us denote by [ Z Z Z; P P P] the modified version of the fundamental matrix. After solving this modified form, the unknown coefficients c m , m = 0, 1, . . . , N will be calculated and thus the desired approximation w N (x) of SFDEs (1) will be determined.

Computational Simulations
Let us illustrate the practicability of our Bessel matrix approach through numerical simulations. In this respect, computational results of three test examples are performed to show the reliability and validity of the proposed numerical model. Thus, we show that our suggested approximation algorithm can produce improved results compared to existing available computational procedures. For numerical simulations, we use MATlAB software version 2017a for programming and visualization. Moreover, the value ξ = 0.01 is taken in the set of collocation points (8) in order to ensure that the zero point is excluded from this set. In order to evaluate the accuracy as well as the convergence of the proposed Bessel matrix technique, we define Example 1. We firstly consider a non-homogeneous singular differential difference model problem of the form with initial conditions w(0) = 1, d dx w(0) = 0. A straightforward calculation shows that true exact solution is given by w(x) = 1 + x 3 .
For this test problem, we set = 10, and utilize N = 3, which is sufficient to obtain an accurate solution. To do so, we express the solution of (1) in terms of Bessel bases as considered in (4). Afterwards, through solving the fundamental matrix Equation (23), we obtain By exploiting the first four Bessel basis functions and multiply them by C 3 , we get the approximate solution w 3 (x) on 0 ≤ x ≤ 10 as follows Clearly this is the exact solution of (1). In the next experiments, the results of absolute errors utilizing diverse values of = 1, 5, 20 are computed. Table 1 tabulates the results of E N (x) which are calculated at some points x j = j /10 and j varies from 1 to 10. A comparison with the outcomes of artificial neural networks (ANNs) reported in [17] on [0, 1] and with 10 neurons is carried out in Table 1 to testify to the validity of our numerical results. An obvious conclusion can be made from Table 1 that our numerical model results are not only highly accurate on the unit interval but also have sufficient accuracy for the larger values of .  The above approximation together with the exact solutions are visualized in Figure 1. The resulting absolute errors are also presented in this figure, but on the right part.

Example 2.
As the second test problem, let us consider a Lane-Emden differential difference model problem of the form It is not a difficult task to show that the exact solution of (2) is w(x) = e x .
Let us check that our proposed method yields a reasonable result in comparison with the exact solution. In this respect, the first seven terms of its series expansion are written as However, more accurate results based on the Bessel matrix approach will be achieved if one increases N. For instance, the approximated solution w 10 (x) can be analogous on [0, 1] as w 10 (x) = 0.000001068044011 x 10 − 0.000002908206541 x 9 + 0.00004176809694 x 8 + 0.0001888482682 x 7 + 0.001313363417 x 6 + 0.008508813772 x 5 + 0.04165172897 x 4 + 0.1663795908 x 3 + 0.5001750161 x 2 + 1.0 x + 1.0.
Additionally, the graphical representation of the numerical results using different values of N = 6, 10 and N = 15 are shown in Figure 2. In this plot, the absolute errors E N (x) for x ∈ [0, 1] and for these values of N are also depicted.
In Table 2, the computed values of the values of the absolute errors E N (x) at some points x ∈ [0, ] with = 1, = 2 as well as = 5 for Example 2 are shown. The corresponding number of basis functions are N = 10, 20 and N = 30, respectively. Furthermore, the statistical results for this test example utilizing the ANN approach for = 1 and with 10 neurons that was proposed in [17] are reported in Table 2   In the next and last experiment performed for the test problem (2), we consider a relatively large domain of computation by choosing = 10. To get a reasonable accuracy, we take N = 60. In Figure 3, the curve of approximate solution w 60 (x) as well as the related relative error R N (x) are shown. Example 3. The last and third test case is devoted to the following singular differential difference with trigonometric functions defined on 0 ≤ with initial conditions w(0) = 0, d dx w(0) = 1. An easy calculation shows that w(x) = sin x is the exact solution of this model problem.
Utilizing N = 5, 10 in the Bessel matrix procedure, we get the following polynomial forms for the approximate solutions on x ∈ [0, 1] as follows Let us consider the series form of the exact solution, i.e., sin x ≈ x − x 3 3! + x 5 5! − . . . + x 9 9! . A comparison between the achieved approximations and the exact one indicates the good alignment between them. The absolute errors E N (x) utilizing diverse values of N = 5, 10, 15 in the approximate solutions are presented in Figure 4. The curves of w N (x) for N = 5, 10 are also visualized in Figure 4.  We next examine the benefits of the presented Bessel matrix scheme and validate our results for = 1, π, 2π. We also utilize various N = 10, 20, and N = 30 for each computational domain [0, ]. In this respect and in terms of accuracy, some comparisons are performed in Example 3 in Table 3. Besides the numerical results reported at some x in [0, ], the outcomes of the achieved errors obtained via ANNs with 10 neurons are further presented in Table 3 as has been done in the previous test examples. Comparing our numerical achievements in Tables 1-3 with the outcomes of ANNs reveals that our approach is more accurate and can be easily applied on long computational domains. Finally, we take = 5π. Moreover, the value of N = 60 is utilized as the number of the basis of functions. The numerical solution w 60 (x) is depicted in Figure 5. The graphical representation of the absolute error E N (x) is also shown in Figure 5. It can be obviously observed that, to keep the accuracy of the proposed method up on a long domain of computation, one has to adjust the number of basis functions accordingly.

Conclusions
In this manuscript, an accurate and reliable numerical technique is designed and implemented to obtain an approximate solution for a class of singular second-order functional differential models using the Bessel polynomials. The proposed approach is viably developed for solving various test examples of the second-order singular functional differential model problems. A precise and accurate performance is witnessed for this technique consistently achieving high accuracy from the existing exact results for the given test cases based upon the second-order singular functional differential model. The presented approach looks proficient and promising for solving similar applicable problems in the future.