Gauss collocation method for solving nonlinear

1 downloads 0 Views 284KB Size Report
May 4, 2011 - Jacobi–Gauss points are used as collocation nodes. Numerical .... In this section, we use the shifted Jacobi–Gauss collocation method to solve ...
Commun Nonlinear Sci Numer Simulat 17 (2012) 62–70

Contents lists available at ScienceDirect

Commun Nonlinear Sci Numer Simulat journal homepage: www.elsevier.com/locate/cnsns

A Jacobi–Gauss collocation method for solving nonlinear Lane–Emden type equations A.H. Bhrawy ⇑, A.S. Alofi Department of Mathematics, Faculty of Science, King Abdulaziz University, Jeddah, Saudi Arabia

a r t i c l e

i n f o

Article history: Received 15 December 2010 Received in revised form 21 April 2011 Accepted 24 April 2011 Available online 4 May 2011 Keywords: Lane–Emden type equation Second-order initial value problems Collocation method Jacobi–Gauss quadrature Shifted Jacobi polynomials

a b s t r a c t In this paper, a shifted Jacobi–Gauss collocation spectral method is proposed for solving the nonlinear Lane–Emden type equation. The spatial approximation is based on shifted Jacobi ða;bÞ polynomials PT;n ðxÞ with a, b 2 (1, 1), T > 0, and n is the polynomial degree. The shifted Jacobi–Gauss points are used as collocation nodes. Numerical examples are included to demonstrate the validity and applicability of the technique and a comparison is made with existing results. The method is easy to implement and yields very accurate results. Ó 2011 Elsevier B.V. All rights reserved.

1. Introduction Spectral methods (see, for instance [7,17,24,27]) are one of the principal methods of discretization for the numerical solution of differential equations. The main advantage of these methods lies in their accuracy for a given number of unknowns. For smooth problems in simple geometries, they offer exponential rates of convergence/spectral accuracy. In contrast, finitedifference and finite-element methods yield only algebraic convergence rates. The three most widely used spectral versions are the Galerkin, collocation, and tau methods. Collocation methods [7,19] have become increasingly popular for solving differential equations, also they are very useful in providing highly accurate solutions to nonlinear differential equations. In the present paper we intend to extend the application of Jacobi polynomials from Galerkin method for solving two-point linear problems (see [6,13,16]) to collocation method to solve nonlinear second-order initial value problems. To the best of our knowledge, there are no many results on Jacobi–Gauss collocation method for differential equations of second-order arising in mathematical physics. This partially motivated our interest in such method. The use of general Jacobi polynomials has the advantage of obtaining the equations in terms of the Jacobi parameters a and b (see [14,15]). Of these polynomials, the most commonly used are the ultraspherical polynomials; the Chebyshev polynomials; the Legendre polynomials (see [13,5,32]). Hence to generalize and instead of developing approximation results for each particular pair of indexes, it would be very useful to carry out a systematic study on Jacobi polynomials (a, b > 1) with general indexes which can then be directly applied to other applications. It is with this motivation that we introduce in this paper a family of Jacobi polynomials with indexes a, b > 1. The study of singular initial value problems modeled by second-order nonlinear ordinary differential equations have attracted many mathematicians and physicists. One of the equations in this category is the following Lane–Emden type equation: ⇑ Corresponding author. Permanent address: Department of Mathematics, Faculty of Science, Beni-Suef University, Beni-Suef, Egypt. E-mail address: [email protected] (A.H. Bhrawy). 1007-5704/$ - see front matter Ó 2011 Elsevier B.V. All rights reserved. doi:10.1016/j.cnsns.2011.04.025

63

A.H. Bhrawy, A.S. Alofi / Commun Nonlinear Sci Numer Simulat 17 (2012) 62–70

a u00 ðxÞ þ u0 ðxÞ ¼ gðx; uðxÞÞ; x

0 < x < 1;

ð1:1Þ

