SlideShare una empresa de Scribd logo
1 de 7
Descargar para leer sin conexión
M. Kaliyappan et al Int. Journal of Engineering Research and Application
ISSN : 2248-9622, Vol. 3, Issue 5, Sep-Oct 2013, pp.1496-1502

RESEARCH ARTICLE

www.ijera.com

OPEN ACCESS

Sage Package for Symbolic Computation of Series Solution of
Ordinary Differential Equations
M.Kaliyappan*, A.Vanav Kumar**, S.Hariharan***
*(School of Advanced Science, VIT University, Chennai)
** (School of Advanced Science, VIT University, Chennai)
*** (School of Advanced Science, VIT University, Chennai)

ABSTRACT
The ordinary linear differential equations with constant coefficients can be solved by the algebraic methods and
the solutions are obtained by elementary functions called the fundamental solutions. Most of the differential
equations met in mathematics, physics and engineering sciences remain out of this class. In such cases, it is
natural to search the solutions in the form of infinite series. The power series method is a well known procedure
to solve ODEs with variable coefficients. The resulting series can be used to analyze and visualize the nature of
the solutions of ODE’s for which direct calculation is difficult. Manually solving a series solution using power
series method is tedious and time consuming. In this paper a special package using SAGE (an open source
software) have been developed, which can calculate any number of coefficients with no restriction to obtain the
series solutions of up to third order ODE at an ordinary point. Also the well known Legendre and Hermite
polynomials of any order can be generated and visualized by the way getting series solutions, In addition,
Frobenius method for finding series solution around regular singular point cases are discussed.
Keywords - Ordinary Differential Equations, Power Series Solutions, SAGE for Differential Equations

I.

INTRODUCTION

Many differential equations arising in
practical applications are linear with variable
coefficients which are not reduced by a differential
equation with constant coefficients, needs a method to
obtain classical solutions. Power series method is a
standard strategy to solve linear differential equations
with variable coefficients. The procedure to obtain
power series solutions are well known and it is
discussed in many differential equations book and
some of the advanced engineering Mathematics
books[1,2,4,5]. Manually solving these kind of
equations can be tedious and in order to get more
coefficients of the series it takes lot more time and
mainly it is not possible to visualize the solutions
without the existing mathematical packages.
In this paper, a package through SAGE, to
obtain the series solutions of second order ODE with
ordinary point and Frobenius method for the case of
solutions of the indicial equations not differ by
integers through symbolic computation have been
developed. The Legendre and Hermite differential
equations have been solved and obtained their
polynomials from their series solutions. Section II
describes theoretical structure of solving second order
ODE through power series method. A package through
SAGE using symbolic computation have been given
in Section III in order to solve third order ordinary
differential equations using series solution. Section IV
& V describes the Legendre and Hermite differential
equations and visualizing their
www.ijera.com

polynomials respectively. The method of Frobenius
for regular singular points are discussed in Section VI.
Section VII describes the computation time
comparison with MATLAB.

II.

SERIES SOLUTION FOR SECOND
ORDER ODE HAVING VARIABLE
COEFFICIENTS

Consider the linear second-order differential
equation
(1)
a 2 ( x) y   a1 ( x) y   a 0 ( x) y  0 …
which can be converted to the following standard form
(2)
y   P( x) y   Q( x) y  0 ……
by dividing the leading coefficient
A point

a0 ( x) .

x 0 is said to be an ordinary point of the

differential equation (1) if both P(x) and Q(x) are
analytic at x 0 . A point that is not an ordinary point is
said to be a singular point of the equation.
Assume that x 0 is an ordinary point (2), so that
solutions in powers of

( x  x0 ) actually do exists. Let

(3)
y  c 0  c1 ( x  x0 )  c 2 ( x  x0 ) 2  ...
be the solution of (2). Since the series (3) converges
on an interval x  x0  R about x 0 , it may be
differentiated term by term on this interval twice in

1496 | P a g e
M. Kaliyappan et al Int. Journal of Engineering Research and Application
ISSN : 2248-9622, Vol. 3, Issue 5, Sep-Oct 2013, pp.1496-1502
succession to obtain

dy
 c1  2c 2 ( x  x0 )  3c 2 ( x  x 0 ) 2  ...
dx

(4)

d2y
 2c 2  6c 3 ( x  x 0 )  12 c 4 ( x  x 0 ) 2  ...
dx 2

(5)

respectively. By substituting the series in the right
members of (2), (3) and (4) for y and its first two
derivatives ,respectively, in the differential equation
(1), one can get the series solution. Simplifying the
resulting expression it takes the following form
(6)
K 0  K 1 ( x  x 0 )  K 2 ( x  x 0 ) 2  ...  0
Where the coefficients K i (i  0,1,2,3...) are functions
of certain coefficients of the solution (3).
By equating the coefficients to zero of each power of
(x-x0) in the left member of (6) leads to a set of
conditions that must be satisfied by the various
coefficients
in the series (3). If the
are chosen
to satisfy the set of conditions that thus occurs, then
the resulting series (3) is the desired solution of the
differential equation (1).

III.

SAGE CODE FOR GETTING SERIES
SOLUTIONS OF AN ODE
THROUGH SYMBOLIC
COMPUTATIONS

SAGE is an open-source mathematical
software system that helps to perform many
mathematical tasks such as plotting curves and
surfaces, symbolic differentiation and integration and
solving ODE etc[3]. SAGE have highly optimized
functions that implement common numerical
operations like integration, solving ordinary
differential equations and solving systems of
equations. It is almost a viable, free, open source
alternative to Magma, Maple, Mathematica, and
Matlab. Mathematician, scientist, or engineer can
spend less time for doing tedious mathematical
calculations by the way of using mathematical
software and visualizing its solutions. Students can
also benefit from mathematical software. The ability to
plot functions and manipulate symbolic expressions
easily can improve the understanding of mathematical
concepts.
The following is the SAGE package
sersol(p1x,p2x,p3x,p4x,x0,i1,i2,i3,N,nh,n)
for
obtaining series solution for third order ODE around
the ordinary point x = x0 and visualizing its solutions.
Input:
N ( Number of terms of the series )
p1x, p2x , p3x, x0, i1, i2, i3,n & nh
where p1x, p2x, p3x & p4x are the coefficients of
y , y , y  & y respectively, i1, i2& i3 are initial
conditions, n is highest order of the derivative and nh
represents the non homogeneous term.
Output:
Series Solutions with visualization

www.ijera.com

www.ijera.com

