Nonlinear Engineering 2015; 4(4): 203–213

Firdous A. Shah and R. Abass Haar Operational Matrix Method for the Numerical Solution of Fractional Order Differential Equations

DOI 10.1515/nleng-2015-0025 istic modelling of a physical phenomenon having depen- Received October 1, 2015; accepted October 28, 2015. dence not only at the time instant but also the previous time history. In fact, recent advances of fractional calcu- Abstract: In this paper, we propose a new operational ma- lus are dominated by modern examples of applications trix method of fractional order integration based on Haar in differential and integral equations, plasma physics, im- to solve fractional order differential equations age and signal processing, fluid mechanics, viscoelastic- numerically. The properties of Haar wavelets are first pre- ity, mathematical biology, electrochemistry and even fi- sented. The properties of Haar wavelets are used to reduce nance and social sciences. There is no doubt that frac- the system of fractional order differential equations to a tional calculus has become an exciting new mathematical system of algebraic equations which can be solved numeri- method of solution of diverse problems in mathematics, cally by Newton’s method. Moreover, the proposed method science, and engineering. For more details on fractional is derived without using the block pulse functions consid- calculus and its applications, we refer to the monographs ered in open literature and does not require the inverse [3–6]. of the Haar matrices. Numerical examples are included to Owing to the increasing number of applications, con- demonstrate the validity and applicability of the present siderable attention has been paid in developing the nu- method. merical methods for the solution of fractional differential Keywords: Haar wavelet; Fractional order differential equations. Due to the complex structure of fractional dif- equations; Haar matrix; Operational matrix; Error analy- ferential equations, it is not easy to derive the analyti- sis cal or exact solutions to most of the fractional differen- tial equations. However, many numerical methods have MSC: 26A33; 34K37; 34A08; 42C40; 42C15 been developed in recent years to solve fractional differ- ential equations, such as Laplace transform method [6], Adomian decomposition method [7], fractional iteration 1 Introduction method [8], variational iteration method [9], differential transform method [10], generalized differential transform method [11], finite difference method [12], Kernel reproduc- Fractional calculus is the field of mathematical analysis ing method [13] and operational methods [14, 15]. In ad- which deals with the investigation and applications of in- dition to the above methods, several simple and accurate tegrals and of arbitrary order. In comparison methods based on orthogonal functions have also been with integer order differential equations, the fractional dif- applied for the numerical solutions of ordinary and par- ferential equations show many advantages over the simu- tial differential equations of fractional order. The most fre- lation of natural physical processes and dynamic systems quently used orthogonal functions are sine-cosine func- [1–3]. During the past several decades fractional calculus tions, Walsh functions, block pulse functions, B-splines, has blossomed and grown in pure mathematics as well as Legendre, Laguerre and Chebyshev orthonormal sets of in scientific applications because of the fact that, a real- functions. Wavelet analysis is the new addition to the orthogo- nal basis functions which is becoming increasingly popu- Firdous A. Shah: Department of Mathematics, University of Kash- lar in the field of numerical approximations. The main ad- mir, South Campus, Anantnag-192 101, Jammu and Kashmir, India. vantage of using wavelet basis functions is that the prob- E-mail: [email protected] R. Abass: Department of Mathematical Sciences, BGSB Univer- lem under consideration is reduced to a system of linear sity, Rajouri-185234, Jammu and Kashmir, India. E-mail: rustam- or nonlinear algebraic equations [4]. Another advantage [email protected] 204 Ë Firdous A. Shah and R. Abass, Haar Wavelet Operational Matrix Method of wavelet based methods is their simple procedure, easy mathematical preliminaries of fractional calculus. Section computation and rapid convergence which is due to their 3 depicts the fundamentals of Haar wavelets as construc- excellent properties such as ability to detect singularities, tion of wavelets, its properties and operational matrix of , flexibility to represent a function at differ- as a working tool. In Section 4, we derive the ent levels of resolution, and compact support. For more Haar wavelet operational matrix of fractional order inte- details about wavelets and their promising applications, gration without using the block pulse functions. In Section we refer to the monographs [16, 17]. 5, we demonstrate the efficiency and accuracy of the pro- Different types of wavelet families have been used posed scheme by considering several numerical examples. in numerical solution of fractional differential equations. Finally, a conclusion is given in Section 6. Among all the wavelet families the Haar wavelets deserve special attention. They are made up of pairs of piece- wise constant functions and are therefore mathematically 2 Basic Definitions of Fractional the simplest of all the wavelet families. Haar wavelets are preferred due to their useful properties such as simple Calculus applicability, orthogonality and compact support. Com- pact support of the Haar-wavelet basis permits straight in- clusion of the different types of boundary conditions in In this section, we give some necessary definitions and the numerical algorithms. Another good feature of these mathematical preliminaries of the fractional calculus the- wavelets is the possibility to integrate them analytically ory which are required for establishing our results. in arbitrary times. However, the major drawback of these wavelets is their discontinuity; since the derivatives do not Definition 2.1. The Riemann-Liouville fractional integra- exist at the partition points, so the integration approach is tion operator of order α ≥ 0 of a function f(t) is defined preferred instead of the differentiation for calculation of as the coefficients. By keeping all these advantages in con- sideration, Li and Zhao [18] have successfully applied the t 1 ∫︁ Jα f(t) = (t − τ)α−1f(τ) dτ, t > 0, (2.1) Haar wavelet operational matrix of fractional order inte- Γ(α) gration to solve fractional differential equations numer- 0 ically, whereas Ray [19] has applied the same technique to find the numerical solution of fractional Bagley-Torvik where Γ(.) is the well-know gamma function, and some α equation. Later on Wang et al.[20] have obtained sufficient properties of the operator J are given as follows: conditions for the existence and uniqueness of solutions (i) Jα Jβ f(t) = Jα+β f (t), α, β > 0; for a class of fractional partial differential equations using α β β α Haar wavelet operational matrix of fractional order inte- (ii) J J f(t) = J J f(t), α, β > 0; gration. All of the above Haar wavelet methods consider Γ(1 + β) (iii) Jα tβ = tα+β , β > −1. block pulse functions to obtain the operational matrices Γ(1 + α + β) of fractional order integration. Recent results in this direc- tion can be found in [21, 22] and the references their in. The Riemann-Liouville derivative has certain disadvan- In this paper, we propose a new Haar wavelet method tages when trying to model real world phenomena with based on operational matrices of fractional order integra- fractional differential equations. Therefore, we shall in- tion to solve several types of fractional order differential troduce a modified fractional differential operator Dα pro- equations numerically. The proposed method is different posed by Caputo in his work on the theory of visco- from the existing wavelet based methods in the following elasticity [1]. ways: (i) the operational matrices of fractional order inte- gration were formed without using the block pulse func- Definition 2.2. The Caputo fractional derivative of Dα of a tions, (ii) it does not require to calculate the inverse of Haar function f(t) is defined as wavelet matrix, (iii) less CPU time is needed in this method t as the major blocks of Haar wavelet operational matrix are 1 ∫︁ f m(τ) Dα f (t) = dτ, (2.2) calculated once and, are used in the subsequent computa- Γ(m − α) (t − τ)α−m+1 tions repeatedly. 0 The organization of the rest of the paper is as follows. In Section 2, we introduce some necessary definitions and Firdous A. Shah and R. Abass, Haar Wavelet Operational Matrix Method Ë 205 where m − 1 < α ≤ m, m ∈ N. Caputo fractional derivative ensures that the wavelet function has unit energy. More first computes an ordinary derivative followed by a frac- precisely, wavelets are defined as tional integral to achieve the desired order of fractional 1 (︂ t − b )︂ derivative. ψ (t) = √ ψ , a ≠ 0, b ∈ , (3.1) a,b a a R Similar to integer-order differentiation, Caputo frac- where a and b represents the dilation and translation pa- tional derivative operator is a linear operation rameters, respectively. Small values of a represent high fre- Dα(︀훾f(t) + δg(t))︀ = 훾Dα f (t) + δDα g(t), quency components of the signal while large values of a represent low frequency components of the signal. More- over, when the parameters a and b are restricted to discrete where 훾 and δ are constants. The Caputo fractional deriva- −j −j values as a = a , b = kb0a , a0 > 0, b0 > 0, we have the tive also satisfies the following basic properties: 0 0 following family of discrete wavelets: α β Γ(1 + β) β−α (i) D t = t , 0 < α < β + 1, β > −1; j/2 (︁ j )︁ Γ(1 + β − α) ψj,k(t) = |a0| ψ a0t − kb0 , (3.2)

