You are on page 1of 4

Journal of Applied Computer Science & Mathematics, no.

11 (5) /2011, Suceava

On Calculation of Adomian Polynomials by MATLAB


1
Hooman FATOOREHCHI, 2Hossein ABOLGHASEMI
Center for Separation Processes Modeling and Nano-Computations
School of Chemical Engineering, University of Tehran, Tehran, Iran
1
hfatoorehchi@gmail.com, 2abolghasemi.ha@gmail.com

Abstract–Adomian Decomposition Method (ADM) is an codes, involve complexity, long programs and all are coded
elegant technique to handle an extensive class of linear or in Maple.
nonlinear differential and integral equations. However, in case The present paper, proposes a concise computer program
of nonlinear equations, ADM demands a special representation to rapidly compute Adomian polynomials in MATLAB, a
of each nonlinear term, namely, Adomian polynomials. The
present paper introduces a novel MATLAB code which
programming language interested especially by engineers,
computes Adomian polynomials associated with several types of getting its basic concept from a well-established technique
nonlinearities. The code exploits symbolic programming developed by Wazwaz [17]. Illustrative examples are
incorporated with a recently proposed alternative scheme to be provided to show the reliability of the program.
straightforward and fast. For the sake of exemplification,
Adomian polynomials of famous nonlinear operators, computed II. BASICS OF ADM IN BRIEF
by the code, are given.
Consider a very general differential equation as follows:
Keywords: Adomian decomposition, Adomian polynomials,
MATLAB, Nonlinear functionals, Differential equations. Lu + Nu + Ru = g (1)
where L is an easily invertible linear operator, N is a
I. INTRODUCTION nonlinear part and R stands for the remaining part. By
defining the inverse operator of L as L-1, it is directly
It is attributed to Albert Einstein to have said “True laws of concluded that:
nature cannot be linear”. Presumably true, mathematicians
are continually challenged with the nonlinear problems, L−1Lu + L−1 Nu + L−1 Ru = L−1 g (2)
particularly in form of partial differential equations, Taking L as an n-th order derivative operator into account,
appearing in Physics and engineering. Accordingly, any L-1 becomes an n-fold integration operator. Thus, it is
effort contributing to the world of nonlinear analysis would followed that L-1Lu=u+a, where a is emerged from the
be of fundamental importance and granted. Among a integrations. ADM proposes the final solution in form of
multitude of previously proposed approaches to tackle u = ∑ ∞n =0 un (that is why it is called decomposition).
nonlinear equations, Adomian Decompostion Method (ADM)
has gained astonishing popularity. Having been initially Identifying u0 as L-1 − ga, it yields:
developed and introduced by the acknowledged u = u0 − L−1 Nu − L−1 Ru (3)
mathematician George Adomian in 1984, ADM can provide
Furthermore, Nu shall be decomposed into an infinite
convenient solutions to a wide span of linear, as well as
series of Adominan polynomials as follows:
nonlinear, differential/integral equations [1-3]. ADM does

not impose any linearization, perturbation or discretizations
and leads to convergent solutions rapidly. To get to know
Nu = ∑ An (4)
n =0
about ADM and its efficiency as well as the further
modifications thereof in detail, one is recommended to where An is classically suggested to be computed from
consult the literature [4-6]. Also, many illustrative examples [6]:
associated with the application of ADM in various areas of
1 ⎡ dn ⎛ ∞ i ⎞⎤
science and engineering are available [7-11]. An ( u0 , u1 ,… , un ) = ⎢ ∑ λ ui ⎟⎠ ⎥
n ! ⎣ d λ n ⎜⎝ i =0
N (5)
⎦ λ =0
As it will be discussed, ADM requires a particular series
Therefore, a recurrence can be established to calculate the
representation, viz. Adomian polynomials, for the
remnant solution terms as:
nonlinearities involved in the target equation. Several efforts
have been made to derive procedures for computing these ui +1 = − L−1 Ai − L−1 Rui ; i≥0 (6)
kinds of polynomials [12-16]. However, some of them are Wazwaz ingeniously found a characteristic which holds
restricted to only special cases of nonlinearity and many of true for Adomian polynomials: sum of subscripts of the
them, among those which have been converted into computer components of u in each term of the polynomial An is equal to

85
Mathematics Section

n. Through this, he came up with an alternative scheme to A2 = 2u0u2 + u12