def sersol(p1x,p2x,p3x,p4x,x0,i1,i2,i3,N,nh,n):
x = var("x")
z= var("z")
cc=[0]*(N+2)
dd=[0]*(N+1)
ee=[0]*(N-2)
aa = list(var('a_%d' % i) for i in (0..N))
y = sum(a*(x-x0)**i for i,a in enumerate(aa))
y1=y.substitute((x==z+x0))
p1z=p1x.substitute((x==z+x0))
p2z=p2x.substitute((x==z+x0))
p3z=p3x.substitute((x==z+x0))
p4z=p4x.substitute((x==z+x0))
nh1=nh.substitute((x==z+x0))
dy1=y1.derivative(z)
d2y1=dy1.derivative(z)
d3y1=d2y1.derivative(z)
ode=p1z*d3y1+p2z*d2y1+p3z*dy1+p4z*y1-nh1;
ode1=ode.simplify_full();
ode2=ode1.collect(z)
l2=len(ode2)
bb=[0]*(l2+1)
for k in range(1,N+1):
m=z^k
bb[k] = (ode2.coefficient(m)==0)
ode2 = ode2 - ode2.coefficient(m)*m
for k in range(N+1,l2):
m=z^(k)
ode2=ode2 - ode2.coefficient(m)*m
bb[0]=(ode2==0);
for k in range(0,N-(n-1)):
dd[k] = bb[k]
for k in range(0,N-(n-1)):
ee[k] = aa[k+3]
sol=solve(dd,(ee))
c=sol[0];
y2=0
for k in range(0,n):
y2=y2+aa[k]*z^k
for k in range(0,N-(n-1)):
y2=y2+(c[k].right_hand_side())*z**(k+n)
y3=y2.substitute(z=0)
y4=y2.derivative(z)
y5=y4.substitute(z=0)
y11=y4.derivative(z)
y12=y11.substitute(z=0)
y6=solve(y3==i1,a_0)
y7=solve(y5==i2,a_1)
y13=solve(y12==i3,a_2)
y8=y2.substitute(a_0=y6[0].right_hand_side())
y9=y8.substitute(a_1=y7[0].right_hand_side())
y14=y9.substitute(a_2=y13[0].right_hand_side())
y10=y14.substitute((z==x-x0))
return(y10)

1497 | P a g e
M. Kaliyappan et al Int. Journal of Engineering Research and Application
ISSN : 2248-9622, Vol. 3, Issue 5, Sep-Oct 2013, pp.1496-1502

www.ijera.com

Example 1
Consider the third order initial value problem given

1
1
y   2 y  0 with y(1)  1, y (1)  0
x
x
and y(1)  1
by:

y  

Output:
The series solution for N=8 is
8
7
−(793/40320)(x−1) +(137/5040)(x−1) −
6
5
4
(29/720)(x−1) +(1/15)(x−1) −(1/8)(x−1)
3
2
+(1/6)(x−1) +(1/2)(x−1) +1

Figure 2: Visualizing solution curves for the ODE

y   xy   y  0, y(0)  2, y (0)  1
for N=7,10 & 50
Example 3
Consider the following ordinary differential equation

( x  1) y   y   2( x  1) y  0, y(4)  5, y (4)  0

on the interval 4  x   around the ordinary point
x0=4
Figure 1: Visualizing solution and solution curve for
the ordinary differential equation

y  

1
1
y   2 y  0 with
x
x

y(1)  1, y(1)  0, y(1)  1 ( N=8).

Output:
The series solution is
8
7
(205/163296)(x−4) +(23/6804)(x−4)
6
5
4
−(37/972)(x−4) −(2/27)(x−4) +(25/36)(x−4)
3
2
+(5/9)(x−4) −5(x−4) +5

Example 2
Consider the following initial value problem
y   xy   y  0, y(0)  2, y (0)  1.
Output:

Figure 3: Visualizing solution and solution curve for
the ODE

( x  1) y   y   2( x  1) y  0, y(4)  5, y (4)  0
and 4  x  

Example 4
Comparison of series and exact solution curves for the
following initial value problem

y   2 y   y   2  24 e x  40 e 5 x ,
1
5
9
y (0)  , y (0)  , y (0)  
2
2
2

www.ijera.com

1498 | P a g e
M. Kaliyappan et al Int. Journal of Engineering Research and Application
ISSN : 2248-9622, Vol. 3, Issue 5, Sep-Oct 2013, pp.1496-1502

Figure 4: Comparison of series and exact solution of
y   2 y   y   2  24 e x  40 e 5 x ,

y (0) 

1
5
9
, y (0)  , y (0)  
2
2
2

Example 5
Consider the following ordinary differential equation

y   xy   y  e 3 x
Output:
The series solution is
8

6

(−1/13440)(5a0−148)x +(1/240)(a0+19)x
7
4
5
+(53/1680)x −(1/24)(a0−8)x +(7/40)x
2
3
+(1/2)(a0+1)x +(1/2)x +a1x+a0
Where a0 & a1 are arbitrary constants
Example 6

Consider the following ordinary differential equation

y   sin( x) y   e x y  0
Output:
The series solution is
8

7

(1/40320)(49a0−110a1)x −(1/5040)(37a0+32a1)x −
6
5
(1/720)(5a0−14a1)x +(1/20)(a0+a1)x +
4
3
(1/12)(a0−a1)x −(1/6)(a0+2a1)x −(1/2)a0x2+a1x+a0
Where a0 & a1 are arbitrary constants
For the above cases, expand
the
trignometrical and exponential terms as a Taylor series
expansion about origin upto the number of terms one
require. Since there are no initial condition given, the
solution will be in terms of arbitrary constants as given
above.
The SAGE package is given for a third order
equations and a simple modification in terms of the
number of initial conditions and with the coefficients
of derivative will give the solution of second order
equations.

www.ijera.com

www.ijera.com

IV.
LEGENDRE POLYNOMIALS
The
Legendre
differential
equation
2
  2 xy   n(n  1) y  0 ...(7)
where
(1  x ) y
n=0,1,2,3,… is frequently encountered in physics and
other technical fields. In particular, it occurs when
solving Laplace's equation (and related partial
differential equations) in spherical coordinates. The
Legendre differential equation may be solved using
the standard power series method. The equation (7)
has regular singular points at x = ±1, its series solution
about the origin will only converge for |x| < 1. When n
is an integer, one of the series solution terminates
depending on the nature of value of n. These solutions
for n = 0, 1, 2,3, ... form a sequence of orthogonal
polynomials called the Legendre polynomials.
The
following
SAGE
Package
legendre(p1x,p2x,p3x,N)
solves the
Legendre
differential equation (1  x 2 ) y   2 xy   n(n  1) y  0
and computes set of Legendre polynomials with
visualization.
Input:
N (Number of terms of the series)
2,
2
p1x= 1-x p2x= -2x & p3x=n +n
(Coefficients of y , y  & y respectively)
Output:
Legendre polynomials with visualization
def legendre(p1x,p2x,p3x,N):
x = var("x")
n = var("n")
N1= int(N/2)
aa = list(var('a_%d' % i) for i in (0..N))
bb = [0]*(N+2)
cc = [0]*(N-1)
dd = [0]*(N+1)
ee = [0]*(N-1)
ff = [0]*(N-1)
gg = [0]*(N1)
hh = [0]*(N1)
y = sum(a*x**i for i,a in enumerate(aa))
dy=y.derivative(x)
d2y=dy.derivative(x)
ode=p1x*d2y+p2x*dy+p3x*y;
ode1=ode.simplify_full()
ode2=ode1.collect(x)
for k in range(1,N+1):
m=x^k
bb[k] = (ode2.coefficient(m)==0)
ode2 = ode2 - ode2.coefficient(m)*m
bb[0]=(ode2==0);
for k in range(0,N-1):
ee[k]=bb[k]
cc[k]=aa[k+2]
sol=solve(ee,(cc))
d=sol[0]
y2=aa[0]+aa[1]*x;
for k in range(0,N-1):
y2=y2+(d[k].right_hand_side())*x**(k+2)
i=0
for k in range(0,N-1 ,2):
1499 | P a g e
M. Kaliyappan et al Int. Journal of Engineering Research and Application
ISSN : 2248-9622, Vol. 3, Issue 5, Sep-Oct 2013, pp.1496-1502
y3=y2.substitute(a_1=0,n=k)
y4=y3.substitute(x=1)
y5=solve(y4==1,a_0)
gg[i]=y3.substitute(a_0=y5[0].right_hand_side())
i=i+1
i=0
for k in range(1,N,2):
y3=y2.substitute(a_0=0,n=k)
y4=y3.substitute(x=1)
y5=solve(y4==1,a_1)
hh[i]=y3.substitute(a_1=y5[0].right_hand_side())
i=i+1
for k in range(0,N1):
plot_list.append(plot(gg[k],(x,-1,1) ))
for k in range(0,N1):
plot_list.append(plot(hh[k],(x,-1,1) ))
gr=sum(plot_list)
gr.show()
return(gg,hh)
Output:

2

4

2

6

([1, (3/2)x - 1/2, (35/8)x – (15/4)x + 3/8, (231/16)x
4
2
8
– (315/16)x + (105/16)x - 5/16, (6435/128)x –
6
4
2
(3003/32)x + (3465/64)x – (315/32)x + 35/128],
3
5
3
[x, (5/2)x – (3/2)x, (63/8)x – (35/4)x + (15/8)x,
7
5
3
(429/16)x - (693/16)x + (315/16)x – (35/16)x,
9
7
5
(12155/128)x – (6435/32)x +(9009/64)x –
3
(1155/32)x + (315/128)x])
Figure 3. Visualizing Legendre polynomials for N=10

V.

HERMITE POLYNOMIALS

The
Hermite
differential
equation
y  2 xy  2ny  0 is frequently encountered in
physics and other technical fields. In particular,
Hermite polynomials H n (x) arise in solving the
Schrodinger equation for a harmonic oscillator.
However, it also shows one way in which special
functions arise from differential equations, so in that
sense it is of interest to all.
The
following
SAGE
Package
hermitesol(p1x,p2x,p3x,N) solves the Legendre
differential equation y   2 xy   2ny  0 and
computes set of Hermite polynomials for n=1,2,3…
with visualization.
www.ijera.com

www.ijera.com

Input:
N (Number of terms of the series)
p1x=1,p2x = -2x & p3x = 2n
(Coefficients of y , y  & y respectively)
Output:
Hermite polynomial with visualization
def hermitesol(p1x,p2x,p3x,N):
x = var("x")
n = var("n")
N1=int(N/2)
aa = list(var('a_%d' % i) for i in (0..N))
bb = [0]*(N+2)
cc = [0]*(N-1)
dd = [0]*(N+1)
ee = [0]*(N-1)
ff = [0]*(N-1)
gg = [0]*(N1)
hh = [0]*(N1)
y = sum(a*x**i for i,a in enumerate(aa))
dy=y.derivative(x)
d2y=dy.derivative(x)
ode=p1x*d2y+p2x*dy+p3x*y;
ode1=ode.simplify_full()
ode2=ode1.collect(x)
for k in range(1,N+1):
m=x^k
bb[k] = (ode2.coefficient(m)==0)
ode2 = ode2 - ode2.coefficient(m)*m
bb[0]=(ode2==0);
for k in range(0,N-1):
ee[k]=bb[k]
cc[k]=aa[k+2]
sol=solve(ee,(cc))
d=sol[0]
y2=aa[0]+aa[1]*x;
for k in range(0,N-1):
y2=y2+(d[k].right_hand_side())*x**(k+2)
i=0
for k in range(1,N,2):
y3=y2.substitute(a_0=0,n=k)
y4=y3.coefficient(x^k)
y5=solve(y4==2**(k),a_1)
gg[i]=y3.substitute(a_1=y5[0].right_hand_side())
i=i+1
i=1
hh[0]=1;
i=1
for k in range(2,N-1,2):
y3=y2.substitute(a_1=0,n=k)
y4=y3.coefficient(x^k)
y5=solve(y4==2**(k),a_0)
hh[i]=y3.substitute(a_0=y5[0].right_hand_side())
i=i+1
plot_list=[]
1500 | P a g e
M. Kaliyappan et al Int. Journal of Engineering Research and Application
ISSN : 2248-9622, Vol. 3, Issue 5, Sep-Oct 2013, pp.1496-1502
for k in range(0,N1):
plot_list.append(plot(gg[k],(x,-2,2) ))
for k in range(0,N1):
plot_list.append(plot(hh[k],(x,-2,2) ))
gr=sum(plot_list)
gr.show()
return(gg,hh)
Output:
3
5
3
7
5
[2x,8x −12x,32x −160x +120x,128x −1344x
3
9
7
5
3
+3360x −1680x, 512x −9216x +48384x −80640x
+30240x]
2

4

2

6

4

2

[1,4x −2,16x −48x +12,64x −480x +720x −120,
8
6
4
2
256x −3584x +13440x −13440x +1680]

www.ijera.com

dd=[0]*(N)
y3=[0]*2*(N+1)
aa = list(var('a_%d' % i) for i in (0..N))
y = sum(a*x**i for i,a in enumerate(aa))
Px=p2x/p1x;
Qx=p3x/p1x;
px=x*Px;
p4x=px.simplify_full()
qx=x^2*Qx;
q4x=qx.simplify_full()
a1=p4x.substitute(x=0)
b1=q4x.substitute(x=0)
sol=solve(r*(r-1)+a1*r+b1= =0,(r))
for j in range(1,3):
c=sol[j-1].right_hand_side()
yp = y*x^(c)
y1=yp.simplify_full();
dy=y1.derivative(x)
d2y=dy.derivative(x)
ode1=p1x*d2y+p2x*dy+p3x*y1;
ode2=ode1.simplify_full();
ode=ode2/x^c;
ode3=ode.collect(x)
for k in range(0,N+1):
m=x^k
bb[k] = (ode3.coefficient(m)= =0)
ode3 = ode3 - ode3.coefficient(m)*m
bb[0]=(ode3= =0);

Figure 4: Visualizing Hermite polynomials for N=10.

VI.

METHOD OF FROBENIOUS FOR
REGULAR SINGULAR POINTS

If the linear equation y  P( x) y  Q( x) y  0 ...
(8) has an irregular singularity at x=x0 then the
problem of finding series solution is not easy. If,
however the above equation (8) has regular singular
point at x=x0 then one can develop a method for
finding a series solutions, valid in neighborhood of x0.
This procedure is known as the method of Frobenius.
In this article, the package for getting solutions valid
in neighborhood of regular singular points (x0=0) is
developed, whose indicial equations are different and
not differ by integer.
Input
N (Number of terms of the series)
p1x, p2x & p3x
(Coefficients of y , y  & y respectively).
Output
Series solutions

for k in range(0,N):
bb1[k]=bb[k]
for k in range(1,N+1):
dd[k-1]=aa[k]
sol1=solve(bb1,(dd))
sol2=sol1[0]
y2=aa[0]*x^c
for i in range(0,N-1):
y2=y2+(sol2[i].right_hand_side())*x**(i+1+c)
show(y2)
return()
Example 7
Consider the following ordinary differential equation
6 x 2 y   7 xy   (1  x 2 ) y  0, (0  x  )
Since x = 0 is a regular singular points for the
differential equation, output is shown below
The two linear independent solutions are
(15/2)

def frobenius(p1x,p2x,p3x,N):
x = var("x")
r = var("r")
bb=[0]*(N+2)
bb1=[0]*(N)
cc=[0]*(N+1)
www.ijera.com

(11/2)

(1/68078976)a0 x
+ (1/197904)a0 x
(7/2)
(3/2)
+(1/1064)a0 x
+(1/14)a0 x
+ (a0/√x)
(25/3)

(19/3)

(1/411374976)a0 x
+(1/970224)a0 x
(13/3)
(7/3)
+(1/3944)a0 x
+(1/34)a0 x
+a0 x^(1/3)