m−1 ∑︁ tk 2 (ii) Jα Dα f(t) = f(t)− f k(0+) , m−1 < α ≤ m, m ∈ ; where ψj,k forms a wavelet basis for L (R). In particular, k! N k=0 when a0 = 2 and b0 = 1, the functions ψj,k form an or- ⟨︀ ⟩︀ thonormal basis. That is, ψ , ψm,n = δ δ . (iii) Dα C = 0, C is a constant. j,k j,m k,n One of the most useful methods to construct wavelet basis is through the concept of multiresolution analysis In the present study, the fractional derivatives are (MRA) introduced by Mallat [23]. This is a remarkable idea considered in the Caputo sense because to obtain a unique which deals with a general formalism for construction of solution of a fractional differential equation, we need to an orthogonal basis of wavelets. Indeed, MRA is central to specify additional conditions. For the case of the Caputo all constructions of wavelet basis. Mathematically, an MRA fractional differential equations, these additional condi- {︀ }︀ is an increasing family of closed subspaces Vj : j ∈ Z tions are just the traditional conditions, which are alike to 2 of L (R) satisfying the properties (i) Vj ⊂ Vj+1, j ∈ Z, those of classical differential equations, and are therefore ⋃︀ 2 ⋂︀ (ii) ∈ Vj is dense in L (R) and ∈ Vj = {0} , (iii) familiar to us. For more details, we refer to [2,5,6]. j Z j Z f(t) ∈ Vj if and only if f (2t) ∈ Vj+1, and (iv) there is a function ϕ ∈ V0 called the scaling function, such that {︀ }︀ ϕ(t − k): k ∈ Z form an for V0. In 3 Construction of Haar Wavelets view of the translation invariant property (iv), it is possi- ble to generate a set of functions ϕj,k in Vj , j ∈ Z, such {︁ j/2 j }︁ In this section, we first briefly review the multiresolution that ϕj,k = 2 ϕ(2 t − k): j, k ∈ Z forms an orthonor- analysis which will be used for constructing orthonormal mal basis for Vj , j ∈ Z. wavelets and then introduce Haar wavelets as a type of or- Let Wj , j ∈ Z be the complementary subspaces thonormal wavelets. of Vj in Vj+1. These subspaces inherit the scaling prop- {︀ }︀ Wavelet analysis is a fairly recent origin but very use- erty of Vj : j ∈ Z , namely f (t) ∈ Wj if and only ful and powerful mathematical method. The transform has if f (2t) ∈ Wj+1. By virtue of this property, one can {︀ }︀ been formalized into a rigorous mathematical framework find a function ψ ∈ W0 such that ψ(x − k): k ∈ Z 2 and has found applications in diverse fields such as har- constitutes an orthonormal basis for L (R), and hence, {︁ j/2 j }︁ monic analysis, signal and image processing, differential ψj,k = 2 ψ(2 x − k): j, k ∈ Z will form an orthonor- and integral equations, sampling theory, turbulence, geo- mal basis for the subspaces Wj , j ∈ Z. Since, Wj’s are 2 physics, statistics, economics and finance and medicine. dense in L (R), therefore, it follows that the collection of A wavelet can be described as a real-valued function ψ(t) functions {ψj,k : j, k ∈ Z} will form an orthonormal ba- 2 that satisfies the conditions: sis for L (R). It is called an orthonormal wavelet basis with ∞ ∞ ∫︁ ∫︁ mother wavelet ψ. For the theoretical and mathematical ⃒ ⃒2 ψ(t) dt = 0, and ⃒ψ(t)⃒ dt = 1. treatment of wavelets, the reader is referred to [16]. −∞ −∞ The Haar wavelet function was introduced by Alfred Haar in 1910 in the form of a regular pulse pair. The Haar The first condition means that ψ(t) must be an oscil- wavelet is the simplest and oldest orthonormal wavelet latory function with zero mean and the second condition having compact support in [0, 1]. The basic and simplest 206 Ë Firdous A. Shah and R. Abass, Haar Wavelet Operational Matrix Method form of Haar wavelet is the Haar scaling function that ap- In usual, the series expansion of (3.8) contains in- pears in the form of a square wave over the interval t ∈ finite terms for a general smooth function y(t). However, [0, 1) as if y(t) is approximated as piecewise constant during each ⎧ 1, for 0 ≤ t < 1, ⎨⎪ sub-interval of [0, 1), then the sum in (3.8) will be termi- h0(t) = (3.3) nated after m terms and consequently, we can write the ⎩⎪ 0, elsewhere. discrete version in the matrix form as

