Finite difference algorithm for solving parabolic partial differential

advertisement
The one dimensional heat equation, namely,
Finite difference algorithm for solving
parabolic partial differential equation
Ali jala Ali
πœ•π‘’
πœ•π‘‘
πœ•2 𝑒
= 𝛼 2 πœ•π‘₯ 2
Where, 𝛼 2
…………………………….. (2)
π‘˜
= 𝑝𝑐 is an example of parabolic equation
Email:alijalal2012jalal@gmail.com
𝛼2 =
πœ•π‘’
1
π‘Ž
, the equation (1.20), becomes,
πœ•2 𝑒
πœ•π‘₯ 2
−
π‘Ž πœ•π‘‘ = 0,
I. Abstract
Here𝐴
= 1,
𝐡 = 0,
𝐢 = 0,
Many partial differential equations cannot
∴ 𝐡 2 − 4𝐴𝐢 = 0. Therefore, it is parabolic in all
points.
be solved by analytical methods in closed
form solution. In most of the research work
in fields like, applied elasticity, theory of
plates and shells, hydrodynamics, quantum
mechanics etc., the research problems
The solution of this equation is a temperature
function 𝑒 (π‘₯, 𝑑) which is defined for values of π‘₯
from 0 to 𝑙 and for values of time t from 0to ∞. The
solution is not defined in a closed domain but
advances in an open-ended region from initial values,
satisfying the prescribed boundary
reduce to partial differential equations. Since
analytical solutions are not available, we go
in for numerical solution of the partial
differential equations by various methods.
Key words: partial differential equations,
hydrodynamics, applied elasticity.
II. Introduction.
Fig(1)
The general linear partial differential equation of the
second order in two independent variables is of the
form:
Such partial equation is said to be:
Satisfying
the
prescribed
boundary
conditions in general, the study of pressure
waves in a fluid propagation of heat and
unsteady state problems lead to parabolic
type of equations. In this paper we are
studying the finite difference algorithm for
solving parabolic partial differential
equation.
(1)Elliptic if 𝐡 2
III. Review of literature:
πœ•2 𝑒
𝐴 (π‘₯, 𝑦)𝑑π‘₯ 2 + 𝐡 (π‘₯, 𝑦) +
πœ•2 𝑒
πœ•2 𝑒
+
πœ•π‘₯πœ•π‘¦
πœ•π‘’ πœ•π‘’
𝐢(π‘₯, 𝑦) 𝑑𝑦 2 + 𝐹 (π‘₯, 𝑦, 𝑒, πœ•π‘₯ , πœ•π‘¦) = 0 … (1)
− 4 𝐴𝐢 < 0, (2) Parabolic if
𝐡 − 4 𝐴𝐢 = 0,
2
(3)Hyperbolic if
2
𝐡 − 4 𝐴𝐢 > 0,
Studied on analysis of stability for Lambert's
method based on Euler's rule. They showed
that the three nonlinear dynamic Euler
ordinary differential equations (ODEs),
concerning the motion of a rigid body free to
rotate about a fixed point, are reduced, by
means of a subsidiary function which is to
be determined, to three Abel equations of
the second kind of the normal form H.
Hayashi, T. Mitsui Further (1996).
studied many numerical methods to solve a
partial differential equation (PDE), for
example, finite difference method (FDM),
finite volume method (FVM), finite element
method (FEM), and so on. Here he mainly
illustrates those schemes, ideas and concepts
that have invented the development of FDM.
The related techniques will be introduced in
an easier way as possible, by the detailed
presentation of scheme and the theory
analysis for some simple model situations
.These contents will be introduced to
parabolic equation, hyperbolic equation and
elliptic equation respectively. The rest part
is the main body of his work, in which we
would like to begin with the FDMs for the
time-dependent problems. In the Second
World War, when large-scale practical
applications became possible with the aid of
computers. A major role was played by the
work of von Neumann, partly reported in
Zhang. Q ( 2005).
On the basis of available literature we
have studied different methods of finite
to
solve
Nicolson method, Iterative method, and Du
fort Frankle method) in one dimensional
heat equation
And (ADE) (Alternating Direction Explicit )
method for two dimensional heat equation.
IV. Results and discussion:
1. Two dimensional heat equation
The heat-conduction equation can be applied
to more than one spatial dimension. For two
dimensions, its form is:
πœ•π‘’
πœ•π‘‘
πœ•2 𝑒
πœ•2 𝑒
πœ•π‘₯
𝑐 2π‘˜
πœ•π‘¦ 2
= 𝛼(
+
2
)Where,𝛼 =
β„Ž2
Example: 1 (solve one dimensional heat
equation)
Find the analytical solution of the parabolic
equation
𝑒π‘₯π‘₯ = 2𝑒𝑑 when 𝑒(0, 𝑑) = 𝑒(4, 𝑑) =
0 and 𝑒(π‘₯, 0) = π‘₯(4 − π‘₯), takingβ„Ž = 1,
1
2
and 𝑐 = ,
2
Find the values up to 𝑑 = 5
Solution:
V.METHODOLOGY:
difference
The methods are (Schmidt method, Crank-
one
dimensional
parabolic differential equation and two
dimensional parabolic differential equation.
It is already given parabolic equation
𝑒π‘₯π‘₯ = 2𝑒𝑑
1 πœ• 2 𝑒 𝑑𝑒
=
2 πœ•π‘₯ 2 𝑑𝑑
and also given the boundary condition,
𝑒(0, 𝑑) = 𝑒(4, 𝑑) = 0
the initial condition 𝑒(π‘₯, 0) = π‘₯(4 − π‘₯),
we can write parabolic equation in the form,
𝑑𝑒
𝑑𝑑
(1)
=
Now,
𝑋′′ = −𝑝2 𝑋
1 πœ•2 𝑒
𝑑2𝑋
= −𝑝2 𝑋
2
𝑑π‘₯
2 πœ•π‘₯ 2
1
where 𝑐 2 =
𝐷2 𝑋 = −𝑝2 𝑋
2
π‘š = ± 𝑖𝑝
𝑒 = 𝑋𝑇
Let
(2)
X is the function of x only and T is the
function of 𝑑 only.
𝑋 = 𝑐2 cos 𝑝π‘₯ + 𝑐3 sin 𝑝π‘₯
where
Differentiating (2) partially 𝑀. π‘Ÿ. 𝑑 . 𝑑, we
get
πœ•π‘’
πœ•π‘‘
(3)
We have,
𝑐2 =
1
2
equation (2) we get,
,
put the value of
𝑋 and 𝑇 in
𝑒 = (𝑐2 cos 𝑝π‘₯ + 𝑐3 sin 𝑝π‘₯ ) 𝑐1 𝑒
−𝑝2 𝑑
2
(5)
= 𝑋𝑇′
πœ•2 𝑒
πœ•π‘₯ 2
(4)
Now, put the value of
𝑒(0, 𝑑) = 0, where
π‘₯ = 0 in equation (5), we get
= 𝑋"𝑇
0 = 𝑐2 𝑐1 𝑒
Let (3) and (4) equal −𝑝2
𝑋𝑇′ = 𝑐 2 𝑋"𝑇
=
Let 𝑐2 = 0, arbitrary constant
2 2
𝑐1 𝑒 −𝑐 𝑝 𝑑 so 𝑐1 ≠ 0,
−𝑝2
Separating variables, we get
𝑒 = (𝑐3 sin 𝑝π‘₯ ) 𝑐1 𝑒
′′
𝑑2𝑋
=
𝑑π‘₯ 2
π‘Žπ‘›π‘‘ 𝑇 ′ =
𝑇′ = −𝑐 2 𝑝2 𝑇
𝑑𝑇
= −𝑐 2 𝑝2 𝑇
𝑑𝑑
π‘š = −𝑐 𝑝
𝑇 = 𝑐1 𝑒 −𝑐
−𝑝2 𝑑
2
𝑑𝑇
𝑑𝑑
0 = 𝑐3 sin 4𝑝 𝑐1 𝑒
−𝑝2 𝑑
2
sin 4𝑝 = 0 = sin π‘›πœ‹
𝑝=
π‘›πœ‹
4
Put the value of p in equation (6)
2
2 𝑝2 𝑑
𝑇=
put the value of 𝑒(4, 𝑑) = 0, where π‘₯ =
4 in equation (6), we get
𝐷𝑇 = −𝑐 2 𝑝2 𝑇
2
we have
(6)
𝑋"
1 𝑇′
= 2
= −𝑝2
𝑋
𝑐 𝑇
Where 𝑋
−𝑝2 𝑑
2
π‘›πœ‹
𝑒 = 𝑐3 sin( )π‘₯ 𝑐1 𝑒
4
−(
π‘›πœ‹ 2
) 𝑑
4
2
π‘›πœ‹
𝑒 = 𝑐1 𝑐3 𝑠𝑖𝑛( )π‘₯ 𝑒
𝑛2 πœ‹2
)𝑑
32
(
4
………
= ∑ 𝑏𝑛
Where 𝑐1 𝑐3
−
π‘›πœ‹
𝑒 = ∑ 𝑏𝑛 𝑠𝑖𝑛( ) π‘₯ 𝑒
𝑛2 πœ‹2
)𝑑
32
−(
..(5)
4
𝑏𝑛
Now we find the value of
series,
by Fourier
2 𝑙
π‘›πœ‹π‘₯
𝑏𝑛 = ∫ 𝑓(π‘₯) sin(
) 𝑑π‘₯
𝑙 0
𝑙
2 4
π‘›πœ‹π‘₯
= ∫ π‘₯(4 − π‘₯) sin(
) 𝑑π‘₯
4 0
4
𝑏𝑛 =
1
2
4
1
2
4
∫0 4π‘₯ sin(
∫0 π‘₯ 2 𝑠𝑖𝑛(
π‘›πœ‹π‘₯
4
π‘›πœ‹π‘₯
4
) 𝑑π‘₯
𝐼1 = 2 [ −π‘₯
𝐼1 = −32
π‘›πœ‹π‘₯
)
4
π‘›πœ‹
(4)
π‘π‘œπ‘  π‘›πœ‹
π‘›πœ‹
π‘π‘œπ‘  π‘›πœ‹
[−16
2
43
π‘›πœ‹
(4)
𝐼2 = [−32
1)]
π‘π‘œπ‘  π‘›πœ‹
+
π‘›πœ‹
𝑏𝑛 = −32
π‘›πœ‹ 2
)
4
}]
+
64
𝑛3 πœ‹ 3
(π‘π‘œπ‘  π‘›πœ‹ −
64
(π‘π‘œπ‘  π‘›πœ‹ − 1)
𝑛3 πœ‹ 3
𝑛=0
When
𝑏0 = 0
𝑏1 = −
Put
64
πœ‹3
(−2)
128
𝑏1 =
πœ‹3
Integration second part from equation (9)
π‘›πœ‹π‘₯
π‘π‘œπ‘  (
1
4 )}
𝐼2 = [{−π‘₯ 2
π‘›πœ‹
2
(4)
π‘›πœ‹π‘₯
𝑠𝑖𝑛 (
)
8
4
−
{−π‘₯
}
π‘›πœ‹
π‘›πœ‹
(4)
π‘›πœ‹π‘₯
8 cos ( 4 )
+
{
}]
π‘›πœ‹ 2
π‘›πœ‹
(4)
(
π‘π‘œπ‘  π‘›πœ‹
π‘π‘œπ‘  π‘›πœ‹
+ 32
π‘›πœ‹
π‘›πœ‹
64
− 3 3 (π‘π‘œπ‘  π‘›πœ‹ − 1)
𝑛 πœ‹
]
…………….. (10)
π‘›πœ‹
Putting the value of (10) and (11) in (9) we
get,
𝑏𝑛 = −
π‘›πœ‹π‘₯ [
)
4
2
π‘›πœ‹
( ) 0
4
cos π‘›πœ‹
{
……………………………………..(11)
……..(9)
𝑠𝑖𝑛(
8
+
[1]
𝑛3 πœ‹ 3
) 𝑑π‘₯ −
Integration first part from equation (9) by
the form of integral,
4
π‘π‘œπ‘ (
1
=
value of 𝑏41 in equation (8), we get
4
𝑒=
128
πœ‹3
Where 𝑛
𝑒1 =
𝑒1 =
π‘›πœ‹
𝑠𝑖𝑛( ) π‘₯ 𝑒
𝑛2 πœ‹2
)𝑑
32
−(
4
…… (12)
= 1
4.128196
√2
×
πœ‹2
−( )𝑑
𝑒 32
4.128196 × 0.731615
√2
= 2.1356
𝑒2 = 4.128196 ×
πœ‹2
−( )𝑑
𝑒 32
𝛼=
π‘˜π‘ 2
1
𝑒2 = 3.032585
β„Ž2
=
1
2
By Schmidt method
𝛼
must be
2
3π‘›πœ‹ −(πœ‹32)𝑑
𝑒3 = 4.128196 𝑠𝑖𝑛(
)𝑒
4
By Schmidt formula the following results are
𝑒3 = 2.1356 .
When 𝑖 = 1,2,3 and 𝑗 = 0,
2
obtained,
𝑒𝑖,𝑗+1 =
1
2
[𝑒𝑖−1,𝑗 + 𝑒𝑖+1,𝑗 ]
𝑒1 =
1
[0 + 4] = 2
2
Now we solve (Example: 1) by numerical
methods
𝑒2 =
1
[3 + 3] = 3
2
Find the solution of the parabolic equation
𝑒3 =
1
[4 + 0] = 2
2
Analytical solution for 𝑒1 , 𝑒2 , 𝑒3 .
Numerical solution:
𝑒π‘₯π‘₯ = 2𝑒𝑑 when 𝑒(0, 𝑑) = 𝑒(4, 𝑑) =
0 and 𝑒(π‘₯, 0) = π‘₯(4 − π‘₯), taking β„Ž = 1.
Find the values up to 𝑑 = 5.
When 𝑖
𝑒5 =
Solution:
Given a parabolic equation 𝑒π‘₯π‘₯ = 2𝑒𝑑
𝑒7 =
Also given the boundary condition,
𝑒(0, 𝑑) = 𝑒(4, 𝑑) = 0
When 𝑖
and the initial condition 𝑒(π‘₯, 0) =
when we put the value of π‘₯ = 1,2,3,4 in
the relation of the initial condition, it gives
that,
𝑒(0,0) = 3, 𝑒(1,0) = 4, 𝑒(2,0)
= 3, 𝑒(3,0)
= 3, 𝑒(4,0) = 0,
using these values we can find
1
[2 + 2] = 2
2
1
[3 + 0] = 1.5
2
= 1,2, 3 π‘Žπ‘›π‘‘ 𝑗 = 2
𝑒9 =
π‘₯(4 − π‘₯),
β„Ž = 1, π‘˜ = 1, π‘Žπ‘›π‘‘ 𝑐 =
1
[0 + 3] = 1.5
2
𝑒6 =
1 πœ• 2 𝑒 𝑑𝑒
=
2 πœ•π‘₯ 2 𝑑𝑑
we have
= 1,2,3 π‘Žπ‘›π‘‘ 𝑗 = 1,
1
,
2
𝑒10 =
1
[0 + 2] = 1
2
1
[1.5 + 1.5] = 1.5
2
𝑒11 =
1
[2 + 0] = 1
2
Now solve by Crank-Nicolson formula:
− 𝛼𝑒𝑖−1,𝑗+1 + (2 + 2𝛼)𝑒𝑖,𝑗+1
− 𝛼𝑒𝑖+1,𝑗+1
= 𝛼𝑒𝑖−1,𝑗
+ (2 − 2𝛼)𝑒𝑖,𝑗
+ 𝛼𝑒𝑖+1,𝑗
Put 𝛼
=
𝑒1 = 2.176470588, 𝑒2 =
3.058823529, 𝑒3 = 2.176470588,
When 𝑖 = 1,2,3 π‘Žπ‘›π‘‘ 𝑗 = 1,
In the same way can we find,
𝑒4 = 1.615916955, 𝑒5 =
2.283737023, 𝑒6 = 1.615916955,
1
2
− 𝑒𝑖−1,𝑗+1 + 6 𝑒𝑖,𝑗+1 − 𝑒𝑖+1,𝑗+1
= 𝑒𝑖−1,𝑗 + 2 𝑒𝑖,𝑗
+ 𝑒𝑖+1,𝑗
When 𝑖
= 1,2,3 π‘Žπ‘›π‘‘ 𝑗 = 0,
− 0 + 6 𝑒1,1 − 𝑒2,1 = 𝑒0 + 2 𝑒1 + 𝑒2
…………………………..(i)
− 𝑒1,1 + 6 𝑒2,1 − 𝑒3,1 = 𝑒1 +
2 𝑒2 + 𝑒3
(𝑖𝑖)
−𝑒2,1 + 6 𝑒3,1 − 𝑒4,1 = 𝑒2 +
2 𝑒3 + 𝑒4
Result: First step using the Analytical
solution and Crank-Nicolson, BenderSchmidt,
Analytic
al result
2.1356
3.032585
2.1356
Schmidt
2
3
2
Crank
2.1764705
88
3.05882335
29
2.1764705
88
(𝑖𝑖𝑖)
When the initial conditions are given in
(𝑖), (𝑖𝑖), (𝑖𝑖𝑖), we get.
Second step using the Crank-Nicolson and
Bender-Schmidt
6 𝑒1 − 𝑒2 + 0𝑒3 = 10
(𝑖)
Schmidt
1.5
2
1.5
Crank
1.615916955
2.283737023
1.615916955
− 𝑒1 + 6 𝑒2 − 𝑒3 = 14
𝑒1
(𝑖𝑖)
𝑒2
− 𝑒2 + 6 𝑒3 + 0 𝑒4 = 10
(𝑖𝑖𝑖)
When we solve the equations
(𝑖), (𝑖𝑖), (𝑖𝑖𝑖), by manual or by
calculator it gives that,
VI.Conclusion:
On the basis of the above discussion we get
the result obtained by analytical methods is
always providing accurate solution but
numerical solution always providing
approximate result. But among these
𝑒3
numerical methods Crank-Nicolsan method
was providing fast convergence in
comparison to Bender-Schdimit method.
Since it is not possible to solve every partial
differential
equation
analytically so
numerical methods providing a good
agreement in those cases where solutions not
exist or we are unable to solve partial
differential equation analytically.
References:
1. Sastry.s.s, june, (2012) '' introduction
methods of numerical analysis published by
Asoke k. Ghosh, PHI Learning private
limited.
2. N.P.Bali, Dr Manish Goyal, (2012).
Eighth Edition engineering mathematics
publisher by, university science press,133
golden house, new Delhi.
3. Dr. Grewal,(2013).
Ninth edition
numerical methods in engineering and
science, with programs in c and c++,
published by: Romesh Chander Khan na , 2B nath market, NaiSarak Delhi.
4. K. SankaraRao(2012), numerical methods
for Scientists and engineers ,third edition,
published by Asoke K. PHI limited M-97,
Connaught circus, new Delhi -110001.
5. Robinson, James C. (2001). Infinitedimensional dynamical systems: An
introduction to dissipative parabolic PDEs
and the theory of global attractors.
Cambridge: Cambridge University Press.
6. p. Kandasamy K. Thilagavathy K.
Gunavathi,(2000),Numerical
methods.
Publisher by, s. chand and company ltd,.
Download