Open access peer-reviewed chapter

# A Multi-Domain Spectral Collocation Approach for Solving Lane-Emden Type Equations

By Motsa Sandile Sydney, Magagula Vusi Mpendulo, Goqo Sicelo Praisegod, Oyelakin Ibukun Sarah and Sibanda Precious

Submitted: October 22nd 2015Reviewed: March 10th 2016Published: August 24th 2016

DOI: 10.5772/63016

## Abstract

In this work, we explore the application of a novel multi-domain spectral collocation method for solving general non-linear singular initial value differential equations of the Lane-Emden type. The proposed solution approach is a simple iterative approach that does not employ linearisation of the differential equations. Spectral collocation is used to discretise the iterative scheme to form matrix equations that are solved over a sequence of non-overlapping sub-intervals of the domain. Continuity conditions are used to advance the solution across the non-overlapping sub-intervals. Different Lane-Emden equations that have been reported in the literature have been used for numerical experimentation. The results indicate that the method is very effective in solving Lane-Emden type equations. Computational error analysis is presented to demonstrate the fast convergence and high accuracy of the method of solution.

### Keywords

• Multi-domain
• Lame-Emden
• Spectral Relaxation method
• Collocation
• Astrophysics

## 1. Introduction

In the most general form, Lane-Emden type equations are given as

y+γxy+f(x,y)=g(x),x[0,),y(0)=α0,y(0)=β0E1

where the prime denotes differentiation with respect to x, f(x, y) is a non-linear function, g(x) is a prescribed function and γ, α0, β0are known constants. In recent years, problems described by this class of differential equations have been widely investigated by many researchers because of their applications in astronomy, mathematical biology, mathematical physics, non-Newtonian fluid mechanics, and other areas of science and engineering. From a solution method viewpoint, it has been observed that, owing to the singularity at x= 0, Lane-Emden type equations are not trivial to solve. For this reason, the equations are normally used as benchmark equations for testing the effectiveness and robustness of new analytical and numerical methods of solution.

Analytical approaches that have recently been used in solving the Lane-Emden equations are mostly based on truncated series expansions. Examples include the Adomian decomposition method [13], differential transformation method [4, 5], Laplace transform [6, 7], homotopy analysis method [810], power series expansions [1114] and variational iteration method [1517]. Being power series based, the above methods have a small region of convergence and are not suitable for generating solutions in very large values of x. For this reason, most analytical approaches have only reported solutions of Lane-Emden type equations on small interval [0,1]on xaxis. Despite this limitation, analytical approaches have been found to be desirable because they easily overcome the difficulty caused by the singularity at x= 0.

To overcome the limitations of analytical solution methods, several numerical approaches have been proposed for the solution of Lane-Emden type equations. Numerical methods based on spectral collocation have been found to be particularly effective. Collocation methods that have been reported recently for the solution of Lane-Emden type equations include the Bessel collocation method [18, 19], Jacobi-Gauss collocation method [20], Legendre Tau method [21], Sinc-collocation method [22], Chebyshev spectral methods [23], quasi-linearisation based Chebyshev pseudo-spectral method [24, 25] and a collocation method based on radial basis functions [26]. The discretisation scheme of collocation based methods is only implemented on interior nodes of the discretised domain. This property makes it possible for these collocation methods to overcome the difficulty of dealing with the singular point.

In this work, we present a multi-domain spectral collocation method for solving Lane-Emden equations. The method is based on the innovative idea of reducing the governing non-linear differential equations to a system of first-order equations which are solved iteratively using a Gauss-Seidel–like relaxation approach. The domain of the problem is divided into smaller non-overlapping sub-intervals on which the Chebyshev spectral collocation method is used to solve the iteration scheme. The continuity condition is used to advance the solution across neighbouring sub-intervals. The advantage of the approach is that it does not use Taylor-series based linearisation methods to simplify the non-linear differential equations. The method is free of errors associated with series truncation. The algorithm is also very easy to develop and yields very accurate results using only a few discretisation nodes. The accuracy of the method is validated against known results from the literature. The aim of the study is to explore the applicability of the multi-domain spectral collocation method to Lane-Emden type equations over semi-infinite domains. The results confirm that the method is suitable for solving all types of Lane-Emden equations.