The above expression, called father wavelet, is the m−1 ∑︁ T zeroth level wavelet which has no displacement and dila- Y ≈ ci hi(t) = Cm Hm , (3.9) tion of unit magnitude. Correspondingly, there is a mother i=0 wavelet to match the father wavelet which is described as T where both Y and Cm = [c0, c1, ... , cm−1] are the m- ⎧ 1 dimensional row vectors. Furthermore, H is the Haar ⎪ 1, 0 ≤ t < , m ⎪ 2 wavelet matrix of order m = 2M , M ∈ + and is defined ⎪ 1 Z ⎨ −1, ≤ t < 1, T h1(t) = 2 (3.4) by Hm = [h0, h1, ... , hm−1] ; that is, ⎪ ⎪ ⎡ h ⎤ ⎡ h h . . . h ⎤ ⎩⎪ 0, elsewhere. 0 0,0 0,1 0,m−1 ⎢ h ⎥ ⎢ h h . . . h ⎥ ⎢ 1 ⎥ ⎢ 1,0 1,1 1,m−1 ⎥ This mother wavelet can also be written as the linear Hm = ⎢ . ⎥ = ⎢ . . . . ⎥ , ⎢ . ⎥ ⎢ . . . . ⎥ combination of the Haar scaling function with translation ⎣ ⎦ ⎣ ⎦ h h h . . . h and compression to half of its original interval. m−1 m−1,0 m−1,1 m−1,m−1 (3.10) where h0, h1, ... , hm−1 are the discrete form of the Haar h1(t) = h0(2t) − h0(2t − 1). (3.5) wavelet bases. For Haar wavelet approximations, the fol- Similarly, the other levels of wavelets can all be gen- lowing collocation points are considered: erated from h (t) by the combined operations of transla- 1 ℓ − 0.5 t = , ℓ = 1, 2, ... , m. (3.11) tion and dilations. The general formula for the family of ℓ m Haar wavelets can be written as Assume that y(t) satisfies a Lipschitz condition on ⎧ k k + 0.5 1, ≤ t < [0, 1], there exist positive number A > 0, such that ⎪ j j ⎪ 2 2 ⃒ ⃒ ⎪ ⃒y(t1) − y(t2)⃒ ≤ A|t1 − t2|, ∀ t1, t2 ∈ [0, 1], where A is ⎨⎪ j k + 0.5 k + 1 the Lipschitz constant. Therefore, the Haar approximation hi(t) = hi(2 t − k) = −1, ≤ t < ⎪ 2j 2j ym(t) of y(t) is given by ⎪ ⎪ ⎪ m−1 ⎩ 0, elsewhere ∑︁ y (t) = c h (t), m = 2p+1, p = 0, 1, 2, ... , M. (3.6) m i i M i=0 where i = 1, 2, ... , m − 1, m = 2 and M is a positive (3.12) integer which is called the maximum level of resolution. Then, the corresponding error at mth level may be Here, j and k represent the integer decomposition of the defined as index i; that is, i = k +2j −1, 0 ≤ j < i and 1 ≤ k < 2j +1. For ⃦ m−1 ⃦ ⃦ ∞ ⃦ more about Haar wavelets and their applications, we refer ⃦ ⃦ ⃦ ∑︁ ⃦ ⃦ ∑︁ ⃦ ⃦y(t) − ym(t)⃦ = ⃦y(t) − ci hi(t)⃦ = ⃦ ci hi(t)⃦ . to the monographs [16, 17]. 2 ⃦ ⃦ ⃦ ⃦ ⃦ i=0 ⃦2 ⃦i=2p+1 ⃦2 For any function y(t) ∈ L2[0, 1] can be represented (3.13) in term of the Haar basis as We can analyze the error for fractional order differen- tial equations, if we know the exact solution of these equa- ∞ tions. Convergence of the method may be discussed on the ∑︁ y(t) = c0h0(t) + c1h1(t) + c2h2(t) + ··· = ci hi(t), (3.7) same lines as given in Yi and Huang [33]. i=0 Theorem 3.1. Suppose y(t) satisfies the Lipschitz condi- tion on [0, 1] and ym(t) are the Haar approximations of where the Haar coefficients ci , i = 0, 1, 2, ... , are given by y(t), then we have the error bound as follows 1 ∫︁ ⃦ ⃦ A c = ⟨y, h ⟩ = y(t)h (t) dt. (3.8) ⃦y(t) − ym(t)⃦ ≤ √ . i i i 2 3 m2 0 Firdous A. Shah and R. Abass, Haar Wavelet Operational Matrix Method Ë 207