obtain Adomian polynomials with a reduced volume of
calculation [17]. Following the method proposed by Wazwaz, A3 = 2u0u3 + 2u1u2
we have built a piece of computer code (in form of a
procedure) in MATLAB which uses symbolic programming A4 = u22 + 2u1u3 + 2u0u4
and string functions efficiently to compute any desired A5 = 2u2u3 + 2u0u5 + 2u1u4
component of Adomian polynomials pertaining to different
nonlinearities. As it is observed the code is simple and short A6 = 2u0u6 + 2u1u5 + 2u2u4 + u32
and thus saves calculation time/volume.
A7 = 2u0u7 + 2u2u5 + 2u3u4 + 2u1u6
III. MATLAB PROGRAM TO COMPUTE Ans A8 = 2u2u6 + 2u3u5 + u42 + 2u0u8 + 2u1u7
function sol=AdomPoly(expression,nth) A9 = 2u0u9 + 2u2u7 + 2u3u6 + 2u1u8 + 2u4u5
% Coded by H. F. & H. A., Feb, 2011
Ch=char(expand(expression));
s=strread(Ch, '%s', 'delimiter', '+');
Nonlinearity Nu = u 3
for i=1:length(s) A0 = u03
t=strread(char(s(i)), '%s', 'delimiter', '*()expUlogsinh');
t=strrep(t,'^','*'); A1 = 3u02u1
if length(t)~=2
A2 = 3u12u0 + 3u02u2
p=str2num(char(t));
sumindex=sum(p)-p(1); A3 = u13 + 3u02u3 + 6u1u2u0
else
sumindex=str2num(char(t)); A4 = 3u12u2 + 3u22u0 + 3u02u4 + 6u1u3u0
end
list(i)=sumindex;
A5 = 6u2u3u0 + 3u22u1 + 3u12u3 + 3u02u5 + 6u1u4u0
end A6 = u23 + 3u32u0 + 6u2u4u0 + 6u2u3u1 + 3u12u4
A='';
for j=1:length(list) +3u02u6 + 6u1u5u0
if nth==list(j)
A=strcat(A,s(j),'+'); A7 = 3u32u1 + 3u22u3 + 6u3u4u0 + 6u2u4u1 + 6u2u5u0
end +3u12u5 + 3u02u7 + 6u1u6u0
end
N=length(char(A))-1; A8 = 6u3u4u1 + 3u42u0 + 3u32u2 + 3u22u4 + 6u3u5u0
F=strcat ('%',num2str(N),'c%n');
sol=sscanf(char(A),F); +6u2u5u1 + 6u2u6u0 + 3u12u6 + 3u02u8 + 6u1u7u0
A9 = 6u2u6u1 + 6u4u5u0 + 3u42u1 + u33 + 3u22u5
IV. EXAMPLES
+6u3u6u0 + 6u3u5u1 + 6u3u4u2 + 6u2u7u0 + 3u02u9
By defining a symbolic variable in MATLAB as:
NON = u0 + u1 + u2 + + un +u12u7 + 6u1u8u0
where ui is a symbolic variable and n is large enough. A Nonlinearity Nu = u 4
simple command calling the established AdomPoly function
would calculate the Adomian polynomial equivalents of A0 = u04
nonlinear operators acting upon NON. To illustrate the
program results several Adomian polynomials related to most
A1 = 4u03u1
frequent, in real world applications, nonlinearities are A2 = 4u03u2 + 6u12u02
presented here.
A3 = 4u13u0 + 4u03u3 + 12u1u2u02
Nonlinearity Nu = u 2 A4 = 12u12u2u0 + u14 + 6u22u02 + 4u03u4 + 12u1u3u02
A0 = u02 A5 = 12u12u3u0 + 4u13u2 + 12u22u0u1 + 4u03u5
A1 = 2u0u1
+12u2u3u02 + 12u1u4u02

86
Journal of Applied Computer Science & Mathematics, no. 11 (5) /2011, Suceava

A6 = 4u23u0 + 6u32u02 + 6u22u12 + 4u13u3 + 4u03u6 ⎛ 1 7 1 3 1 2 ⎞