subject to u(0) = b0 and u0 (0) = b1, where the prime denotes differentiation with respect to x, and a, b0 and b1 are constants. Lane–Emden type equation model many phenomena in mathematical physics and astrophysics. It is categorized as singular nonlinear initial value problem. This equation describes the temperature variation of a spherical gas cloud under the mutual attraction of its molecules and subject to the laws of classical thermodynamics. The polytropic theory of stars essentially follows out of thermodynamic considerations, that deals with the issue of energy transport, through the transfer of material between different levels of the star. This equation is one of the basic equations in the theory of stellar structure and has been the focus of many studies [2,3,9,12,20,30,31,33,34]. The solution of the Lane–Emden problem, as well as other various linear and nonlinear singular initial value problems in quantum mechanics and astrophysics, is numerically challenging because of the singularity behavior at the origin. The approximate solutions to the Lane–Emden equation were given by homotopy perturbation method [28,10,11], variational iteration method [29], and Sinc-Collocation method [22], an implicit series solution [26]. Recently, Parand et. al [23] proposed an approximation algorithm for the solution of the nonlinear Lane–Emden type equation using Hermite functions collocation method. Moreover, Adibi and Rismani [1] introduced a modified Legendre-spectral method for solving (1.1). The fundamental goal of this paper is to develop a suitable way to approximate the Lane–Emden type equation on the interval (0, T) using the Jacobi polynomials, we propose the spectral shifted Jacobi–Gauss collocation (SJC) method to find the solution uN(x). The nonlinear ODE is collocated only at the (N  1) points. For suitable collocation points we use the (N  1) nodes of the shifted Jacobi–Gauss interpolation on (0, T). These equations together with two initial conditions generate (N + 1) nonlinear algebraic equations which can be solved using Newton’s iterative method. Finally, the accuracy of the proposed methods are demonstrated by test problems, numerical results are presented in which the usual exponential convergence behavior of spectral approximations is exhibited. This paper is organized as follows. In Section 2 we give an overview of shifted Jacobi polynomials and their relevant properties needed hereafter, and in Sections 3, the way of constructing the collocation technique for Lane–Emden equation is described using the shifted Jacobi polynomials. In Section 4 the proposed method is applied to some types of Lane–Emden equations, and comparisons are made with the existing analytic or numerical solutions that were reported in other published works in the literature. Also a conclusion is given in Section 5. 2. Preliminaries ða;bÞ

Let a > 1, b > 1 and Pk ða;bÞ

ðxÞ ¼ ð1Þk Pk

ða;bÞ

aþ1Þ ð1Þ ¼ Ck!ðkþ Cðaþ1Þ :

Pk Pk

ða;bÞ

ðxÞ be the standard Jacobi polynomial of degree k. We have that

ðxÞ;

ða;bÞ

Pk

k

ðkþbþ1Þ ð1Þ ¼ ð1Þk!CCðbþ1Þ ;

ð2:1Þ

Besides, ða;bÞ

Dm Pk

ðxÞ ¼ 2m

Cðm þ k þ a þ b þ 1Þ ðaþm;bþmÞ ðxÞ: Pkm Cðk þ a þ b þ 1Þ

ð2:2Þ

Let w(a,b)(x) = (1  x)a(1 + x)b, then we define the weighted space L2wða;bÞ ð1; 1Þ as usual, equipped with the following inner product and norm,

ðu; v Þwða;bÞ ¼

Z

1

uðxÞv ðxÞwða;bÞ ðxÞdx;

1

1

kv kwða;bÞ ¼ ðv ; v Þ2wða;bÞ :

The set of Jacobi polynomials forms a complete L2wa;b ð1; 1Þ-orthogonal system, and ða;bÞ 2 kwða;bÞ

kPk

ða;bÞ

¼ hk

¼

2aþbþ1 Cðk þ a þ 1ÞCðk þ b þ 1Þ : ð2k þ a þ b þ 1ÞCðk þ 1ÞCðk þ a þ b þ 1Þ

ð2:3Þ ða;bÞ

ða;bÞ 2x T

Let T > 0, then the shifted Jacobi polynomial of degree k on the interval (0, T) is defined by PT;k ðxÞ ¼ P k By virtue of (2.1) and (2.2), we have that ða;bÞ

PT;k ð0Þ ¼ ð1Þk ða;bÞ

Dq PT;k ð0Þ ¼ ða;bÞ

Cðk þ b þ 1Þ ; Cðb þ 1Þk!