4 Operational Matrix of the General Order Integration

Although, Haar wavelets have some promising features but the major drawback of these wavelets is their discontinuity at the breaking points, so it is not possible to apply the Haar wavelets for solving differential equations directly. To overcome this disadvantage, Chen and Hsiao [3] introduced the notion of operational matrix approach based on Walsh functions in the context of wavelet analysis. The main characteristic of the operational method is that it reduces the system of differential equations into a system of algebraic equations and thus greatly simplifying the problem. Thus, [︀ ]︀T the integration of the vector Hm(t) = h0(t), h1(t), ... , hm−1(t) can be approximated by Chen and Hsiao [3] t ∫︁ Hm(τ)dτ ∼= QHm(t), (4.1) 0 where Q is called the Haar wavelet operational matrix of integration of order m. Yi et al. [22] proposed a new method to derive the operational matrices of integration and differentiation for all orthogonal functions using block pulse func- tions in a unified framework. We shall derive the Haar wavelet operational matrix of general order integration without using the block pulse functions and to do so, we may make use of the Definition 2.1. The Haar operational matrix of fractional order integration Qα is given by α α [︀ α α α ]︀T [︀ ]︀T Q Hm(t) = J Hm(t) = J h0(t), J h1(t), ... , J hm−1(t) = Qh0(t), Qh1(t), ... , Qhm−1(t) , (4.2) where 1 tα Qh (t) = √ , t ∈ [0, 1], (4.3) 0 m Γ(1 + α) ⎧ k − 1 ⎪ 0, 0 ≤ t < j ⎪ 2 ⎪ ⎪ ⎪ k − 1 k − 0.5 ⎪ j/2 ⎪ 2 ϕ1(t), j ≤ t < j 1 ⎨⎪ 2 2 Qhi(t) = √ , (4.4) m ⎪ k − 0.5 k ⎪ 2j/2ϕ (t), ≤ t < ⎪ 2 j j ⎪ 2 2 ⎪ ⎪ ⎪ k ⎩⎪ 2j/2ϕ (t), ≤ t < 1 3 2j 1 (︂ k − 1)︂α 1 (︂ k − 1)︂α 2 (︂ k − 0.5)︂α ϕ (t) = t − , ϕ (t) = t − − t − , 1 Γ(α + 1) 2j 2 Γ(α + 1) 2j Γ(α + 1) 2j 1 (︂ k − 1)︂α 2 (︂ k − 0.5)︂α 1 (︂ k )︂α ϕ (t) = t − − t − + t − . 3 Γ(α + 1) 2j Γ(α + 1) 2j Γ(α + 1) 2j For instance, if α = 1.5, m = 4 and m = 8, we have ⎡0.0166 0.0864 0.1858 0.3079⎤ ⎢ ⎥ 1.5 ⎢0.0166 0.0864 0.1526 0.1351⎥ Q H4 = ⎢ ⎥ , ⎣0.0235 0.0751 0.0420 0.0319⎦ 0 0 0.0235 0.0751

⎡0.0042 0.0216 0.0465 0.0770 0.1122 0.1516 0.1948 0.2414⎤ ⎢0.0042 0.0216 0.0465 0.0770 0.1039 0.1084 0.1019 0.0875⎥ ⎢ ⎥ ⎢ ⎥ ⎢0.0059 0.0305 0.0540 0.0478 0.0331 0.0273 0.0238 0.0214⎥ ⎢ ⎥ 1.5 ⎢ 0 0 0 0 0.0059 0.0305 0.0540 0.0478⎥ Q H8 = ⎢ ⎥ . ⎢0.0083 0.0266 0.0149 0.0113 0.0095 0.0083 0.0075 0.0069⎥ ⎢ ⎥ ⎢ ⎥ ⎢ 0 0 0.0083 0.0266 0.0149 0.0113 0.0095 0.0083⎥ ⎢ ⎥ ⎣ 0 0 0 0 0.0083 0.0266 0.0149 0.0113⎦ 0 0 0 0 0 0 0.0083 0.0266 208 Ë Firdous A. Shah and R. Abass, Haar Wavelet Operational Matrix Method

