Chapter 7
7.2 FFT for Parabolic Equations
Example 7.2-1. ------
Solve the heat equation = with the following boundary conditions
u(0,t) = 1andu(1,t) = 0, for t > 0
The initial temperature distribution is u(x,0) = 0 for 0 < x < 1.
Solution ------
Assume that the solution can be written in a series expansion as
u(x,t) = (7.2-1)
In this equation, n(x) are the basis functions that can be obtained from Table 7-1, case I.
n(x) = sin(nx) ,n = 1, 2, …
In a one-dimensional transient problem the basis functions cannot involve time because the differential equation has only a first derivative in t; there is no way to formulate an eigenvalue problem in t. For this problem, the finite Fourier transform (FFT) of the temperature is defined as
n(t) = u(x,t)dx(7.2-2)
In this equation n(t) is defined as the transformed temperature. It is an integral transform in which the original function is multiplied by a kernel or basis function, and the result integrated over the finite interval 0 x 1. The limits of integration correspond to the range of x in the problem; these limits will be modified for different boundary conditions of x.
The function n(t) may be obtained by applying the FFT to both sides of the Laplace equation
dx = dx(7.2-3)
The left hand side becomes
dx = u(x,t)dx =
The right hand side of equation (7.2-3) is rearranged using integration by parts
d(wv) = wdv + vdw
= =
Let w = n(x) =
dv = dxv =
dx = n(x) dx
Applying the integration by parts again yields
dx = n(x) + udx
From the boundary conditions
n(x = 0) = 0, n(x = 1) = 0 and u(0,t) = 1, u(1,t) = 0
Therefore n(x) = 0 and = . From the basis functions
n(x) = sin(nx) ,
= ncos(nx) = (n)2 sin(nx) = (n)2n(x)
The right hand side of equation (7.2-3) becomes
dx = udx
dx = ncos(nx)|x=0 (n)2 u(x,y)dx
dx = ncos(0) (n)2n(t)
The original parabolic PDE becomes
= n (n)2n(7.2-4)
The initial temperature distribution is u(x,0) = 0, therefore n(0) = 0. Equation (7.2-4) can be integrated as follow
=
ln = t
1 nn = exp[(n)2t]
n =
The solution is then
u(x,t) = = sin(nx)
u(x,t) = 2
Since1 x = 2
The final form of the solution is
u(x,t) = 1 x 2
Table 7.2-1 lists the Matlab program used to plot the temperature u(x,t) at various time using ten partial sum. Figure 7.2-1 presents the temperature profile at t = 0.01, 0.02, 0.05, 0.1, and 0.2.
______Table 7.2-1Matlab program to plot 1 x 2______
% Example 7.2-1
clf
x=0:.05:1;
n=1:10;
conn=-(n*pi).^2;
npi=n*pi;
sinnx=sin(npi'*x);
t=[0.01 .02 .05 .1 .2];
nt=length(t);
hold on
for i=1:nt
ti=t(i);
expn=exp(conn*ti)./npi;
theta=1-x-2*expn*sinnx;
plot(x,theta)
grid on
end
xlabel('x');ylabel('u(x,t)')
------
Figure 7.2-1 Temperature profile at various times.
Example 7.2-2. ------
Solve the heat equation = with the following boundary conditions
(0,t) = 1and(1,t) = 0, for t > 0
The initial temperature distribution is u(x,0) = 0 for 0 < x < 1.
Solution ------
Assume that the solution can be written in a series expansion as
u(x,t) = (7.2-5)
In this equation, n(x) are the basis functions that can be obtained from Table 7-1, case IV.
n(0) = 1, n(x) = cos(nx) ,n = 1, 2, …
In a one-dimensional transient problem the basis functions cannot involve time because the differential equation has only a first derivative in t; there is no way to formulate an eigenvalue problem in t. For this problem, the finite Fourier transform (FFT) of the temperature is defined as
n(t) = u(x,t)dx(7.2-6)
In this equation n(t) is defined as the transformed temperature. It is an integral transform in which the original function is multiplied by a kernel or basis function, and the result integrated over the finite interval 0 x 1. The limits of integration correspond to the range of x in the problem; these limits will be modified for different boundary conditions of x.
The function n(t) may be obtained by applying the FFT to both sides of the Laplace equation
dx = dx(7.2-7)
The left hand side becomes
dx = u(x,t)dx =
The right hand side of equation (7.2-7) is rearranged using integration by parts
d(wv) = wdv + vdw
= =
Let w = n(x) =
dv = dxv =
dx = n(x) dx
Applying the integration by parts again yields
dx = n(x) + udx
From the basis functions
n(x) = cos(nx) ,
= nsin(nx) = (n)2cos(nx) = (n)2n(x)
Therefore = = 0. From the boundary condition (1,t) = 0 and (0,t) = 1, the right hand side of equation (7.2-7) becomes
dx = n(x) udx
dx =n(0) (n)2 u(x,y)dx = n(0) (n)2n
For n = 0
dx = 1
Equation (7.2-7) can be integrated
dx = dx(7.2-7)
= 1
The initial temperature distribution is u(x,0) = 0, therefore n(0) = 0 and we have
0(t) = t
For n > 0, the original parabolic PDE becomes
= n(0) (n)2n = cos(nx) (n)2n(7.2-8)
= (n)2n
Equation (7.2-8) can be integrated as follow
=
ln = t
1 (n)2n = exp[(n)2t] n =
The solution is then
u(x,t) = = t + cos(nx)
u(x,t) = t + cos(nx)
Table 7.2-2 lists the Matlab program used to plot the temperature u(x,t) at various time using ten partial sum. Figure 7.2-2 presents the temperature profile at t = 0.01, 0.02, 0.05, 0.1, and 0.2.
______Table 7.2-2Matlab program to plot t + cos(nx) ______
% Example 7.2-2
clf
x=0:.02:1; n=1:10;
conn=-(n*pi).^2;
npi=n*pi;
cosnx=cos(npi'*x);
t=[0.01 .02 .05 .1 .2];
nt=length(t);
hold on
for i=1:nt
ti=t(i);
expn=(1-exp(conn*ti))./npi.^2;
theta=ti+2*expn*cosnx;
plot(x,theta)
grid on
end
xlabel('x');ylabel('u(x,t)')
------
Figure 7.2-2 Temperature profile at various times.
1