ð1Þkq Cðk þ b þ 1Þðk þ a þ b þ 1Þq T q Cðk  q þ 1ÞCðq þ b þ 1Þ

 1 .

ð2:4Þ :

ð2:5Þ

Next, let wT ðxÞ ¼ ðT  xÞa xb , then we define the weighted space L2wða;bÞ ð0; TÞ in the usual way, with the following inner prodT uct and norm,

64

A.H. Bhrawy, A.S. Alofi / Commun Nonlinear Sci Numer Simulat 17 (2012) 62–70

ðu; v Þwða;bÞ ¼

Z

T

T

0

ða;bÞ

uðxÞv ðxÞwT

1

kv kwða;bÞ ¼ ðv ; v Þ2 ða;bÞ :

ðxÞdx;

wT

T

The set of shifted Jacobi polynomials is a complete L2wða;bÞ ð0; TÞ-orthogonal system. Moreover, due to (2.3), we have T

 aþbþ1   T  ða;bÞ 2 ða;bÞ ða;bÞ hk ¼ hT;k : PT;k  ða;bÞ ¼ wT 2

ð2:6Þ

For a = b one recovers the shifted ultraspherical polynomials (symmetric shifted Jacobi polynomials) and for a ¼ b ¼  12 ; a ¼ b ¼ 0; the shifted Chebyshev of the first and second kinds and shifted Legendre polynomials respectively; and for the nonsymmetric shifted Jacobi polynomials, the two important special cases a ¼ b ¼  12 (shifted Chebyshev polynomials of the third and fourth kinds) are also recovered. ða;bÞ Now, we turn to the Jacobi–Gauss interpolation. We denote by xN;j 0 6 j 6 N; the nodes of the standard Jacobi–Gauss interpolation on the interval (1, 1). The corresponding Christoffel numbers are

ða;bÞ -N;j ; 0 6 j 6 N: The nodes of the shifted

ða;bÞ

ða;bÞ

Jacobi–Gauss interpolation on the interval (0, T) are the zeros of P T;Nþ1 ðxÞ, denoted by xT;N;j ; 0 6 j 6 N: Clearly  aþbþ1 ða;bÞ ða;bÞ ða;bÞ ða;bÞ -N;j ; 0 6 j 6 N. Let SN(0, T) be the set of polyxT;N;j ¼ T2 ðxN;j þ 1Þ. The corresponding Christoffel numbers are -T;N;j ¼ T2 nomials of degree at most N. Thanks to the property of the standard Jacobi–Gauss quadrature, it follows that for any / 2 S2N+1(0, T),

Z

T

ðT  xÞa xb /ðxÞdx ¼

0

¼

 aþbþ1 Z 1  aþbþ1 X     N  T T T T ða;bÞ ð1  xÞa ð1 þ xÞb / ðx þ 1Þ dx ¼ -ðN;ja;bÞ / xN;j þ 1 2 2 2 2 1 j¼0 N X





a;bÞ ða;bÞ -ðT;N;j / xT;N;j :

ð2:7Þ

j¼0

3. Shifted Jacobi–Gauss collocation method In this section, we use the shifted Jacobi–Gauss collocation method to solve numerically the following model problem:

u00 ðxÞ ¼ f ðx; uðxÞ; u0 ðxÞÞ;

0 < x 6 T;

ð3:1Þ

subject to

uð0Þ ¼ d0 ;

u0 ð0Þ ¼ d1 ;

ð3:2Þ

where the values of d0 and d1 describe the initial state of u(x) and f(x, u, u0 ) is a nonlinear function of x, u and u0 which may be singular at x = 0. The choice of collocation points is important for the convergence and efficiency of the collocation method. For two-point boundary value problems, the Gauss–Lobatto points are commonly used. It should be noted that for a second-order differential equation with the singularity at x = 0 in the interval [0, T] one is unable to apply the collocation method with Jacobi– Gauss–Lobatto points because the two assigned abscissas 0 and T are necessary to use as a two points from the collocation nodes. Also a Jacobi–Gauss–Radau nodes with the fixed node x = 0 cannot be used in this case. In fact, the collocation method with Jacobi–Gauss nodes is used to treat singular second-order differential equation; i.e., we collocate the singular nonlinear ODE only at the (N  1) Jacobi–Gauss points that are the (N  1) zeros of the shifted Jacobi polynomial on (0, T). These equations together with two initial conditions generate (N + 1) nonlinear algebraic equations which can be solved. Let us first introduce some basic notation that will be used in the sequel. We set