5 Numerical Examples

In this section, we will use the Haar wavelet operational matrix of general order integration to solve several types of fractional differential equations which arises in different disciplines of applied science and engineering. To demon- strate the efficiency and the practicability of this method, we consider five fractional order differential equations in- cluding the Bagley-Torvik equation. All results are com- puted by MAPPLE 14 and MATLAB R2009b which are re- ported in Figs. 1-5 and Tables 1-5. Example 5.1. Consider the following fractional order dif- ferential equation Fig. 1: Comparison of numerical and exact solution at m = 64. D2y(t) − 2Dy(t) + D1/2y(t) + y(t) = f (t), ′ y(0) = y (0) = 0, 0 < t < 1, (5.1) Example 5.2. Consider the fractional order differential where equation with variable coefficients 2 16 5/2 3 f(t) = 6t − 6t + √ t + t . (5.2) 1 1 5 π D5/2y(t) + D3/2y(t) + y(t) + y(t) = f (t), t + 1 4(t + 1)3/2 The exact solution for this equation is y(t) = t3. Let 0 < t < 1 (5.9)

2 T √ D y(t) = C Hm(t). (5.3) √ π √ with conditions y(0) = π, y′(0) = , and y(1) = 2π, 2 together with the initial states, then we have where (t + π)1/2 1/2 T 3/2 f(t) = . (5.10) D y(t) = Cm Q Hm(t) (5.4) 4(t + 1) Dy(t) = CT Q1 H (t) + y′(0) (5.5) m m √︀ T 2 ′ The exact solution of Eq.(5.9) is y(t) = π(t + 1). Consider y(t) = Cm Q Hm(t) + t y (0) + y(0). (5.6) 5/2 T D y(t) = C Hm(t) (5.11) Similarly, the input signal f(t) may be expanded by the Haar functions as follows: with given initial states, we have

T 3/2 T 5/2 f(t) = fm Hm(t), (5.7) D y(t) = Cm Q Hm(t) (5.12) T 5/2 ′ T y(t) = C Q Hm(t) + ty (0) + y(0). (5.13) where fm is a known constant vector. Substituting m Eq. (5.3)–(5.7) and initial conditions in Eq. (5.1), we obtain Similarly, the input signal f (t) can be expanded by the the system of algebraic equation as Haar wavelets as follows: T T 1 T 3/2 T 2 Cm Hm(t) − 2Cm Q Hm(t) + Cm Q Hm(t) + Cm Q Hm(t) T f (t) = fm Hm(t), (5.14) T = fm Hm(t). (5.8) T where fm is a known constant vector. Substituting Thus, Eq. (5.8) has been transformed into a system Eqs.(5.11)–(5.14) with initial conditions in Eq.(5.9), we ob- of algebraic equations. Solving these algebraic equations, tain the system of algebraic equation as T we can obtain the unknown vector Cm. Using Eq. (5.6), we T 1 T 1 1 T 5/2 can get the output response y(t). The approximate solu- C Hm(t) + C Q Hm(t) + C Q Hm(t)+ m t + 1 m 4(t + 1) m tions of Eq. (5.1) for different values of m = 8, 16, 32, 64 √ √ t π π T are presented in Table 1 and graphically shown in Figure + = f Hm(t). (5.15) 8(t + 1)3/2 4(t + 1)3/2 m 1. Figure 1 shows that the approximate solution is in a very −1 1 good agreement with the exact solution. The coefficients of equation (5.15), (t + 1) and 4 (t + −1 −1 1 −1 1) can be dispersed into (ti + 1) and 4 (ti + 1) , i = 1, 2, ... , m − 1. Let Firdous A. Shah and R. Abass, Haar Wavelet Operational Matrix Method Ë 209

Table 1: The absolute errors for different values m.

t m=4 m=8 m=16 m=32 m=64 Ref[24] Exact

0.1 0.0009892 0.0002296 0.0000545 1.3900e-005 3.5200e-006 0.2544e-4 0.0010000 0.2 0.0020716 0.0004946 0.0001250 3.1900e-005 7.9410e-006 0.4131e-3 0.0080000 0.3 0.0033559 0.0008632 0.0002139 5.3200e-005 1.3333e-005 0.2118e-2 0.0270000 0.4 0.0049511 0.0012572 0.0003178 7.9300e-005 1.9790e-005 0.6771e-2 0.0640000 0.5 0.0069641 0.0017443 0.0004369 0.0001094 2.7381e-005 0.1669e-1 0.1250000 0.6 0.0092647 0.0023030 0.0005744 0.0001441 3.6121e-005 0.3487e-1 0.2160000 0.7 0.0117196 0.0029146 0.0007327 0.0001839 4.6221e-005 0.6500e-1 0.3430000 0.8 0.0144268 0.0036417 0.0009108 0.0002278 5.7070e-005 0.1114129 0.5120000 0.9 0.0174792 0.0044032 0.0011071 0.0002771 6.9340e-005 0.1790046 0.7290000