1501 | P a g e
M. Kaliyappan et al Int. Journal of Engineering Research and Application
ISSN : 2248-9622, Vol. 3, Issue 5, Sep-Oct 2013, pp.1496-1502
Where a0 is arbitrary constant
The above code can be modified for other
singular points like one developed in this article and
for other two cases of Frobenius such as the indicial
equation’s equal roots and roots differ by an integer
for getting two independent solutions can be done in a
similar way.
The results are verified for the example problems
with [4], [5] and [6].

VII.

COMPUTATION TIME
COMPARISON

[3]
[4]

[5]

[6]

www.ijera.com

Craig Finch, Sage Beginner's Guide, Packt
Publishing,2011
Michael D.Greenberg, Advanced engineering
Mathematics, Second edition, Printice
Hall,1998
Peter V O’neil, Advanced engineering
Mathematics, International student edition,
Thomson, 2007.
Morris Tenenbaum, Harry Pollard, Ordinary
Differential Equations, Dover publications,
INC.,NewYork,1963

The Computation time comparison for
obtaining the number of terms of the series for the
ODE
y   xy   y  0, y(0)  2, y (0)  1 using
SAGE (Wall time) and MATLAB (tic-toc time) are
presented in Table 1.
Number of
SAGE
MATLAB
coefficients
of the series
50
1.252263212 3.712966
100

4.277512169

7.363384

150

10.05321922

11.65843

200

21.62953706

17.56204

250

32.45158839

24.66636

300

52.07608185

29.889488

Table 1: The Computation time comparison for
obtaining the number of coefficients of the series for
the ODE y   xy   y  0, y(0)  2, y (0)  1
using SAGE and MATLAB
VIII.
Conclusion
This computational tool will help the students
to understand the nature of the solution and study the
behavior of the solution through visualization. The
figures confirm that the behavior of the solution
changes considerably when the number of terms of the
solution increases, which may not be possible without
the use of Mathematical software. This is the first
time a package has been developed through SAGE to
visualize the series solution of any order. The
programs will help not only solving the differential
equations upto order three, Legendre and Hemite
differential equations but also generating and
visualizing solutions around ordinary, regular singular
points, Legendre and Hermite polynomials for any
order. One can extend the same concept for higher
order differential equations of any order.
References
[1]
Shepley L . Ross, Differential equations,
Third edition, John Wiley & sons
[2]
Erwin Kreyszig, Advanced Engineering
Mathematics,nineth edition, John Wiley &
Sons,Inc, 2006

www.ijera.com

1502 | P a g e

Más contenido relacionado

La actualidad más candente

Solving systems of Linear Equations
Solving systems of Linear EquationsSolving systems of Linear Equations
Solving systems of Linear Equations
swartzje
 
System of linear equations
System of linear equationsSystem of linear equations
System of linear equations
Cesar Mendoza
 
Module 4 exponential and logarithmic functions
Module 4   exponential and logarithmic functionsModule 4   exponential and logarithmic functions
Module 4 exponential and logarithmic functions
Aya Chavez
 
Chapter 2 matrices
Chapter 2   matricesChapter 2   matrices
Chapter 2 matrices
sarkissk
 
System of equations
System of equationsSystem of equations
System of equations
mariacadena
 
Solve Complex Inequalities Algebra 1
Solve Complex Inequalities Algebra 1Solve Complex Inequalities Algebra 1
Solve Complex Inequalities Algebra 1
swartzje
 
Linear Functions And Matrices
Linear Functions And MatricesLinear Functions And Matrices
Linear Functions And Matrices
andrewhickson
 

La actualidad más candente (20)

Solving system of linear equations
Solving system of linear equationsSolving system of linear equations
Solving system of linear equations
 
Systems of Linear Algebra
Systems of Linear AlgebraSystems of Linear Algebra
Systems of Linear Algebra
 
Solving systems of Linear Equations
Solving systems of Linear EquationsSolving systems of Linear Equations
Solving systems of Linear Equations
 
Ch05 4
Ch05 4Ch05 4
Ch05 4
 
Solution of linear system of equations
Solution of linear system of equationsSolution of linear system of equations
Solution of linear system of equations
 
System of Linear Equation
System of Linear EquationSystem of Linear Equation
System of Linear Equation
 
Linear algebra03fallleturenotes01
Linear algebra03fallleturenotes01Linear algebra03fallleturenotes01
Linear algebra03fallleturenotes01
 
Ch05 3
Ch05 3Ch05 3
Ch05 3
 
System of linear equations
System of linear equationsSystem of linear equations
System of linear equations
 
BSC_COMPUTER _SCIENCE_UNIT-5_DISCRETE MATHEMATICS
BSC_COMPUTER _SCIENCE_UNIT-5_DISCRETE MATHEMATICSBSC_COMPUTER _SCIENCE_UNIT-5_DISCRETE MATHEMATICS
BSC_COMPUTER _SCIENCE_UNIT-5_DISCRETE MATHEMATICS
 
Module 4 exponential and logarithmic functions
Module 4   exponential and logarithmic functionsModule 4   exponential and logarithmic functions
Module 4 exponential and logarithmic functions
 
Classification of singularity
Classification of singularityClassification of singularity
Classification of singularity
 
System Of Linear Equations
System Of Linear EquationsSystem Of Linear Equations
System Of Linear Equations
 
Advanced algebra
Advanced algebraAdvanced algebra
Advanced algebra
 
System of linear equations
System of linear equationsSystem of linear equations
System of linear equations
 
Chapter 2 matrices
Chapter 2   matricesChapter 2   matrices
Chapter 2 matrices
 
System of equations
System of equationsSystem of equations
System of equations
 
Solve Complex Inequalities Algebra 1
Solve Complex Inequalities Algebra 1Solve Complex Inequalities Algebra 1
Solve Complex Inequalities Algebra 1
 
Linear Functions And Matrices
Linear Functions And MatricesLinear Functions And Matrices
Linear Functions And Matrices
 
AS LEVEL QUADRATIC (CIE) EXPLAINED WITH EXAMPLE AND DIAGRAMS
AS LEVEL QUADRATIC (CIE) EXPLAINED WITH EXAMPLE AND DIAGRAMSAS LEVEL QUADRATIC (CIE) EXPLAINED WITH EXAMPLE AND DIAGRAMS
AS LEVEL QUADRATIC (CIE) EXPLAINED WITH EXAMPLE AND DIAGRAMS
 

Destacado

Hulu & gemma & mar
Hulu & gemma & marHulu & gemma & mar
Hulu & gemma & mar
karlagemma
 
IA summit-il-referto-ritrovato
IA summit-il-referto-ritrovatoIA summit-il-referto-ritrovato
IA summit-il-referto-ritrovato
Argentea
 
Sarau INOVAR 15 de Julho 2011
Sarau INOVAR 15 de Julho 2011Sarau INOVAR 15 de Julho 2011
Sarau INOVAR 15 de Julho 2011
cnoesv
 
Agis expedition 2011 - TPLINK
Agis expedition 2011 - TPLINKAgis expedition 2011 - TPLINK
Agis expedition 2011 - TPLINK
Rodrigo Morais
 

Destacado (20)

Chem in news
Chem in newsChem in news
Chem in news
 
jeevitam nerpina paatham
jeevitam nerpina paatham jeevitam nerpina paatham
jeevitam nerpina paatham
 
Is3515091514
Is3515091514Is3515091514
Is3515091514
 
Iu3515201523
Iu3515201523Iu3515201523
Iu3515201523
 
Jp3516591662
Jp3516591662Jp3516591662
Jp3516591662
 
Ir3515031508
Ir3515031508Ir3515031508
Ir3515031508
 