⎜ 5040 u1 + 6 u2 u1 + 2 u3 u1 + u4u3 ⎟
+24u2u3u1u0 + 12u u u + 12u u u + 12u u u
2 4 0
2 2
1 4 0
2
1 5 0 ⎜ ⎟
A7 = 12u32u1u0 + 12u u u + 4u u + 4u13u4 + 4u03u7
2 3 ⎜ +u u + u u + 1 u 2 u 3 + 1 u u 5 ⎟
2 3 0 2 1
⎜ 5 2 6 1 12 2 1 120 2 1 ⎟
+12u3u4u02 + 12u2u5u02 + 24u2u4u0u1 + 12u2u3u12 A7 = eu0 ⎜ ⎟
⎜ + 1 u3u14 + 1 u3u22 + 1 u4u13 + 1 u5u12 ⎟
+12u5u12u0 + 12u1u6u02 ⎜ 24 2 6 2 ⎟
⎜ 1 ⎟
A8 = 12u3u5u02 + 12u22u3u1 + 12u2u6u02 + u24 + 6u42u02 ⎜ +u4u2u1 + u7 + u3u2u12 ⎟
⎝ 2 ⎠
+6u32u12 + 12u32u0u2 + 12u22u4u0 + 4u13u5 + 4u03u8 ⎛ 1 1 2 ⎞
⎜ u7u1 + u6u2 + 120 u3u1 + u5u3 + 2 u4
5

+24u3u4u1u0 + 24u2u5u1u0 + 12u2u4u12 + 12u6u0u12 ⎜ ⎟
+12u1u7u02 ⎜ + 1 u 2u + 1 u 4 + 1 u 8 + 1 u u 4 ⎟
⎜ 2 3 2 24 2 40320 1 24 4 1 ⎟
⎜ ⎟
A9 = 12u42u0u1 + 12u22u5u0 + 24u2u6u1u0 + 12u3u6u02 ⎜ + 1 u4u22 + 1 u5u13 + 1 u32u12 + 1 u22u3u1 ⎟
⎜ 2 6 4 2 ⎟
+24u3u4u2u0 + 12u4u5u02 + 4u33u0 + 4u23u3 + A8 = eu0 ⎜ ⎟
1 1 1
24u3u5u0u1 + 12u32u1u2 + 12u22u4u1 + 4u13u6 + 4u03u9 ⎜ + u23u12 + u2u3u13 + u4u2u12 + ⎟
⎜ 12 6 2 ⎟
+12u3u4u12 + 12u2u7u02 + 12u2u5u12 + 12u12u7u0 ⎜ 1 1 ⎟
⎜ u5u2u1 + u4u3u1 + u2u16 + u6u12 ⎟
+12u1u8u02 ⎜ 720 2 ⎟
⎜ 1 2 4 ⎟
⎜ + u2 u1 + u8 ⎟
⎝ 48 ⎠
Nonlinearity Nu = eu
A0 = eu0 A9 =
1626697008263629
590295810358705651712
(
eu0 60480u4u13u2
A1 = u1eu0
+181440u5u2u12 + 15120u3u14u2 + 90720u3u12u22 +
⎛ 1 ⎞
A2 = eu0 ⎜ u2 + u12 ⎟ 362880u5u3u1 + 181440u4u1u22 + 362880u6u2u1 +
⎝ 2 ⎠
⎛ 1 ⎞ 181440u4u12u3 + 362880u 9 + 60480u33 + u19 +
A3 = eu0 ⎜ u3 + u13 + u1u2 ⎟
⎝ 6 ⎠ 181440u42u1 + 181440u5u22 + 181440u7u12 +
⎛ 1 1 1 ⎞ 362880u3u2u4 + 181440u32u2u1 + 3024u4u15 +
A4 = eu0 ⎜ u1u3 + u14 + u22 + u12u2 + u4 ⎟
⎝ 24 2 2 ⎠ 72u17u2 + 15120u24u1 + 60480u23u3 + 362880u5u4 +
⎛ 1 2 1 5 1 2 ⎞
u0 ⎜ u5 + u1u2 + u1u4 + u1 + u1 u3 ⎟ 362880u7u2 + 362880u8u1 + 504u16u3 +
A5 = e 2 120 2
⎜⎜ ⎟⎟ 15120u5u14 + 1512u15u22 + 30240u32u13 + 10080u23u13
⎝ +u2u3 ⎠
⎛ 1 1 1 ⎞
u1u2u3 + u14u2 + u12u22 + u6 + u12u4 ⎟
+60480u6u13 + 362880u6u3 )
⎜ 24 4 2
A6 = eu0 ⎜ ⎟
⎜ + 1 u 2 + 1 u3 + u u + u u ⎟
⎜ ⎟
⎝ 2 ⎠
3 2 2 4 1 5
6