n o ða;bÞ ða;bÞ ða;bÞ SN ð0; TÞ ¼ span PT;0 ðxÞ; PT;1 ðxÞ; . . . ; P T;N ðxÞ ;

ð3:3Þ

and we define the discrete inner product and norm as follows:

ðu; v Þwða;bÞ ;N ¼ T

ða;bÞ

N     X ða;bÞ ða;bÞ ða;bÞ u xT;N;j v xT;N;j -T;N;j ; j¼0

kukwða;bÞ ;N ¼ T

qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ðu; uÞwða;bÞ ;N :

ð3:4Þ

T

ða;bÞ

where xT;N;j and -T;N;j are the nodes and the corresponding weights of the shifted Jacobi–Gauss-quadrature formula on the interval (0, T), respectively. Obviously,

ðu; v Þwða;bÞ ;N ¼ ðu; v Þwða;bÞ ; T

T

8uv 2 S2N1 :

ð3:5Þ

Thus, for any u 2 SN(0, T), the norms kukwða;bÞ ;N and kukwða;bÞ coincide. T

T

P

ða;bÞ

Associating with this quadrature rule, we denote by INT

   ða;bÞ  P ða;bÞ ða;bÞ INT u xT;N;j ¼ u xT;N;j ;

0 6 k 6 N:

the shifted Jacobi–Gauss interpolation,

A.H. Bhrawy, A.S. Alofi / Commun Nonlinear Sci Numer Simulat 17 (2012) 62–70

65

The shifted Jacobi–Gauss collocation method for solving (3.1) and (3.2) is to seek uN(x) 2 SN(0, T), such that

       ða;bÞ ða;bÞ ða;bÞ u00N xT;N;k ¼ f x; uN xT;N;k ; u0N xT;N;k ; ðiÞ uN ð0Þ

¼ di ;

k ¼ 0; 1; . . . ; N  2:

ð3:6Þ

i ¼ 0; 1:

We now derive the algorithm for solving (3.1) and (3.2). To do this, let

uN ðxÞ ¼

N X

ða;bÞ

aj PT;j ðxÞ;

a ¼ ða0 ; a1 ; . . . ; aN ÞT :

ð3:7Þ

j¼0

We first approximate u(x), u0 (x) and u00 (x), as Eq. (3.7). By substituting these approximation in Eq. (3.1), we get N X

ða;bÞ

aj Dð2Þ PT;j ðxÞ ¼ f x;

j¼0

N X

ða;bÞ

aj PT;j ðxÞ;

j¼0

N X

! ða;bÞ

aj DP T;j ðxÞ :

ð3:8Þ

j¼0

Then, by virtue of (2.2), we deduce that

! N N N X 1X 1X ðaþ2;bþ2Þ ða;bÞ ðaþ1;bþ1Þ aj ðj þ a þ b þ 1Þ2 PT;j2 ðxÞ ¼ f x; aj PT;j ðxÞ; aj ðj þ a þ b þ 1ÞPT;j1 ðxÞ : 4 j¼0 2 j¼0 j¼0

ð3:9Þ

Also, by substituting Eq. (3.7) in Eq. (3.2) we obtain N X

ða;bÞ

aj DðiÞ PT;j ð0Þ ¼ di ;

i ¼ 0; 1:

ð3:10Þ

j¼0

To find the solution uN(x), we first collocate Eq. (3.9) at the (N  1) shifted Jacobi roots, yields

! N N N     1X   X 1X ðaþ2;bþ2Þ ða;bÞ ða;bÞ ða;bÞ ða;bÞ ðaþ1;bþ1Þ ða;bÞ ðj þ a þ b þ 1Þ2 PT;j2 xT;N;k aj ¼ f xT;N;k ; PT;j xT;N;k aj ; ðj þ a þ b þ 1ÞPT;j1 xT;N;k aj : 4 j¼0 2 j¼0 j¼0

ð3:11Þ