⎡ 1 ⎤ 0 ... 0 ⎢ t0 + 1 ⎥ ⎢ 1 ⎥ ⎢ 0 ... 0 ⎥ ⎢ t + 1 ⎥ ⎢ 1 ⎥ ⎢ ⎥ A = ⎢ ⎥ , ⎢ . . . . ⎥ ⎢ . . . . ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎣ 1 ⎦ 0 0 ... tm−1 + 1 ⎡ 1 ⎤ 0 ... 0 ⎢ t0 + 1 ⎥ ⎢ 1 ⎥ ⎢ 0 ... 0 ⎥ ⎢ t + 1 ⎥ ⎢ 1 ⎥ 1 ⎢ ⎥ B = ⎢ ⎥ . 4 ⎢ . . . . ⎥ ⎢ . . . . ⎥ Fig. 2: Comparison of numerical and exact solution at m = 64. ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎣ 1 ⎦ 0 0 ... where tm−1 + 1 f (t) = sin(t). By discretization, Eq. (5.15) can be written as √ We applied the Haar wavelet operational matrix method to T T 1 T 5/2 t π Cm Hm(t) + ACm Q Hm(t) + BCm Q Hm(t) + solve Eq. (5.17) for α=1. The exact solution of the problem 8(t + 1)3/2 −t √ at α=1 is y(t) = −0.5 cos(t) + 0.5 sin(t) + 0.5 e . π T + = fm Hm(t). (5.16) Let 4(t + 1)3/2 α T D y(t) = Cm Hm(t), (5.18) Thus, we transform Eq. (5.16) into the system of algebraic together with the initial condition, then we have equations. Solving the system of algebraic equations, we T T α obtain the vector Cm. Then, using Eq. (5.13), we can get the y(t) = Cm Q Hm(t) + y(0). (5.19) approximate solution of (5.9). The approximate solutions of given equation for m = 8, 16, 32, 64 are presented in Moreover, the given signal f (t) can also be expanded by Table 2 and graphically shown in Figure 2. From the Table Haar wavelet series as 2, it can be seen that by applying more number of Haar f (t) = f T H (t). (5.20) wavelets, a good approximate solution for this problem m m can be obtained. Substituting Eqs. (5.18)–(5.20) in Eq.(5.17), we get Example 5.3. Consider the inhomogeneous nonlinear fractional differential equation T T α T Cm Hm(t) + Cm Q Hm(t) + y(0) = fm Hm(t). (5.21) Dα y(t) + y(t) = f(t), 0 < α ≤ 1, y(0) = 0, 0 < t < 1 Solving this system of algebraic equations, we obtain the T (5.17) unknown wavelet coefficient vector Cm. By substituting 210 Ë Firdous A. Shah and R. Abass, Haar Wavelet Operational Matrix Method

Table 2: The absolute errors for different values m.

t m=4 m=8 m=16 m=32 m=64 Exact

0.1 0.0307379 0.00025327 2.0664e-004 5.2033e-005 2.2630e-006 1.858965 0.2 0.0110791 0.00041345 1.1572e-004 4.3263e-005 3.1931e-006 1.941626 0.3 0.0201005 0.00074638 4.2869e-004 6.3305e-005 4.8943e-006 2.020908 0.4 0.0331187 0.00085588 8.1239e-005 1.2130e-006 5.2344e-006 2.097196 0.5 0.0811954 0.00073611 6.7288e-004 3.2927e-005 3.5427e-006 2.170804 0.6 0.0512804 0.00089023 3.6502e-004 6.1465e-005 5.2737e-006 2.241996 0.7 0.0037122 0.00074921 3.7013e-005 5.5032e-006 2.3165e-006 2.310997 0.8 0.0052735 0.00078344 2.7113e-004 7.1042e-005 6.3099e-006 2.377996 0.9 0.0045873 0.00067210 4.3204e-004 2.5523e-005 5.6571e-006 2.443159 these wavelet coefficient vector in Eq.(5.19), we get theap- together with the initial condition, then we have proximate solution of Eq.(5.17). The numerical result are T 3/2 ′ presented in Table 3 and graphically shown in Figure 3. y(t) = Cm Q Hm(t) + ty (0) + y(0). (5.24) From this figure, we can conclude that our approximate The representation of f(t) by means of the Haar wavelets solution is in an excellent agreement with the exact val- is given by ues and more accurate results can be obtained by using a T f (t) = f Hm(t). (5.25) larger m. m Substituting Eqs. (5.23)–(5.25) in Eq. (5.22), we get

T T 3/2 T Cm Hm(t) + Cm Q Hm(t) = fm Hm(t). (5.26)

Therefore, Eq. (5.26) has been transformed into a system of algebraic equations. By solving these equations, we may T obtain the unknown wavelet coefficient vector Cm. By sub- stituting these wavelet coefficient vector in Eq.(5.24), we shall get the approximate solution of Eq.(5.22). The abso- lute errors with comparison to the exact solution are given in Table 4 and graphically shown in Figure 4. From the given Table 3, we observe that the approximate solution provided by the proposed method has an excellent agree- ment with the exact values.

Fig. 3: Numerical and exact solutions for m = 64.

Example 5.4. Consider the fractional differential equation

D3/2y(t) + y(t) = f(t), y(0) = y′(0) = 0, 0 < t < 1 , (5.22) where 5.8905 f(t) = t5/2 + √ t. π The exact solution of the problem is y(t) = t5/2. Let 3/2 T D y(t) = Cm Hm(t), (5.23) Fig. 4: Numerical and exact solutions for m = 64. Firdous A. Shah and R. Abass, Haar Wavelet Operational Matrix Method Ë 211