Ip3514921495
Ip3514921495Ip3514921495
Ip3514921495
 
Io3514861491
Io3514861491Io3514861491
Io3514861491
 
It3515151519
It3515151519It3515151519
It3515151519
 
Hulu & gemma & mar
Hulu & gemma & marHulu & gemma & mar
Hulu & gemma & mar
 
Cerimônias sem cerimônias
Cerimônias sem cerimôniasCerimônias sem cerimônias
Cerimônias sem cerimônias
 
IA summit-il-referto-ritrovato
IA summit-il-referto-ritrovatoIA summit-il-referto-ritrovato
IA summit-il-referto-ritrovato
 
Sarau INOVAR 15 de Julho 2011
Sarau INOVAR 15 de Julho 2011Sarau INOVAR 15 de Julho 2011
Sarau INOVAR 15 de Julho 2011
 
Home
HomeHome
Home
 
The ant story (vietnamese)
The ant story (vietnamese)The ant story (vietnamese)
The ant story (vietnamese)
 
Agis expedition 2011 - TPLINK
Agis expedition 2011 - TPLINKAgis expedition 2011 - TPLINK
Agis expedition 2011 - TPLINK
 
O relevo e a tectónica (3)
O relevo e a tectónica (3)O relevo e a tectónica (3)
O relevo e a tectónica (3)
 
Osv temporada 2010 11 palau
Osv temporada 2010 11 palauOsv temporada 2010 11 palau
Osv temporada 2010 11 palau
 
Wat is drupal? - Drupal seminar 20 mei 2010, Colours
Wat is drupal? - Drupal seminar 20 mei 2010, ColoursWat is drupal? - Drupal seminar 20 mei 2010, Colours
Wat is drupal? - Drupal seminar 20 mei 2010, Colours
 
Dinora vs krista_kelly-9338
Dinora vs krista_kelly-9338Dinora vs krista_kelly-9338
Dinora vs krista_kelly-9338
 

Similar a Iq3514961502

11.solution of a singular class of boundary value problems by variation itera...
11.solution of a singular class of boundary value problems by variation itera...11.solution of a singular class of boundary value problems by variation itera...
11.solution of a singular class of boundary value problems by variation itera...
Alexander Decker
 
Solution of a singular class of boundary value problems by variation iteratio...
Solution of a singular class of boundary value problems by variation iteratio...Solution of a singular class of boundary value problems by variation iteratio...
Solution of a singular class of boundary value problems by variation iteratio...
Alexander Decker
 
Constant-Coefficient Linear Differential Equations
Constant-Coefficient Linear Differential  EquationsConstant-Coefficient Linear Differential  Equations
Constant-Coefficient Linear Differential Equations
ashikul akash
 

Similar a Iq3514961502 (20)

A Fast Numerical Method For Solving Calculus Of Variation Problems
A Fast Numerical Method For Solving Calculus Of Variation ProblemsA Fast Numerical Method For Solving Calculus Of Variation Problems
A Fast Numerical Method For Solving Calculus Of Variation Problems
 
ODE.pdf
ODE.pdfODE.pdf
ODE.pdf
 
160280102042 c3 aem
160280102042 c3 aem160280102042 c3 aem
160280102042 c3 aem
 
Catalan Tau Collocation for Numerical Solution of 2-Dimentional Nonlinear Par...
Catalan Tau Collocation for Numerical Solution of 2-Dimentional Nonlinear Par...Catalan Tau Collocation for Numerical Solution of 2-Dimentional Nonlinear Par...
Catalan Tau Collocation for Numerical Solution of 2-Dimentional Nonlinear Par...
 
Fj25991998
Fj25991998Fj25991998
Fj25991998
 
160280102031 c2 aem
160280102031 c2 aem160280102031 c2 aem
160280102031 c2 aem
 
11.solution of a singular class of boundary value problems by variation itera...
11.solution of a singular class of boundary value problems by variation itera...11.solution of a singular class of boundary value problems by variation itera...
11.solution of a singular class of boundary value problems by variation itera...
 
Chapter 3(Power Series_17).pptx;/lkjjjj;lj
Chapter 3(Power Series_17).pptx;/lkjjjj;ljChapter 3(Power Series_17).pptx;/lkjjjj;lj
Chapter 3(Power Series_17).pptx;/lkjjjj;lj
 
Solution of a singular class of boundary value problems by variation iteratio...
Solution of a singular class of boundary value problems by variation iteratio...Solution of a singular class of boundary value problems by variation iteratio...
Solution of a singular class of boundary value problems by variation iteratio...
 
03_AJMS_209_19_RA.pdf
03_AJMS_209_19_RA.pdf03_AJMS_209_19_RA.pdf
03_AJMS_209_19_RA.pdf
 
03_AJMS_209_19_RA.pdf
03_AJMS_209_19_RA.pdf03_AJMS_209_19_RA.pdf
03_AJMS_209_19_RA.pdf
 
Eigenvalues and eigenvectors
Eigenvalues and eigenvectorsEigenvalues and eigenvectors
Eigenvalues and eigenvectors
 
First_Order_Differential_Equations_PPT.ppt
First_Order_Differential_Equations_PPT.pptFirst_Order_Differential_Equations_PPT.ppt
First_Order_Differential_Equations_PPT.ppt
 
On Application of Power Series Solution of Bessel Problems to the Problems of...
On Application of Power Series Solution of Bessel Problems to the Problems of...On Application of Power Series Solution of Bessel Problems to the Problems of...
On Application of Power Series Solution of Bessel Problems to the Problems of...
 
Lectures in signals and systems
Lectures in signals and systemsLectures in signals and systems
Lectures in signals and systems
 
Ch05 2
Ch05 2Ch05 2
Ch05 2
 
maths 12th.pdf
maths 12th.pdfmaths 12th.pdf
maths 12th.pdf
 
Amity university sem ii applied mathematics ii lecturer notes
Amity university sem ii applied mathematics ii lecturer notesAmity university sem ii applied mathematics ii lecturer notes
Amity university sem ii applied mathematics ii lecturer notes
 
Series solutions at ordinary point and regular singular point
Series solutions at ordinary point and regular singular pointSeries solutions at ordinary point and regular singular point
Series solutions at ordinary point and regular singular point
 