Next, Eq. (3.10), After using (2.4) and (2.5) at q = 1, can be written as N X Cðj þ b þ 1Þ ð1Þj a ¼ d0 ; Cðb þ 1Þ j! j j¼0

ð3:12Þ

N X ð1Þj1 Cðj þ b þ 1Þðj þ a þ b þ 1Þ aj ¼ d1 : Tðj  1Þ!Cðb þ 2Þ j¼1

ð3:13Þ

Finally, From (3.11), (3.12) and (3.13), we get (N + 1) nonlinear algebraic equations which can be solved for the unknown coefficients aj by using any standard iteration technique, like Newton’s iteration method. Consequently, uN(x) given in Eq. (3.7) can be evaluated. 4. Numerical results To illustrate the effectiveness of the proposed method in the present paper, several test examples are carried out in this section. Comparisons of the results obtained by the present method with that obtained by other methods reveal that the present method is very effective and convenient. We consider the following examples. Example 1. Consider the following nonlinear Lane–Emden-type equation [10,23,29]

2 u00 ðxÞ þ u0 ðxÞ þ 4ð2eu þ eu=2 Þ ¼ 0; x

0 6 x 6 10;

subject to the initial conditions

uð0Þ ¼ 0;

u0 ð0Þ ¼ 0;

which has the following analytical solution:

uðxÞ ¼ 2 lnð1 þ x2 Þ: This type of equation has been solved by [29,10,23] with the variational iteration method, homotopy-perturbation method and Hermite function collocation (HFC [23]) method respectively. In Table 4.1, we list the results obtained by the shifted Jacobi–Gauss collocation method proposed in this paper with

a = b = 0(shifted Legendre–Gauss collocation method) and a = b = 1/2(second kind shifted Chebyshev–Gauss collocation

66

A.H. Bhrawy, A.S. Alofi / Commun Nonlinear Sci Numer Simulat 17 (2012) 62–70 Table 4.1 Absolute error using SJC and HFC methods for N = 30 for Example 1. x

SJC with (a = b = 0)

SJC with (a = b = 1/2)

HFC [23]

0.0 0.01 0.1 0.5 1 2 3 4 5 6 7 8 9 10

1.72  1016 6.31  109 2.15  107 4.32  107 5.62  108 3.92  108 1.50  107 1.15  107 1.00  108 7.18  108 7.51  108 1.48  108 6.85  108 1.90  109

8.88  1016 1.75  108 1.89  107 2.28  107 1.15  107 9.17  108 6.75  108 5.96  108 3.80  109 4.97  108 3.82  108 4.99  108 3.93  108 5.33  109

0.00  100 2.93  106 3.94  106 3.02  106 9.31  107 5.00  107 8.10  107 7.69  107 6.64  107 5.48  107 1.70  107 1.09  107 1.21  105 3.83  105

method). Also we contrast our results with the corresponding results reported by Parand et al. [23], which we have presented in the fourth column of this table. The displayed results show that the SJC method is more accurate than HFC [23]. In Fig. 1 we give the (ln) of the maximum absolute error of u  uN against N, using SJC method, with various choices of a, b and N. Numerical results of this example show that the spectral method, SJC method, converges exponentially for all values of a and b, it also indicates that the numerical solution converges fast as N increases. Example 2. Consider the isothermal gas spheres equation [8,21]

1 u00 ðxÞ þ u0 ðxÞ ¼ eu x subject to one of the following two cases of boundary conditions: Case A:

u0 ð0Þ ¼ 0;

uð1Þ ¼ 0;

Case B:

u0 ð0Þ ¼ 0;

uð1:5Þ ¼ 2 ln

pffiffiffi 42 2

!

pffiffiffi : 7:75  4:50 2 Example 1

32 30 28

Ln of maximum absolute error

26

0

24 22 20

0.5

18 16 14 12

3,

2

5,

6

10 8 6 4 2 8

16

24

32

40

48

56

64

N N from 8 to 64 Fig. 1. The maximum absolute error of the shifted Jacobi–Gauss collocation method for the Lane–Emden type equation.

A.H. Bhrawy, A.S. Alofi / Commun Nonlinear Sci Numer Simulat 17 (2012) 62–70

67