## 2. A multi-domain pseudospectral relaxation method

In this section, we describe the development of the multi-domain collocation algorithm for the solution of Lane-Emden type equations. This algorithm addresses some limitations of standard collocation methods. Without loss of generality, we express the second-order generalised Lane-Emden Eq. (1) as a system of first-order ordinary differential equations (ODEs). If we let hy0, the initial value problem (1) transforms to

y(x)=h(x),y(0)=α0,E2
h(x)+γxh+f(x,y)=g(x),h(0)=β0,E3

where y′(x) = h(x). The following iterative scheme for solving (2) and (3) is introduced:

yi+1(x)=hi(x),yi+1(0)=α0,E4
hi+1(x)+γxhi+1(x)+f(x,yi+1)=g(x),hi+1(0)=β0.E5

Assuming that an initial approximation h0(x)is given, Eq. (4) can be solved for yi+1(x)and the solution can be used immediately in Eq. (5) which is, in turn, solved for hi+1. Thus, at each iteration level i+ 1, Eqs. (4) and (5) form a pair of linear decoupled first-order differential equations. The solution procedure is discussed below.

Below, we describe the development of the multi-domain approach for solving the system of first-order Eqs. (4) and (5). The multi-domain technique approach assumes that the main interval can be decomposed into pnon-overlapping sub-intervals. Let xΛ, where Λ=[a,b]is the interval where the solution of Eq. (1) exists. The sub-intervals are defined as

Λk=(xk1,xk),k=1,2,,p,with,a=x0<x1<x2<<xp=b.E6

The solution procedure assumes that the solution at each sub-interval Λk, denoted by y(k)(x), can be approximated by a Lagrange interpolation polynomial of the form

y(k)(x)s=0Ny(k)(xs)Ls(x),E7

which interpolates y(k)(x)at selected points, chosen to be the Chebyshev-Gauss-Lobatto, defined by

{τs}s=0N={cos(πsN)}s=0N.E8

The choice of the interpolation function (7) with Lagrangre polynomial basis and grid points (8) enables the use of simple formulas for converting the continuous derivatives to discrete matrix-vector form at the collocation points τs. The function Ls(x) is the characteristic Lagrange cardinal polynomial defined as

Ls(x)=s=0skMxxkxsxk,E9

that obey the Kronecker delta equation:

Ls(xk)=δsk={0ifsk1ifs=k..E10

The solution method seeks to solve each of the system of first-order ODEs independently in each kth sub-interval Λkusing the solutions obtained in the preceding interval Λk1as initial conditions. In the first interval the solution is computed on [x0,x1]and is labelled y(1)(x).The value of the solution at the last node y(1)(x1)is used as an initial condition when seeking a solution in the second sub-interval Λ2. This procedure is repeated in each Λkinterval with the solutions marched across each interval using the following continuity condition:

y(k)(xk1)=y(k1)(xk1),h(k)(xk1)=h(k1)(xk1).E11

Therefore, in each sub-interval Λk, the following system of ODEs is solved:

dyi+1(k)(x)dx=hi(k)(x),yi+1(k)(xk1)=αk1E12
dhi+1(k)(x)dx+γxhi+1(k)(x)=g(x)f(x,yi+1(k)),hi+1(k)(xk1)=βk1,E13

where

αk1=y(k1)(xk1),βk1=h(k1)(xk1),k=1,2,,p.

Eqs. (12) and (13) cannot be solved exactly because of the non-linear function f(x, y). Accordingly, we employ the spectral collocation at the grid points xjfor j=0,1,2,,Nfor each sub-interval Λk. Before the spectral method is applied, each sub-interval [xk1,xk]is transformed to [1,1]using the linear transformation:

x=xkxk12τ+xk+xk12,τ[1,1].E14

The derivatives at the collocation points are evaluated as

dy(k)dx|x=xj=s=0Ny(k)(xs)dLs(xj)dx=2Δxks=0Ny(k)(τs)dLs(τj)dτ=s=0NDjsy(k)(τs),E15

where Δxk=xkxk1, Djs=2ΔxkDjswith Djs=dLs(τj)dτbeing the jth and sth entry of the standard first derivative Chebyshev differentiation matrix of size (N+1)×(N+1)as defined in [27]. Evaluating Eqs. (12) and (13) at the grid points τjfor j=0,1,2,,Ngives

s=0NDjsyi+1(k)(τs)=hi(k)(τj),yi+1(k)(τN)=αk1,E16
s=0NDjshi+1(k)(τs)+γxjhi+1(k)(τj)=g(xj)f(xs,yi+1(k)(τj)),hi+1(k)(τN)=βk1.E17

Including the relevant initial conditions in Eqs. (16) and (17) yields

s=0N1Djsyi+1(k)(τs)=Vi(k)(τj),E18
s=0N1Djshi+1(k)(τs)+γxjhi+1(k)(τj)=Wi(k)(τj).E19

where

Vi(k)(τj)=hi(k)(τj)DjNyi+1(k)(τN),E20
Wi(k)(τj)=g(xj)f(xj,yi+1(k)(τj))DjNhi+1(k)(τN),E21

Eqs. (18) and (19) can be expressed in matrix form as follows:

DYi+1(k)=Vi(k),E22
(D+ζ)Hi+1(k)=Wi(k),E23

where the vectors Y(k),H(k),V(k)and W(k)are respectively given by

Y(k)=[y(k)(τ0),y(k)(τ1),y(k)(τ2),,y(k)(τN1)]T,E24
H(k)=[h(k)(τ0),h(k)(τ1),h(k)(τ2),,h(k)(τN1)]T,E25
V(k)=[v(k)(τ0),v(k)(τ1),v(k)(τ2),,v(k)(τN1)]T,E26
W(k)=[w(k)(τ0),w(k)(τ1),w(k)(τ2),,w(k)(τN1)]T,E27

and Tdenotes the transpose of the vector. The N× Ndiagonal matrix ζ is given by

ζ=[γx0γx1γxN1].E28

The approximate values of y(k)(x)and dy(k)(x)dxare obtained by iteratively solving Eqs. (22) and (23), respectively, for i=0,1,2,, starting from suitable initial approximation.

## 3. Numerical experiments

In this section, we discuss the numerical experiments to be used to demonstrate the accuracy and general performance of the multi-domain pseudospectral relaxation method. In these numerical experiments, we have selected equations with known exact solutions, and to determine the accuracy of the method, we find the relative error. The relative error is defined as

Ej=|ye(xj)ya(xj)||ye(xj)|E29

where Ejis the relative error at a grid point xj, ye(xj)and ya(xj)are the exact and approximate solutions at a grid point xj, respectively.

### Example 1

We first consider the linear, homogeneous Lane-Emden equation, with variable coefficients:

y+2xy2(2x2+3)y=0,x>0,subjecttoy(0)=1andy(0)=0,E30

which has the exact solution:

y(x)=ex2.

Eq. (30) has been solved by various researchers using different techniques such as the variational iteration method and the homotopy-pertubation method [16, 28, 29].

### Example 2

Secondly, the non-linear, homogeneous Lane-Emden equation, with variable coefficients is considered:

y+2xy+4(2ey+ey/2)=0,x>0,subjecttoy(0)=0andy(0)=0E31

which has the exact solution:

y(x)=2ln(1+x2).

Eq. (31) has been solved by [29, 30, 31] using the lie symmetry, the homotopy-pertubation method and the variational iteration method.

### Example 3

In this example, we consider the non-linear, variable coefficients, homogeneous Lane-Emden equation:

y+2xy6y=4yln(y),x>0,subjecttoy(0)=1andy(0)=0E32

which has the exact solution:

y(x)=ex2.

Ramos [28] solved Eq. (32) using the variation iteration method, while Yildirim [16] solved the same equation using the linearisation method.

### Example 4

We consider the non-linear, homogeneous Lane-Emden equation:

y+6xy+2y(7+ln(y2))=0,x>0,subjecttoy(0)=1andy(0)=0E33

which has the exact solution [32]:

y(x)=ex2.

This example was solved by Wazwaz [32] using the Adomian decomposition method.

### Example 5

We consider the non-linear, homogenous Lane-Emden equation, which represent an infinite circular cylinder in astrophysics:

y+2xy+y36x6=0,x>0,subjecttoy(0)=0andy(0)=0,E34

which has the exact solution [33]:

y(x)=x2.

This example was solved by Yin et al. [33] using the modified Laplace decomposition method.

### Example 6

Lastly, we consider the Lane-Emden equation with the general form:

y+2xy+ym=0,x>0,subjecttoy(0)=1andy(0)=0.E35

Eq. (35) is the standard Lane-Emden equation that models the thermal behaviour of a spherical cloud of glass acting under the mutual attraction of its molecules and subject to classical laws of thermodynamics [34]. The values of min the interval [0,5]are most physically interesting to study. The equation is linear when m= 0 and m= 1 and non-linear for values of m>1. Wazwaz [35] gave the general solution of Eq. (35) in series form as

y(x)=116x2+m120x4m(8m5)3.7!x6+m(70183m+122m2)9.9!x8+m(31501080m+12642m25032m3)45.11!x10+.E36

Analytical solutions for m=0,1and m=5are given as [35]

y(x)=113!x2,y(x)=sinxx,andy(x)=(1+x23)12,E37

respectively. In this example, we consider the Lane-Emden Eq. (35) for m= 5. We therefore consider the equation:

y+2xy+y5=0,x>0,subjecttoy(0)=1andy(0)=0E38

with the exact solution:

y(x)=(1+x23)1/2.E39

## 4. Results and discussion

In this section, we discuss and present the results obtained using the proposed algorithm. We used the six examples in the previous section. The results were generated using MATLAB 2013. To validate the accuracy, computational time and general performance of the method, we computed relative errors and computational time of each of the numerical examples. The level of accuracy of the algorithm at a particular level is determined by the relative error Rkdefined by

Rk=|ye(xk)ya(xk)||ye(xk)|,0kN,E40

where Nis the number of grid points, ya(xk)is the approximate solution and ye(xk)is the exact solution at the grid point xk. The graphs were all generated using N= 4. For each numerical experiment, we present the relative error and the corresponding approximate solution for N= 4 and N= 6 in a tabular form. The central processing unit computational time is displayed. Graphs showing an excellent agreement between the analytical and approximate solutions are presented for each numerical experiment. These graphs validate the accuracy of the method. Error graphs showing the distribution of the relative errors are also presented. These error graphs are in excellent agreement with the results presented in the tables for all the numerical experiments used in this chapter.

N = 4N = 6
xExactApproximateRelative errorApproximateRelative error
0.21.0603131.0603131.884728e−141.0603134.251109e−014
0.41.1400181.1400183.505912e−141.1400186.505415e−014
0.61.3714161.3714167.852585e−141.3714161.066980e−013
0.81.7871891.7871891.413886e−131.7871891.474757e−013
1.02.5229882.5229882.355112e−132.5229881.864022e−013
1.23.8583673.8583673.776361e−133.8583672.234047e−013
1.46.3919796.3919795.987445e−136.3919792.591455e−013
1.611.47125111.4712519.227679e−1311.4712512.937560e−013
1.822.30127822.3012781.396995e−1222.3012783.316738e−013
2.046.96694246.9669422.066546e−1246.9669423.633883e−013
CPU Time (sec)0.6594140.6290820.659414

### Table 1.

Analytical, approximate solutions and relative errors for Example 1.

Table 1 shows the exact, approximate solution and the relative error for Eq. (30). For N= 4, the multi-domain spectral relaxation method gives a relative error of approximately 10−12 and for N= 6, the relative error is on average 10−13. Increasing the number of grid points results in a more accurate solution. The results obtained from the multi-domain spectral relaxation method are remarkable since few grid points give accurate results in a large domain. Using a few grid points ensures that the numerical method converges within few seconds.

Figure 1 shows the relative error displayed in Table 1 for N= 4. The results in Figure 1 are in excellent agreement with those in Table 1. Figure 2 shows the analytical and approximate solutions. Since the approximate solution is superimposed on the exact solutions, this implies that the multi-domain pseudospectral relaxation method converged to the exact solution over the domain x[0,2]. Table 1 and Figures 1 and 2 validate the accuracy and computational efficiency of the multi-domain pseudospectral relaxation method for Eq. (30).

The results obtained from approximating the solution to Eq. (31) using the multi-domain pseudospectral relaxation method are shown in Table 1 and Figures 3 and 4. In Table 2, we display the exact solution, approximate solution and the relative error of Eq. (31) in Example 2. For N= 4, the multi-domain spectral relaxation method gives a relative error of approximately 10−11. For N= 4 the relative error is approximately 10−13. We observe that increasing the number of grid points decreases the relative error. The multi-domain pseudospectral relaxation method uses a few grid points to achieve accurate results in the domain x[0,20]. A maximum of N= 6 grid points ensured that the numerical method converged to an error of 10−13 within a fraction of a second.

Figure 3 shows the relative error displayed in Table 2 for N= 4. The results in Figure 3 are in excellent agreement with those in Table 2. Figure 4 shows the analytical and approximate solutions of Eq. (31). The approximate solution superimposed on the exact solutions shows that the multi-domain pseudospectral relaxation method converged to the exact solution over the domain x[0,20]. The match between the exact and approximate solutions in Table 2 and Figures 3 and 4 validates the accuracy and computational efficiency of the multi-domain pseudospectral relaxation method for Eq. (31).

N = 4N = 6
xExactApproximateRelative errorApproximateRelative error
2–3.271943–3.2719438.810376e−011–3.2719432.704972e−014
4–5.697684–5.6976821.000287e−011–5.6976846.202217e−014
6–7.243401–7.2433998.316853e−012–7.2434012.136148e−014
8–8.365152–8.3651511.308867e−011–8.3651523.825343e−015
10–9.243421–9.2434201.383787e−011–9.2434214.807193e−015
12–9.964487–9.9644871.318604e−011–9.9644875.172115e−015
14–10.575872–10.5758721.205994e−011–10.5758726.720993e−015
16–11.106445–11.1064451.080384e−011–11.1064453.199792e−016
18–11.575028–11.5750289.561315e−012–11.5750286.293749e−015
20–11.927621–11.9276228.504839e−012–11.9276211.738910e−014
CPU Time (sec)0.6491350.6023590.649135

### Table 2.

Analytical, approximate solutions and relative errors for Example 2.

The results obtained from approximating the solution to Eq. (32) are given in Table 3 and Figures 5 and 6. Table 3 shows the exact solution, the approximate solution and the relative error of Eq. (32). For N= 4, the multi-domain spectral relaxation method gives a relative error of approximately 10−12, while for N= 6, the relative error is approximately 10−13. We observe that increasing the number of grid points decreases the relative error and hence increases the accuracy of the method. This pseudospectral method uses a few grid points to achieve accurate results in the domain x[0,2]. N= 6 grid points ensured that the numerical method converged to an error of 10−13 within few seconds.

N = 4N = 6
xExactApproximateRelative errorApproximateRelative error
0.21.0293221.0293222.502345e−0141.0293221.682611e−014
0.41.1467131.1467131.316722e−0131.1467134.124439e−014
0.61.3838921.3838923.732052e−0131.3838926.915367e−014
0.81.8092281.8092288.178657e−0131.8092281.078787e−013
1.02.5622862.5622861.581696e−0122.5622861.493997e−013
1.23.9310243.9310242.814656e−0123.9310241.883216e−013
1.46.533226.533224.761036e−0126.533222.300241e−013
1.611.76230611.7623067.722919e−01211.7623062.750095e−013
1.822.94041022.9404101.211045e−01122.9404103.176323e−013
2.048.46781648.4678161.845750e−01148.4678163.667955e−013
CPU Time (sec)1.0697731.0106281.069773

### Table 3.

Analytical, approximate solutions and relative errors for Example 3.

The relative error shown in Table 3 is displayed in Figure 5. The results in Figure 5 are in excellent agreement with those in Table 3. Figure 6 shows the analytical and approximate solutions of Eq. (32). The approximate solution being superimposed on the exact solutions implies that the multi-domain pseudospectral relaxation method converged to the exact solution over the domain x[0,2]. The match between the exact and approximate solutions in Table 3 and Figures 5 and 6 validates the accuracy and computational efficiency of the multi-domain pseudospectral relaxation method for Eq. (32).

The results obtained from approximating the solution to Eq. (33) are given in Table 4 and Figures 7 and 8. Table 4 shows the exact solution, the approximate solution and the relative error of Eq. (33). For N= 4, the multi-domain spectral relaxation method gives a relative error of approximately 10−13. For N= 6, the relative error is also approximately 10−13. Increasing the number of grid points decreases the relative error. Thus, a maximum of N= 6 grid points ensures convergence of the method. N= 6 grid points ensured that the numerical method converged to an error of 10−13 in a fraction of seconds.

N = 4N = 6
xExactApproximateRelative errorApproximateRelative error
0.20.9740970.9740977.978218e−0150.9740972.803774e−014
0.40.8771790.8771791.215047e−0140.8771796.999178e−014
0.60.7291730.7291731.248514e−0140.7291731.079508e−013
0.80.5595380.5595381.805602e−0140.5595381.341305e−013
1.00.3963550.3963553.221242e−0140.3963551.606419e−013
1.20.2591770.2591776.232707e−0140.2591771.756296e−013
1.40.1564460.1564461.011254e−0130.1564461.754615e−013
1.60.0871740.0871741.525094e−0130.0871741.404105e−013
1.80.0448400.0448401.897188e−0130.0448403.528213e−014
2.00.0212920.0212921.404623e−0130.0212922.123230e−013
CPU Time (sec)1.0808281.0462741.080828

### Table 4.

Analytical, approximate solutions and relative errors for Example 4.

Figure 7 shows the relative error displayed in Table 4 for N= 4. The results in Figure 7 are in excellent agreement with those in Table 4. Figure 8 shows the analytical and approximate solutions. Since the approximate solution is superimposed on the exact solutions, this implies that the multi-domain pseudospectral relaxation method converged to the exact solution over the domain x[0,2]. Table 4 and Figures 7 and 8 validate the accuracy and computational efficiency of the multi-domain pseudospectral relaxation method for Eq. (33).

The results obtained from approximating the solution to Eq. (34) are given in Table 5 and Figures 9 and 10. Table 5 shows the exact solution, the approximate solution and the relative error of Eq. (34). The multi-domain pseudospectral relaxation method gives a relative error of approximately 10−14. For N= 6, the relative error is approximately 10−14. Increasing the number of grid points decreases the relative error and thus implying that the numerical method converged to the exact solution. The pseudospectral collocation method uses a few grid points to achieve accurate results in the domain x[0,2]. The numerical method converged to an error of 10−14 in a fraction of a second.

N = 4N = 6
xExactApproximateRelative errorApproximateRelative error
0.20.0262440.0262444.759186e−0150.0262441.692155e−014
0.40.1310440.1310441.397903e−0140.1310443.473577e−014
0.60.3158440.3158442.495721e−0140.3158445.518706e−014
0.80.5806440.5806443.537301e−0140.5806446.864276e−014
1.00.9254440.9254444.138845e−0140.9254448.445643e−014
1.21.3502441.3502443.880967e−0141.3502449.981979e−014
1.41.8550441.8550444.093663e−0141.8550441.098825e−013
1.62.4398442.4398443.749517e−0142.4398448.700337e−014
1.83.1046443.1046442.445989e−0143.1046444.706026e−014
2.03.8494443.8494444.614580e−0163.8494446.575777e−015
CPU Time (sec)0.7059100.6383830.705910

### Table 5.

Analytical, approximate solutions and relative errors for Example 5.

Figure 9 shows the relative error displayed in Table 5 for N= 4. The results in Figure 9 are in excellent agreement with those in Table 5. Figure 10 shows the analytical and approximate solutions. Since the approximate solution is superimposed on the exact solutions, this implies that the multi-domain pseudospectral relaxation method converged to the exact solution over the domain x[0,2]. Table 5 and Figures 9 and 10 validate the accuracy and computational efficiency of the multi-domain pseudospectral relaxation method for Eq. (34).

The results obtained from approximating the solution to Eq. (38) are given in Table 6 and Figures 11, 12 and 13. Table 6 shows values obtained for the exact and approximate solution together with the respective relative error values of Eq. (38). For N= 4 the multi-domain pseudospectral collocation method gives a relative error of approximately 1011and 10−13 for N= 6. An increase in the number of grid points results in a decrease in the relative error. This implies that the numerical method converges to the exact solution of Eq. (38). The multi-domain pseudospectral relaxation method used a few grid points to achieve accurate results in the domain x[0,20]. N= 6 grid points ensured that the numerical method converged to an error of 10−13 within a few seconds as shown in Table 6.

N = 4N = 6
xExactApproximateRelative errorApproximateRelative error
20.6509260.6509261.991857e−0110.6509263.189482e−014
40.3956930.3956932.135316e−0110.3956933.745701e−014
60.2764990.2764996.204217e−0120.2764995.842239e−014
80.2111000.2111008.877991e−0120.2111001.519920e−013
100.1703330.1703332.323778e−0110.1703332.328536e−013
120.1426240.1426243.707619e−0110.1426243.096185e−013
140.1226090.1226095.055364e−0110.1226094.021536e−013
160.1074920.1074926.378059e−0110.1074924.983484e−013
180.0956770.0956077.683911e−0110.0956775.994828e−013
200.0870570.0870578.847457e−0110.0870576.926360e−013
CPU Time (sec)1.1998921.0464171.199892

### Table 6.

Analytical, approximate solutions and relative errors for Example 6.

Figure 11 shows the plot for different values of m. The results are in good agreement with those obtained by [25, 26]. Figure 12 displays the relative error graph of Eq. (38). The results in Figure 12 are in excellent agreement with those obtained in Table 6. The comparison between the exact solution and approximate solution of Eq. (38) is shown in Figure 13. The superimposition of the approximate solution on the exact solution implies that the multi-domain pseudospectral relaxation method converged to the exact solution over the domain x[0,20]. Table 6 and Figures 11, 12 and 13 give a validation of the accuracy and computational efficiency of the multi-domain pseudospectral relaxation method for Eq. (38).

## 5. Conclusion

In this work, we presented a multi-domain spectral collocation method for solving Lane-Emden equations. This numerical method was used to solve six Lane-Emden equations. The results obtained were remarkable in the sense that using few grid points, we were able to achieve accurate results. We were able to compute the results using minimal computational time. The approximate solutions were in excellent agreement with the exact solutions in all the numerical experiments. We presented error graphs, approximate and exact solution graphs to show accuracy of the method. Tables showing relative errors were also generated to show accuracy and computational efficiency of the numerical method presented.

This approach is useful for solving other nonlinear, singular initial value problems. This approach is an alternative to the already existing list of numerical methods that can be used to solve such equations. This numerical approach can be extended to solve time-dependent Lane-Emden equations and other singular value type of equations.

## Acknowledgments

This work is based on the research supported in part by the National Research Foundation of South Africa (Grant No: 85596).

chapter PDF
Citations in RIS format
Citations in bibtex format

## More

© 2016 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution 3.0 License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

## How to cite and reference

### Cite this chapter Copy to clipboard

Motsa Sandile Sydney, Magagula Vusi Mpendulo, Goqo Sicelo Praisegod, Oyelakin Ibukun Sarah and Sibanda Precious (August 24th 2016). A Multi-Domain Spectral Collocation Approach for Solving Lane-Emden Type Equations, Numerical Simulation - From Brain Imaging to Turbulent Flows, Ricardo Lopez-Ruiz, IntechOpen, DOI: 10.5772/63016. Available from:

### More statistics for editors and authors

Login to your personal dashboard for more detailed statistics on your publications.

### Related Content

Next chapter

#### Numerical Solution of System of Fractional Differential Equations in Imprecise Environment

By Najeeb Alam Khan, Oyoon Abdul Razzaq, Asmat Ara and Fatima Riaz

First chapter

#### Some Commonly Used Speech Feature Extraction Algorithms

By Sabur Ajibola Alim and Nahrul Khair Alang Rashid

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.