Constant-Coefficient Linear Differential Equations
Constant-Coefficient Linear Differential  EquationsConstant-Coefficient Linear Differential  Equations
Constant-Coefficient Linear Differential Equations
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Iq3514961502

  • 1. M. Kaliyappan et al Int. Journal of Engineering Research and Application ISSN : 2248-9622, Vol. 3, Issue 5, Sep-Oct 2013, pp.1496-1502 RESEARCH ARTICLE www.ijera.com OPEN ACCESS Sage Package for Symbolic Computation of Series Solution of Ordinary Differential Equations M.Kaliyappan*, A.Vanav Kumar**, S.Hariharan*** *(School of Advanced Science, VIT University, Chennai) ** (School of Advanced Science, VIT University, Chennai) *** (School of Advanced Science, VIT University, Chennai) ABSTRACT The ordinary linear differential equations with constant coefficients can be solved by the algebraic methods and the solutions are obtained by elementary functions called the fundamental solutions. Most of the differential equations met in mathematics, physics and engineering sciences remain out of this class. In such cases, it is natural to search the solutions in the form of infinite series. The power series method is a well known procedure to solve ODEs with variable coefficients. The resulting series can be used to analyze and visualize the nature of the solutions of ODE’s for which direct calculation is difficult. Manually solving a series solution using power series method is tedious and time consuming. In this paper a special package using SAGE (an open source software) have been developed, which can calculate any number of coefficients with no restriction to obtain the series solutions of up to third order ODE at an ordinary point. Also the well known Legendre and Hermite polynomials of any order can be generated and visualized by the way getting series solutions, In addition, Frobenius method for finding series solution around regular singular point cases are discussed. Keywords - Ordinary Differential Equations, Power Series Solutions, SAGE for Differential Equations I. INTRODUCTION Many differential equations arising in practical applications are linear with variable coefficients which are not reduced by a differential equation with constant coefficients, needs a method to obtain classical solutions. Power series method is a standard strategy to solve linear differential equations with variable coefficients. The procedure to obtain power series solutions are well known and it is discussed in many differential equations book and some of the advanced engineering Mathematics books[1,2,4,5]. Manually solving these kind of equations can be tedious and in order to get more coefficients of the series it takes lot more time and mainly it is not possible to visualize the solutions without the existing mathematical packages. In this paper, a package through SAGE, to obtain the series solutions of second order ODE with ordinary point and Frobenius method for the case of solutions of the indicial equations not differ by integers through symbolic computation have been developed. The Legendre and Hermite differential equations have been solved and obtained their polynomials from their series solutions. Section II describes theoretical structure of solving second order ODE through power series method. A package through SAGE using symbolic computation have been given in Section III in order to solve third order ordinary differential equations using series solution. Section IV & V describes the Legendre and Hermite differential equations and visualizing their www.ijera.com polynomials respectively. The method of Frobenius for regular singular points are discussed in Section VI. Section VII describes the computation time comparison with MATLAB. II. SERIES SOLUTION FOR SECOND ORDER ODE HAVING VARIABLE COEFFICIENTS Consider the linear second-order differential equation (1) a 2 ( x) y   a1 ( x) y   a 0 ( x) y  0 … which can be converted to the following standard form (2) y   P( x) y   Q( x) y  0 …… by dividing the leading coefficient A point a0 ( x) . x 0 is said to be an ordinary point of the differential equation (1) if both P(x) and Q(x) are analytic at x 0 . A point that is not an ordinary point is said to be a singular point of the equation. Assume that x 0 is an ordinary point (2), so that solutions in powers of ( x  x0 ) actually do exists. Let (3) y  c 0  c1 ( x  x0 )  c 2 ( x  x0 ) 2  ... be the solution of (2). Since the series (3) converges on an interval x  x0  R about x 0 , it may be differentiated term by term on this interval twice in 1496 | P a g e
  • 2. M. Kaliyappan et al Int. Journal of Engineering Research and Application ISSN : 2248-9622, Vol. 3, Issue 5, Sep-Oct 2013, pp.1496-1502 succession to obtain dy  c1  2c 2 ( x  x0 )  3c 2 ( x  x 0 ) 2  ... dx (4) d2y  2c 2  6c 3 ( x  x 0 )  12 c 4 ( x  x 0 ) 2  ... dx 2 (5) respectively. By substituting the series in the right members of (2), (3) and (4) for y and its first two derivatives ,respectively, in the differential equation (1), one can get the series solution. Simplifying the resulting expression it takes the following form (6) K 0  K 1 ( x  x 0 )  K 2 ( x  x 0 ) 2  ...  0 Where the coefficients K i (i  0,1,2,3...) are functions of certain coefficients of the solution (3). By equating the coefficients to zero of each power of (x-x0) in the left member of (6) leads to a set of conditions that must be satisfied by the various coefficients in the series (3). If the are chosen to satisfy the set of conditions that thus occurs, then the resulting series (3) is the desired solution of the differential equation (1). III. SAGE CODE FOR GETTING SERIES SOLUTIONS OF AN ODE THROUGH SYMBOLIC COMPUTATIONS SAGE is an open-source mathematical software system that helps to perform many mathematical tasks such as plotting curves and surfaces, symbolic differentiation and integration and solving ODE etc[3]. SAGE have highly optimized functions that implement common numerical operations like integration, solving ordinary differential equations and solving systems of equations. It is almost a viable, free, open source alternative to Magma, Maple, Mathematica, and Matlab. Mathematician, scientist, or engineer can spend less time for doing tedious mathematical calculations by the way of using mathematical software and visualizing its solutions. Students can also benefit from mathematical software. The ability to plot functions and manipulate symbolic expressions easily can improve the understanding of mathematical concepts. The following is the SAGE package sersol(p1x,p2x,p3x,p4x,x0,i1,i2,i3,N,nh,n) for obtaining series solution for third order ODE around the ordinary point x = x0 and visualizing its solutions. Input: N ( Number of terms of the series ) p1x, p2x , p3x, x0, i1, i2, i3,n & nh where p1x, p2x, p3x & p4x are the coefficients of y , y , y  & y respectively, i1, i2& i3 are initial conditions, n is highest order of the derivative and nh represents the non homogeneous term. Output: Series Solutions with visualization www.ijera.com www.ijera.com def sersol(p1x,p2x,p3x,p4x,x0,i1,i2,i3,N,nh,n): x = var("x") z= var("z") cc=[0]*(N+2) dd=[0]*(N+1) ee=[0]*(N-2) aa = list(var('a_%d' % i) for i in (0..N)) y = sum(a*(x-x0)**i for i,a in enumerate(aa)) y1=y.substitute((x==z+x0)) p1z=p1x.substitute((x==z+x0)) p2z=p2x.substitute((x==z+x0)) p3z=p3x.substitute((x==z+x0)) p4z=p4x.substitute((x==z+x0)) nh1=nh.substitute((x==z+x0)) dy1=y1.derivative(z) d2y1=dy1.derivative(z) d3y1=d2y1.derivative(z) ode=p1z*d3y1+p2z*d2y1+p3z*dy1+p4z*y1-nh1; ode1=ode.simplify_full(); ode2=ode1.collect(z) l2=len(ode2) bb=[0]*(l2+1) for k in range(1,N+1): m=z^k bb[k] = (ode2.coefficient(m)==0) ode2 = ode2 - ode2.coefficient(m)*m for k in range(N+1,l2): m=z^(k) ode2=ode2 - ode2.coefficient(m)*m bb[0]=(ode2==0); for k in range(0,N-(n-1)): dd[k] = bb[k] for k in range(0,N-(n-1)): ee[k] = aa[k+3] sol=solve(dd,(ee)) c=sol[0]; y2=0 for k in range(0,n): y2=y2+aa[k]*z^k for k in range(0,N-(n-1)): y2=y2+(c[k].right_hand_side())*z**(k+n) y3=y2.substitute(z=0) y4=y2.derivative(z) y5=y4.substitute(z=0) y11=y4.derivative(z) y12=y11.substitute(z=0) y6=solve(y3==i1,a_0) y7=solve(y5==i2,a_1) y13=solve(y12==i3,a_2) y8=y2.substitute(a_0=y6[0].right_hand_side()) y9=y8.substitute(a_1=y7[0].right_hand_side()) y14=y9.substitute(a_2=y13[0].right_hand_side()) y10=y14.substitute((z==x-x0)) return(y10) 1497 | P a g e
  • 3. M. Kaliyappan et al Int. Journal of Engineering Research and Application ISSN : 2248-9622, Vol. 3, Issue 5, Sep-Oct 2013, pp.1496-1502 www.ijera.com Example 1 Consider the third order initial value problem given 1 1 y   2 y  0 with y(1)  1, y (1)  0 x x and y(1)  1 by: y   Output: The series solution for N=8 is 8 7 −(793/40320)(x−1) +(137/5040)(x−1) − 6 5 4 (29/720)(x−1) +(1/15)(x−1) −(1/8)(x−1) 3 2 +(1/6)(x−1) +(1/2)(x−1) +1 Figure 2: Visualizing solution curves for the ODE y   xy   y  0, y(0)  2, y (0)  1 for N=7,10 & 50 Example 3 Consider the following ordinary differential equation ( x  1) y   y   2( x  1) y  0, y(4)  5, y (4)  0 on the interval 4  x   around the ordinary point x0=4 Figure 1: Visualizing solution and solution curve for the ordinary differential equation y   1 1 y   2 y  0 with x x y(1)  1, y(1)  0, y(1)  1 ( N=8). Output: The series solution is 8 7 (205/163296)(x−4) +(23/6804)(x−4) 6 5 4 −(37/972)(x−4) −(2/27)(x−4) +(25/36)(x−4) 3 2 +(5/9)(x−4) −5(x−4) +5 Example 2 Consider the following initial value problem y   xy   y  0, y(0)  2, y (0)  1. Output: Figure 3: Visualizing solution and solution curve for the ODE ( x  1) y   y   2( x  1) y  0, y(4)  5, y (4)  0 and 4  x   Example 4 Comparison of series and exact solution curves for the following initial value problem y   2 y   y   2  24 e x  40 e 5 x , 1 5 9 y (0)  , y (0)  , y (0)   2 2 2 www.ijera.com 1498 | P a g e
  • 4. M. Kaliyappan et al Int. Journal of Engineering Research and Application ISSN : 2248-9622, Vol. 3, Issue 5, Sep-Oct 2013, pp.1496-1502 Figure 4: Comparison of series and exact solution of y   2 y   y   2  24 e x  40 e 5 x , y (0)  1 5 9 , y (0)  , y (0)   2 2 2 Example 5 Consider the following ordinary differential equation y   xy   y  e 3 x Output: The series solution is 8 6 (−1/13440)(5a0−148)x +(1/240)(a0+19)x 7 4 5 +(53/1680)x −(1/24)(a0−8)x +(7/40)x 2 3 +(1/2)(a0+1)x +(1/2)x +a1x+a0 Where a0 & a1 are arbitrary constants Example 6 Consider the following ordinary differential equation y   sin( x) y   e x y  0 Output: The series solution is 8 7 (1/40320)(49a0−110a1)x −(1/5040)(37a0+32a1)x − 6 5 (1/720)(5a0−14a1)x +(1/20)(a0+a1)x + 4 3 (1/12)(a0−a1)x −(1/6)(a0+2a1)x −(1/2)a0x2+a1x+a0 Where a0 & a1 are arbitrary constants For the above cases, expand the trignometrical and exponential terms as a Taylor series expansion about origin upto the number of terms one require. Since there are no initial condition given, the solution will be in terms of arbitrary constants as given above. The SAGE package is given for a third order equations and a simple modification in terms of the number of initial conditions and with the coefficients of derivative will give the solution of second order equations. www.ijera.com www.ijera.com IV. LEGENDRE POLYNOMIALS The Legendre differential equation 2   2 xy   n(n  1) y  0 ...(7) where (1  x ) y n=0,1,2,3,… is frequently encountered in physics and other technical fields. In particular, it occurs when solving Laplace's equation (and related partial differential equations) in spherical coordinates. The Legendre differential equation may be solved using the standard power series method. The equation (7) has regular singular points at x = ±1, its series solution about the origin will only converge for |x| < 1. When n is an integer, one of the series solution terminates depending on the nature of value of n. These solutions for n = 0, 1, 2,3, ... form a sequence of orthogonal polynomials called the Legendre polynomials. The following SAGE Package legendre(p1x,p2x,p3x,N) solves the Legendre differential equation (1  x 2 ) y   2 xy   n(n  1) y  0 and computes set of Legendre polynomials with visualization. Input: N (Number of terms of the series) 2, 2 p1x= 1-x p2x= -2x & p3x=n +n (Coefficients of y , y  & y respectively) Output: Legendre polynomials with visualization def legendre(p1x,p2x,p3x,N): x = var("x") n = var("n") N1= int(N/2) aa = list(var('a_%d' % i) for i in (0..N)) bb = [0]*(N+2) cc = [0]*(N-1) dd = [0]*(N+1) ee = [0]*(N-1) ff = [0]*(N-1) gg = [0]*(N1) hh = [0]*(N1) y = sum(a*x**i for i,a in enumerate(aa)) dy=y.derivative(x) d2y=dy.derivative(x) ode=p1x*d2y+p2x*dy+p3x*y; ode1=ode.simplify_full() ode2=ode1.collect(x) for k in range(1,N+1): m=x^k bb[k] = (ode2.coefficient(m)==0) ode2 = ode2 - ode2.coefficient(m)*m bb[0]=(ode2==0); for k in range(0,N-1): ee[k]=bb[k] cc[k]=aa[k+2] sol=solve(ee,(cc)) d=sol[0] y2=aa[0]+aa[1]*x; for k in range(0,N-1): y2=y2+(d[k].right_hand_side())*x**(k+2) i=0 for k in range(0,N-1 ,2): 1499 | P a g e
  • 5. M. Kaliyappan et al Int. Journal of Engineering Research and Application ISSN : 2248-9622, Vol. 3, Issue 5, Sep-Oct 2013, pp.1496-1502 y3=y2.substitute(a_1=0,n=k) y4=y3.substitute(x=1) y5=solve(y4==1,a_0) gg[i]=y3.substitute(a_0=y5[0].right_hand_side()) i=i+1 i=0 for k in range(1,N,2): y3=y2.substitute(a_0=0,n=k) y4=y3.substitute(x=1) y5=solve(y4==1,a_1) hh[i]=y3.substitute(a_1=y5[0].right_hand_side()) i=i+1 for k in range(0,N1): plot_list.append(plot(gg[k],(x,-1,1) )) for k in range(0,N1): plot_list.append(plot(hh[k],(x,-1,1) )) gr=sum(plot_list) gr.show() return(gg,hh) Output: 2 4 2 6 ([1, (3/2)x - 1/2, (35/8)x – (15/4)x + 3/8, (231/16)x 4 2 8 – (315/16)x + (105/16)x - 5/16, (6435/128)x – 6 4 2 (3003/32)x + (3465/64)x – (315/32)x + 35/128], 3 5 3 [x, (5/2)x – (3/2)x, (63/8)x – (35/4)x + (15/8)x, 7 5 3 (429/16)x - (693/16)x + (315/16)x – (35/16)x, 9 7 5 (12155/128)x – (6435/32)x +(9009/64)x – 3 (1155/32)x + (315/128)x]) Figure 3. Visualizing Legendre polynomials for N=10 V. HERMITE POLYNOMIALS The Hermite differential equation y  2 xy  2ny  0 is frequently encountered in physics and other technical fields. In particular, Hermite polynomials H n (x) arise in solving the Schrodinger equation for a harmonic oscillator. However, it also shows one way in which special functions arise from differential equations, so in that sense it is of interest to all. The following SAGE Package hermitesol(p1x,p2x,p3x,N) solves the Legendre differential equation y   2 xy   2ny  0 and computes set of Hermite polynomials for n=1,2,3… with visualization. www.ijera.com www.ijera.com Input: N (Number of terms of the series) p1x=1,p2x = -2x & p3x = 2n (Coefficients of y , y  & y respectively) Output: Hermite polynomial with visualization def hermitesol(p1x,p2x,p3x,N): x = var("x") n = var("n") N1=int(N/2) aa = list(var('a_%d' % i) for i in (0..N)) bb = [0]*(N+2) cc = [0]*(N-1) dd = [0]*(N+1) ee = [0]*(N-1) ff = [0]*(N-1) gg = [0]*(N1) hh = [0]*(N1) y = sum(a*x**i for i,a in enumerate(aa)) dy=y.derivative(x) d2y=dy.derivative(x) ode=p1x*d2y+p2x*dy+p3x*y; ode1=ode.simplify_full() ode2=ode1.collect(x) for k in range(1,N+1): m=x^k bb[k] = (ode2.coefficient(m)==0) ode2 = ode2 - ode2.coefficient(m)*m bb[0]=(ode2==0); for k in range(0,N-1): ee[k]=bb[k] cc[k]=aa[k+2] sol=solve(ee,(cc)) d=sol[0] y2=aa[0]+aa[1]*x; for k in range(0,N-1): y2=y2+(d[k].right_hand_side())*x**(k+2) i=0 for k in range(1,N,2): y3=y2.substitute(a_0=0,n=k) y4=y3.coefficient(x^k) y5=solve(y4==2**(k),a_1) gg[i]=y3.substitute(a_1=y5[0].right_hand_side()) i=i+1 i=1 hh[0]=1; i=1 for k in range(2,N-1,2): y3=y2.substitute(a_1=0,n=k) y4=y3.coefficient(x^k) y5=solve(y4==2**(k),a_0) hh[i]=y3.substitute(a_0=y5[0].right_hand_side()) i=i+1 plot_list=[] 1500 | P a g e
  • 6. M. Kaliyappan et al Int. Journal of Engineering Research and Application ISSN : 2248-9622, Vol. 3, Issue 5, Sep-Oct 2013, pp.1496-1502 for k in range(0,N1): plot_list.append(plot(gg[k],(x,-2,2) )) for k in range(0,N1): plot_list.append(plot(hh[k],(x,-2,2) )) gr=sum(plot_list) gr.show() return(gg,hh) Output: 3 5 3 7 5 [2x,8x −12x,32x −160x +120x,128x −1344x 3 9 7 5 3 +3360x −1680x, 512x −9216x +48384x −80640x +30240x] 2 4 2 6 4 2 [1,4x −2,16x −48x +12,64x −480x +720x −120, 8 6 4 2 256x −3584x +13440x −13440x +1680] www.ijera.com dd=[0]*(N) y3=[0]*2*(N+1) aa = list(var('a_%d' % i) for i in (0..N)) y = sum(a*x**i for i,a in enumerate(aa)) Px=p2x/p1x; Qx=p3x/p1x; px=x*Px; p4x=px.simplify_full() qx=x^2*Qx; q4x=qx.simplify_full() a1=p4x.substitute(x=0) b1=q4x.substitute(x=0) sol=solve(r*(r-1)+a1*r+b1= =0,(r)) for j in range(1,3): c=sol[j-1].right_hand_side() yp = y*x^(c) y1=yp.simplify_full(); dy=y1.derivative(x) d2y=dy.derivative(x) ode1=p1x*d2y+p2x*dy+p3x*y1; ode2=ode1.simplify_full(); ode=ode2/x^c; ode3=ode.collect(x) for k in range(0,N+1): m=x^k bb[k] = (ode3.coefficient(m)= =0) ode3 = ode3 - ode3.coefficient(m)*m bb[0]=(ode3= =0); Figure 4: Visualizing Hermite polynomials for N=10. VI. METHOD OF FROBENIOUS FOR REGULAR SINGULAR POINTS If the linear equation y  P( x) y  Q( x) y  0 ... (8) has an irregular singularity at x=x0 then the problem of finding series solution is not easy. If, however the above equation (8) has regular singular point at x=x0 then one can develop a method for finding a series solutions, valid in neighborhood of x0. This procedure is known as the method of Frobenius. In this article, the package for getting solutions valid in neighborhood of regular singular points (x0=0) is developed, whose indicial equations are different and not differ by integer. Input N (Number of terms of the series) p1x, p2x & p3x (Coefficients of y , y  & y respectively). Output Series solutions for k in range(0,N): bb1[k]=bb[k] for k in range(1,N+1): dd[k-1]=aa[k] sol1=solve(bb1,(dd)) sol2=sol1[0] y2=aa[0]*x^c for i in range(0,N-1): y2=y2+(sol2[i].right_hand_side())*x**(i+1+c) show(y2) return() Example 7 Consider the following ordinary differential equation 6 x 2 y   7 xy   (1  x 2 ) y  0, (0  x  ) Since x = 0 is a regular singular points for the differential equation, output is shown below The two linear independent solutions are (15/2) def frobenius(p1x,p2x,p3x,N): x = var("x") r = var("r") bb=[0]*(N+2) bb1=[0]*(N) cc=[0]*(N+1) www.ijera.com (11/2) (1/68078976)a0 x + (1/197904)a0 x (7/2) (3/2) +(1/1064)a0 x +(1/14)a0 x + (a0/√x) (25/3) (19/3) (1/411374976)a0 x +(1/970224)a0 x (13/3) (7/3) +(1/3944)a0 x +(1/34)a0 x +a0 x^(1/3) 1501 | P a g e
  • 7. M. Kaliyappan et al Int. Journal of Engineering Research and Application ISSN : 2248-9622, Vol. 3, Issue 5, Sep-Oct 2013, pp.1496-1502 Where a0 is arbitrary constant The above code can be modified for other singular points like one developed in this article and for other two cases of Frobenius such as the indicial equation’s equal roots and roots differ by an integer for getting two independent solutions can be done in a similar way. The results are verified for the example problems with [4], [5] and [6]. VII. COMPUTATION TIME COMPARISON [3] [4] [5] [6] www.ijera.com Craig Finch, Sage Beginner's Guide, Packt Publishing,2011 Michael D.Greenberg, Advanced engineering Mathematics, Second edition, Printice Hall,1998 Peter V O’neil, Advanced engineering Mathematics, International student edition, Thomson, 2007. Morris Tenenbaum, Harry Pollard, Ordinary Differential Equations, Dover publications, INC.,NewYork,1963 The Computation time comparison for obtaining the number of terms of the series for the ODE y   xy   y  0, y(0)  2, y (0)  1 using SAGE (Wall time) and MATLAB (tic-toc time) are presented in Table 1. Number of SAGE MATLAB coefficients of the series 50 1.252263212 3.712966 100 4.277512169 7.363384 150 10.05321922 11.65843 200 21.62953706 17.56204 250 32.45158839 24.66636 300 52.07608185 29.889488 Table 1: The Computation time comparison for obtaining the number of coefficients of the series for the ODE y   xy   y  0, y(0)  2, y (0)  1 using SAGE and MATLAB VIII. Conclusion This computational tool will help the students to understand the nature of the solution and study the behavior of the solution through visualization. The figures confirm that the behavior of the solution changes considerably when the number of terms of the solution increases, which may not be possible without the use of Mathematical software. This is the first time a package has been developed through SAGE to visualize the series solution of any order. The programs will help not only solving the differential equations upto order three, Legendre and Hemite differential equations but also generating and visualizing solutions around ordinary, regular singular points, Legendre and Hermite polynomials for any order. One can extend the same concept for higher order differential equations of any order. References [1] Shepley L . Ross, Differential equations, Third edition, John Wiley & sons [2] Erwin Kreyszig, Advanced Engineering Mathematics,nineth edition, John Wiley & Sons,Inc, 2006 www.ijera.com 1502 | P a g e