Table 4.2 Absolute error using SJC method for N = 20 for Example 2 (Case A). x

a

b

SJC method with N = 20

MDM-CSCT [21] with N = 20

0.0

1 2

1 2

3.33  1016

2.00  106

0

0

2.22  1016 5.55  1016

1.97  106

4.99  1016 3.88  1016

1.83  106

3.88  1016 1.38  1016

1.67  106

0.2 0.4 0.6 0.8 1.0

1 2

1 2

0

0

1 2

1 2

0

0

1 2

1 2

0

0

1 2

1 2

0

0

1 2

1 2

0

0

17

8.32  10 2.22  1016

9.20  107

2.35  1016 9.98  1018

0

6.86  1018

  pffiffiffi where c ¼ 3  2 2. This problem has the exact solution uðxÞ ¼ 2 ln cxcþ1 2 þ1 Similar problems were also investigated by Khuri and Sayf [21] using a modified decomposition method in combination with the cubic B-spline collocation technique (MDM-CSCT [21]). For Case A, numerical results using SJC method, for some points and two choices of a, b, are presented in Table 4.2. We contrast our results with the corresponding results reported by Khuri and Sayf [21], which we have presented in the fifth column of this table. For Case B, the maximum absolute error using the SJC method with various choices of a, b and N and the corresponding results in [21] are presented in Table 4.3. Numerical results of this problem show that the SJC method converges exponentially and is always more accurate than the MDM-CSCT [21]. Example 3. Consider the following nonlinear Lane–Emden type equation [18,28,29]

2 0 u ðxÞ  6uðxÞ ¼ 4uðxÞ lnðuðxÞÞ; x uð0Þ ¼ 1; u0 ð0Þ ¼ 0

u00 ðxÞ þ

x 2 ½0; 1;

2

with the exact solution uðxÞ ¼ ex . This type of equation has been solved by [1,23] with Legendre-spectral and Hermite functions collocation methods respectively. In this model we can use the transform u(x) = ez(x) in which z(x) is unknown; where upon transformed form of the model will become as follows:

z00 ðxÞ þ ðz0 ðxÞÞ2 þ

2 0 z ðxÞ  6 ¼ 4zðxÞ: x

with the initial conditions

zð0Þ ¼ 0;

z0 ð0Þ ¼ 0

In Table 4.4, we introduce the maximum absolute error using SJC method at N = 12 with various choices of a and b. From this table, we can conclude that, the values of a ¼ b ¼ 0 and a ¼ b ¼  12 give the best accuracy among all the other values of a and b.

Table 4.3 Maximum absolute error using SJC method for N = 5, 10, 15, 20 for Example 2 (Case B). N

5

10

15

20

a

b

SJC method

3 2 1 2

3 2 1 2

2.60  105

0

0

6

3 2 1 2

3 2 1 2

0

0

3 2 1 2

3 2 1 2

0

0

3 2 1 2

3 2 1 2

0

0

1.21  105

MDM-CSCT [21] 2.37  105

6.99  10 7.23  109 1.53  109

6.18  106

1.86  1010 4.20  1013 6.66  1014

3.03  106

1.15  1014 4.49  1015 2.44  1015 2.38  1015

1.56  106

68

A.H. Bhrawy, A.S. Alofi / Commun Nonlinear Sci Numer Simulat 17 (2012) 62–70 Table 4.4 Maximum absolute error using SJC method for different values of a and b for Example 3.

a

b

SJC method at N = 12

a

b

SJC method at N = 12

9

9

2.90  1011

1 2

1.92  1016

9

0

1.29  1011

1 2 1 2

 12

2.22  1016

8

7

2.81  1011

1 2

2.22  1016

0

3

2.22  1016

 12 0

 12

2.22  1016

0

0

1.66  1016

 12

 12

1.66  1016

Table 4.5 Absolute error using SJC method for N = 10 for Example 4. x

SJC ða ¼ b ¼  12Þ

  SJC a ¼ 12 ; b ¼  12

  SJC a ¼  12 ; b ¼ 12

0 1 2 3 4 5 6 7 8 9 10

4.54  1013 4.54  1013 0 6.82  1013 0 1.13  1013 4.54  1013 0 0 0 0