Table 3: The absolute errors for different values m.

t m=4 m=8 m=16 m=32 m=64 Exact

0.1 1.0452e-003 3.9554e-004 6.2683e-005 2.4550e-005 3.9551e-006 0.0048333 0.2 1.3206e-003 1.9641e-004 8.1062e-005 1.2571e-005 5.0845e-006 0.0186667 0.3 1.0431e-003 1.5838e-004 6.6202e-005 9.5868e-006 4.1178e-006 0.0405009 0.4 4.2916e-004 2.0679e-004 2.9150e-005 1.3065e-005 1.7837e-006 0.0693387 0.5 3.0731e-004 7.6596e-005 1.9134e-005 4.7827e-006 1.1956e-006 0.1041868 0.6 2.3656e-004 1.1659e-004 1.2363e-005 7.1317e-006 8.0944e-007 0.1440592 0.7 3.1646e-004 2.3110e-005 1.8527e-005 1.7331e-006 1.1758e-006 0.1879804 0.8 1.4632e-004 1.0123e-005 1.0219e-005 3.4688e-007 6.2067e-007 0.2349892 0.9 6.8368e-005 7.3583e-006 2.0696e-006 5.9524e-007 1.6395e-007 0.2841433

Table 4: The absolute errors for different values m.

t m=4 m=8 m=16 m=32 m=64 Exact

0.1 1.7444e-003 4.3597e-004 8.5678e-005 2.4177e-005 3.5200e-006 0.00316227 0.2 2.3958e-003 4.6877e-004 1.3299e-004 3.3988e-005 7.9410e-006 0.01788854 0.3 2.5239e-003 6.5568e-004 1.6446e-004 3.7140e-005 1.3333e-005 0.04929503 0.4 2.4081e-003 6.9440e-004 1.7821e-004 4.4827e-005 1.9790e-005 0.10119288 0.5 2.5252e-003 6.6319e-004 1.7153e-004 4.4125e-005 2.7381e-005 0.17677669 0.6 3.2058e-003 8.0889e-004 1.8039e-004 4.8475e-005 3.6121e-005 0.27885480 0.7 3.3457e-003 7.1310e-004 1.9574e-004 5.0480e-005 4.6221e-005 0.40996341 0.8 3.1013e-003 8.0699e-004 2.0416e-004 4.8070e-005 5.7070e-005 0.57243340 0.9 2.6882e-003 7.7154e-004 1.9958e-004 5.1381e-005 6.9340e-005 0.76843347

Table 5: The absolute errors for different values m.

t m=4 m=8 m=16 m=32 m=64 Exact 0.1 0.0007357 0.00015125 3.0884e-005 6.8041e-006 1.3625e-006 0.00100 0.2 0.0010791 0.00020388 4.0563e-005 6.4464e-006 2.0841e-007 0.00800 0.3 0.0011925 0.00024073 3.2658e-005 6.0500e-007 2.9951e-006 0.02699 0.4 0.0011967 0.00018726 8.0217e-006 1.2339e-005 7.9890e-006 0.06398 0.5 0.0012024 0.00011321 3.3176e-005 2.9228e-005 1.4572e-005 0.12499 0.6 0.0010813 0.00084729 8.7403e-005 5.0458e-005 2.2625e-005 0.21598 0.7 0.0007035 0.00017485 0.000151290 7.5263e-005 3.2045e-005 0.34297 0.8 0.0001724 0.00034113 0.000225213 0.000104287 4.2679e-005 0.51196 0.9 0.0004093 0.00057878 0.000309616 0.000135866 5.4381e-005 0.72895

Example 5.5. Consider the following general form of the with y(0) = y′(0) = 0, and Bagley-Torvik equation 8 f (t) = t3 + 6t + t3/2. Γ(︀ 1 )︀ D2y(t) + AD3/2y(t) + By(t) = f(t), 2 ′ y(0) = 0, y (0) = 0, 0 < t < 1 (5.27) The accuracy solution in this case is given by y(t) = t3. Let

2 2 T where D y(t) is a function describing the displacement D y(t) = Cm Hm(t), (5.28) of the plate, A, B are real coefficients depending on vari- together with the initial states, we have ous parameters such as mass and area of the plate, stiff- 3/2 T 3/2 ness of spring, fluid density, and f(t) is an external force. D y(t) = Cm Q Hm(t) (5.29) The existence and uniqueness of the exact solution of T 1 ′ Dy(t) = Cm Q Hm(t) + y (0) (5.30) the above equation has been briefly discussed by Pod- T 2 lubny in [6]. Here, we consider the case A = 1, B = 1 y(t) = Cm Q Hm(t) + t y(0) + y(0). (5.31) 212 Ë Firdous A. Shah and R. Abass, Haar Wavelet Operational Matrix Method