87
Mathematics Section

V. DISCUSSION [6] Y-C. Jiao, C. Dang, Y. Yamamoto, “An extension of the


decomposition method for solving nonlinear equations and its
The proposed algorithm intended to calculate Adomian convergence,” Comput. Math. Appl., vol. 55, pp. 760-775,
polynomials enjoys a great deal of simplicity, conciseness 2008.
and efficiency. As it is converted to a function file in [7] S. Pamuk, “An application for linear and nonlinear heat
MATLAB, it can easily be integrated into any codes dealing equations by Adomian’s decomposition method,” Appl. Math.
with solution of partial differential equations and be called Comput., vol. 163, pp.89-96, 2005.
anywhere in the program to compute any desired Adomian [8] C. Arslanturk, “A decomposition method for fin efficiency of
polynomial component of interested nonlinearity. By taking convective straight fins with temperature-dependent thermal
conductivity,” Int. Comm. Heat Mass Tran., vol. 32, pp. 831-
well advantage of as-built string functions and symbolic 841, 2005.
infrastructures of MATLAB, we have managed to shorten the [9] A. Wazwaz, A. Gorguis, “An analytic study of Fisher’s
code considerably. The authors are working on application of equation by using Adomian decomposition method,” Appl.
this computer code to tackle a nonlinear mathematical Math. Comput., vol. 154, pp. 609-620, 2004.
modeling dealing with heat radiation encountered in thermal [10] B. Adjedj, “Application of the decomposition method to the
engineering. understanding of HIV immune dynamics,” Kybernetes, vol.
28(3), pp. 271-283, 1999.
ACKNOWLEDGMENT [11] A. Wazwaz, Partial Differential Equations Method and
Applications, Balkema Publishers, Abingdon, 2002.
[12] H.-W. Choi, J.-G., “Symbolic implementation of the algorithm
The authors are grateful to Mr. Moein Assar (M.SC. in for calculating Adomian polynomials,” Appl. Math. Comput.,
Chemical Engineering from University of Tehran) for vol. 146, pp. 257-271, 2003.
double-checking the calculations. [13] J. Biazar, M. Pourabd, “A Maple program for computing
Adomian Polynomials,” International Mathematical Forum,
REFERENCES vol. 1(39): 1919-1924, 2006.
[14] J.-S. Duan, “Recurrence triangle for Adomian polynomials,”
[1] G. Adomian, “A new approach to nonlinear partial differential Appl. Math. Comput., vol. 216(4), pp. 1235-1241, 2010.
equations,” J. Math. Anal. Appl., vol. 102, pp. 402-434, 1984. [15] E. Babolian, Sh. Javadi, “New method for calculating
[2] Adomian, G., Solving Frontier Problems of Physics: The Adomian polynomials,” Appl. Math. Comput., vol. 153, pp.
Decomposition Method, Kluwer Academic Publishers, Boston, 253-259, 2004.
1994. [16] J. Biazar, E. Babolian, G. Kember, A. Nouri, R. Islam, “An
[3] G. Adomian, “Solutions of nonlinear PDE,” Appl. Math. Lett., alternate algorithm for computing Adomian polynomials in
vol. 11(3), pp. 121-123, 1998. special cases,” Appl. Math. Comput., vol. 138, pp. 523-529,
[4] J.-L. Li., “Adomian’s decomposition method and homotopy 2003.
perturbation method in solving nonlinear equations,” J. [17] A. Wazwaz, “A new algorithm for calculating Adomian
Comput. Appl. Math., vol. 228, pp. 168-173, 2009. polynomials for nonlinear operators,” Appl. Math. Comput.,
[5] K. Abbaoui, Y. Cherruault, “Convergence of Adomian’s vol. 111, pp. 53-69, 2000.
Method Applied to Nonlinear Equations,” Mathl. Comput.
Modeling, vol. 20(9), pp. 69-73, 1994.

Hooman Fatoorehchi is pursuing his PhD in chemical engineering at University of Tehran, Iran. He has always maintained
a strong interest in applied mathematics, particularly functional analysis and mathematical modeling, as well as computer
programming. Each day more than before, he finds himself charmed by the beauty of mathematics.

Hossein Abolghasemi received his PhD in chemical engineering from University of Tehran in 2000. His primary areas of
interests include control theory, engineering mathematics and mathematical modeling. So far, he has published a textbook on
chemical process control and several scientific articles.

88

You might also like