1.13  1013 1.13  1013 5.68  1014 2.86  1014 5.68  1014 0 2.27  1013 0 0 0 0

1.81  1012 9.09  1013 9.09  1013 0 0 4.54  1013 4.54  1013 4.54  1013 4.54  1013 0 0

Example 4. Consider the non-homogeneous Lane–Emden type equation

8 u00 ðxÞ þ u0 ðxÞ þ xuðxÞ ¼ x5  x4 þ 44x2  30x; x

x 2 ½0; 10;

subject to the conditions

uð0Þ ¼ 0;

u0 ð0Þ ¼ 0;

which has the following analytical solution:

9000 8000

ux

7000 0,

0

6000

ux

5000 4000 3000 2000 1000 0 0

1

2

3

4

5

6

7

8

9

x Fig. 2. Comparing the approximate solution at a = b = 0 and the analytic solution of Example 4.

10

69

A.H. Bhrawy, A.S. Alofi / Commun Nonlinear Sci Numer Simulat 17 (2012) 62–70

9000 8000

ux

7000 1,

1

6000

ux

5000 4000 3000 2000 1000 0 0

1

2

3

4

5

6

7

8

9

10

x Fig. 3. Comparing the approximate solution at a = b = 1 and the analytic solution of Example 4.

uðxÞ ¼ x4  x3 : This type of equation has been solved by [4,23,25,35] with homotopy analysis, Hermite functions collocation, linearization and two steps adomian decomposition methods respectively. Table 4.5 lists the results obtained by the shifted Jacobi collocation method with a = b = 1/2 (first kind shifted Chebyshev collocation method), a = 1/2, b = 1/2 (third kind shifted Chebyshev collocation method) and a = 1/2, b = 1/2 (fourth kind shifted Chebyshev collocation method). The displayed results show that the SJC method is more accurate than HFC[23]. In the case of a = b = 0 and a = b = 1, the approximate solution by the presented method is shown in Figs. 2 and 3 respectively, to make it easier to compare with the analytic solution.

5. Conclusion The Lane–Emden type equations describe a variety of phenomena in theoretical physics and astrophysics, including the aspects of stellar structure, the thermal history of a spherical cloud of gas, isothermal gas spheres, and thermionic currents. An efficient and accurate numerical scheme based on the Jacobi–Gauss collocation spectral method is proposed for solving the nonlinear Lane–Emden type equations. The problem is reduced to the solution of nonlinear algebraic equations. Numerical examples were given to demonstrate the validity and applicability of the method. The results show that the SJC method is simple and accurate. In fact by selecting few collocation points, excellent numerical results are obtained. References [1] Adibi H, Rismani AM. On using a modified Legendre-spectral method for solving singular IVPs of Lane–Emden type. Comput Math Appl 2010;60:2126–30. [2] Agarwal RP, O’Regan D. Second order initial value problems of Lane–Emden type. Appl Math Lett 2007;20:1198–205. [3] Aslanov A. A generalization of the Lane–Emden equation. Int J Comput Math 2008;85:1709–25. [4] Bataineh AS, Noorani MSM, Hashim I. Homotopy analysis method for singular IVPs of Emden–Fowler type. Commun Nonlinear Sci Numer Simulat 2009;14:1121–31. [5] Bhrawy AH. Legendre–Galerkin method for sixth-order boundary value problems. J Egypt Math Soc 2009;17:173–88. [6] Bhrawy AH, El-Soubhy SI. Jacobi spectral Galerkin method for the integrated forms of second-order differential equations. Appl Math Comput 2010;217. [7] Canuto C, Hussaini MY, Quarteroni A, Zang TA. Spectral methods in fluid dynamics. New York: Springer; 1988. [8] Caglar H, Caglar N, Ozer M. B-spline solution of non-linear singular boundary value problems arising in physiology. Chaos Soliton Fract 2009;39:1232–7. [9] Chandrasekhar S. Introduction to the study of stellar structure. New York: Dover; 1967. [10] Chowdhury MSH, Hashim I. Solutions of a class of singular second-order IVPs by homotopy-perturbation method. Phys Lett A 2007;365:439–47. [11] Chowdhury MSH, Hashim I. Solutions of Emden–Fowler equations by homotopy-perturbation method. Nonlinear Anal-Real 2009;10:104–15. [12] Dehghan M, Shakeri F. Approximate solution of a differential equation arising in astrophysics using the variational iteration method. New Astron 2008;13:53–9.