Similarly, the Haar series of expansion of f (t) is given by so that the computation is simple and it is computer ori- ented; (iv) it is much effective than the conventional nu- f (t) = f T H (t), (5.32) m m merical method for fractional order differential equations. T The illustrative examples have been included to demon- where fm is a known constant vector. Substituting Eqs.(5.28)–(5.32) in Eq.(5.27), we obtain the system of al- strate the validity and applicability of the present algo- gebraic equation as rithm. The achieved results are compared with exact so- lutions and with the solutions obtained by some other nu- T T 1/2 T 2 T Cm Hm(t) + Cm Q Hm(t) + Cm Q Hm(t) = fm Hm(t). merical methods. These examples inferred that proposed (5.33) method is reliable, effective and accurate. Moreover, the Solving the system of algebraic equations, we obtain the present method is expected to be further employed to solve T vector Cm. By substituting this vector in (5.31), we can get other similar problems. the approximate solution of Eq. (5.27). The numerical so- lutions obtained by the Haar wavelet operational matrix method is given in the Table 5. Clearly, the approximations obtained by the proposed method are in agreement with References exact solutions. The numerical result for m = 64 is shown [1] M. Caputo, Linear models of dissipation whose Q is almost in Figure 5. frequency independent-II, J. Royal Austral. Soc., 13, 1967, 529- 539. [2] A. Carpinteri, F. Mainardi, Fractals and Fractional Calculus in Continuum Mechanics, Springer, New York, 1997. [3] F.C. Chen, C.H. Hsiao, Haar wavelet method for solving lumped and distributed-parameter systems, IEEE Proc. Control Theory Appl., 144, 1997, 87-94. [4] R. Hilfer, Applications of Fractional Calculus in Physics, World Scientific Publishing Company, Singapore, 2000. [5] A.A. Kilbas, H.M. Srivastava, J.J. Trujillo, Theory and Applica- tions of Fractional Differential Equations, Elsevier, San Diego, 2006. [6] I. Podlubny, Fractional Differential Equations, Academic Press, San Diego, 1999. [7] M.M. Hosseini, Adomian decomposition method for solution of nonlinear differential algebraic equations, Appl. Math. Com- put., 181, 2006, 1737-1744. [8] T. Mekkaoui, Z. Hammouch, Approximate analytic solutions to the Bagley-Torvik equation by the fractional iteration method, Anal. Univ. Craiova., 39(2), 2012, 251-256. Fig. 5: Numerical and exact solutions for m = 64. [9] Z.M. Odibat, A study on the convergence of variational itera- tion method, Math. Computer Model., 51(9), 2010, 1181-1192. [10] A. Arikoglu, I. Ozkol, Solution of fractional differential equa- tions by using differential transform method, Chaos, Solitons Fract., 34, 2007, 1473-1481. [11] V.S. Erturk, S. Momani, Z. Odibat, Application of generalized 6 Conclusion differential transform method to multi-order fractional differ- ential equations, Comm. Nonlinear Sci. Numer. Simulat., 13, In this work, we drive a new numerical method for solving 2008, 1642-1654. the fractional order differential equations based on Haar [12] Y. Zhang, A finite difference method for fractional partial differ- ential equation, Appl. Math. Comput., 215, 2009, 524-529. wavelet operational matrices of the fractional order inte- [13] A. Akgül, I. Mustafa, E. Karatas, D. Baleanu, Numerical solu- gration. In this regard, a general procedure of obtaining tions of fractional differential equations of Lane-Emden type α this Haar wavelet operational matrix Q of integration of by an accurate technique, Adv. Diff. Equations., 2015, 1-12. DOI the general order α is derived in Section 4. Advantages of 10.1186/s13662-015-0558-8 the proposed method include (i) the Haar wavelet opera- [14] R. Garra, Analytic solution of a class of fractional differential tional matrices of fractional order integration have been equations with variable coeflcients by operational methods, Commun. Nonlinear Sci. Numer. Simul., 17(4), 2012, 1549- derived without using the block pulse functions; (ii) it does 1554. not require to calculate the inverse of Haar matrix; (iii) it transforms the problem into algebraic matrix equation Firdous A. Shah and R. Abass, Haar Wavelet Operational Matrix Method Ë 213

[15] E.H. Doha, A.H. Bhrawy, D. Baleanu, S.S. Ezz-Eldien, The oper- [20] L. Wang, Y. Ma, Z. Meng, Haar wavelet method for solving ational matrix formulation of the Jacobi tau approximation for fractional partial differential equations numerically, Appl. space fractional diffusion equation, Adv. Diff. Equations., 231, Math. Comput., 227, 2014, 66-76. 2014, 1-14. [21] M. Yi, J. Huang, Wavelet operational matrix method for solving [16] L. Debnath, F.A. Shah, Wavelet Transforms and Their Applica- fractional differential equations with variable coeflcients, tions, Birkhäuser, New York, 2015. Appl. Math. Comput., 230, 2014, 383-394. [17] U. Lepik, H. Hein, Haar Wavelets with Applications, Springer, [22] M.X. Yi, J. Huang, J.X. Wei, Block pulse operational matrix New York, 2014. method for solving fractional partial differential equation, [18] Y. Li, W. Zhao, Haar wavelet operational matrix of fractional Appl. Math. Comput., 221, 2013, 121-131. order integration and its applications in solving the fractional [23] S.G. Mallat, Multiresolution approximation and wavelets, order differential equations, Appl. Math. Comput., 216, 2010, Trans. Amer. Math. Soc., 315, 1989, 69-89. 2276-2285. [24] A. Ghorbani, A. Alavi, Application of He’s variational itera- [19] S. Ray, On Haar wavelet operational matrix of general order tion method to solve semi-differential equations of nth order, and its application for the numerical solution of fractional Math. Prob. Engg., 2008. Article ID 627983, 9 pages. Bagley-Torvik equation, Appl. Math. Comput., 218, 2012, 5239- 5248.