70

A.H. Bhrawy, A.S. Alofi / Commun Nonlinear Sci Numer Simulat 17 (2012) 62–70

[13] Doha EH, Abd-Elhameed WM, Bhrawy AH. Efficient spectral ultraspherical-Galerkin algorithms for the direct solution of 2nd-order linear differential equations. Appl Math Model 2009;33:1982–96. [14] Doha EH, Bhrawy AH. Efficient spectral-Galerkin algorithms for direct solution for second-order differential equations using Jacobi polynomials. Numer Algorithms 2006;42:137–64. [15] Doha EH, Bhrawy AH. Efficient spectral-Galerkin Algorithms for direct solution of fourth-order differential equations using Jacobi polynomials. Appl Numer Math 2008;58:1224–44. [16] Doha EH, Bhrawy AH. A Jacobi spectral Galerkin method for the integrated forms of fourth-order elliptic differential equations. Numer Methods Partial Differential Eq 2009;25:712–39. [17] Fornberg B. A practical guide to pseudospectral methods. Cambridge, MA: Cambridge University Press; 1998. [18] Genga F, Cui M, Zhanga B. Method for solving nonlinear initial value problems by combining homotopy perturbation and reproducing kernel Hilbert space methods. Nonlinear Anal-Real 2010;11:637–44. [19] Guo B-y, Yan J-p. Legendre–Gauss collocation method for initial value problems of second order ordinary differential equations. Appl Numer Math 2009;59:1386–408. [20] Karimi Vanani S, Aminataei A. On the numerical solution of differential equations of Lane–Emden type. Comput Math Appl 2010;59:2815–20. [21] Khuri SA, Sayf A. A novel approach for the solution of a class of singular boundary value problems arising in physiology. Math Comput Model 2010;52:626–36. [22] Parand K, Pirkhedri A. Sinc-collocation method for solving astrophysics equations. New Astron 2010;15:533–7. [23] Parand K, Dehghan M, Rezaeia A, Ghaderi S. An approximation algorithm for the solution of the nonlinear Lane–Emden type equations arising in astrophysics using Hermite functions collocation method. Comput Phys Commun 2010;181:1096–108. [24] Peyret R. Spectral methods for incompressible viscous flow. New York: Springer; 2002. [25] Ramos JI. Linearization techniques for singular initial-value problems of ordinary differential equations. Appl Math Comput 2005;161:525–42. [26] Momoniat E, Harley C. An implicit series solution for a boundary value problem modelling a thermal explosion. Math Comput Model 2011;53:249–60. [27] Trefethen LN. Spectral methods in MATLAB. Philadelphia, PA: SIAM; 2000. [28] Yildirim A, Özi T. Solutions of singular IVPs of Lane–Emden type by homotopy perturbation method. Phys Lett A 2007;369:70–6. [29] Yildirim A, Özi T. Solutions of singular IVPs of Lane–Emden type by the variational iteration method. Nonlinear Anal-Theor 2009;70:2480–4. [30] Om PS, Rajesh KP, Vineet KS. An analytic algorithm of Lane–Emden type equations arising in astrophysics using modified homotopy analysis method. Comput Phys Commun 2009;180:1116–24. [31] Shawagfeh NT. Nonperturbative approximate solution for Lane–Emden equation. J Math Phys 1993;34:4364–9. [32] Shen T-T, Xing K-Z, Ma H-P. A Legendre Petrov–Galerkin method for fourth-order differential equations. Comput Math Appl 2011;61:8–16. [33] Van Gorder RA. An elegant perturbation solution for the Lane–Emden equation of the second kind. New Astron 2011;16:65–7. [34] Van Gorder RA, Vajravelu K. Analytic and numerical solutions to the Lane–Emden equation. Phys Lett A 2008;372:6060–5. [35] Zhang B-Q, Wu Q-B, Luo X-G. Experimentation with two-step Adomian decomposition method to solve evolution models. Appl Math Comput 2006;175:1495–502.