Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

METHOD OF SEPERATION

OF VARIABLES
Method of separation of variables
 We shall introduce one of the most common, oldest and elementary methods
called the method of separation of variables for solving initial-boundary value
problems. Method of separation of variable is applicable to a large number of
linear PDEs. The class of problems for which this method is applicable contain
a wide range of problems of mathematical physics, applied mathematics and
engineering sciences.
 The theme here is to reduce the given PDE into number of ODEs and then
construct the solution of the governing ODES. In this method we seek solutions
which are product of functions of separate variables.
 The method is illustrated with the help of following examples (heat, wave and
Laplace equation).
 Seperation of variable:
Consider the diffusion problem with Dirichlet boundary conditions
𝑢𝑡 = 𝛼 2 𝑢𝑥𝑥 0 < 𝑥 < 𝐿, 𝑡>0
𝑢 0, 𝑡 = 𝑢1 , 𝑢 𝑏, 𝑡 = 𝑢2 , 𝑡>0
𝑢 𝑥, 0 = 𝑓(𝑥) 0<𝑥<𝐿
Here we assume that the end temperatures 𝑢1 and 𝑢2 are constant.

 Steady State Solution:


This is a solution of the PDE + boundary conditions that does not change with
time. Can we find it?
Must have 𝑢𝑡 = 0 So
𝑢𝑥𝑥 = 0, 𝑢 0 = 𝑢1 , 𝑢 𝐿 = 𝑢2
=> 𝑢𝑥 = 𝑐1
=> 𝑢 = 𝑐1 𝑥 + 𝑐2
x= 0 𝑢 = 𝑐2 So 𝑐2 = 𝑢1
x= 𝐿 𝑢 = 𝑐1 𝐿 + 𝑐2 = 𝑐1 𝐿 + 𝑢1 = 𝑢2
𝑢2 −𝑢1
So 𝑐1 =
𝐿
So the steady state solution is given by:

𝑢2 − 𝑢1
𝑢 = 𝑢𝑠 𝑥 = 𝑥 + 𝑢1
𝐿

𝑢
𝑢1
𝑢 = 𝑢𝑠 (𝑥)

-------------------------------------
𝑢2
𝐿

𝑥
Physically we expect all solutions to tend towards the steady state solution as
𝑡 → ∞.
 Simplification of the boundary conditions:
Let U 𝑥, 𝑡 = 𝑢 𝑥, 𝑡 − 𝑢𝑠 𝑥
𝑢 and 𝑢𝑠 are both solutions of a homogenous linear PDE, so we know 𝑈 as well
as 𝑢 satisfies 𝑏. 𝑐.
U 0, 𝑡 = 𝑢 0, 𝑡 − 𝑢𝑠 0 = 𝑢1 − 𝑢1 = 0
𝑈 𝐿, 𝑡 = 𝑢 𝐿, 𝑡 − 𝑢𝑠 𝐿 = 𝑢2 − 𝑢2 = 0
𝑈 satisfies a differential initial condition:
U(𝑥, 0) = 𝑢(𝑥, 0) − 𝑢𝑠 (𝑥)
= 𝑓 𝑥 − 𝑢𝑠 (𝑥)
So we can find 𝑈 by solving
𝑈𝑡 =∝2 𝑈𝑥𝑥
U 0, 𝑡 = 0, 𝑈 𝐿, 𝑡 = 0
𝑈 𝑥, 0 = 𝑔 𝑥 = 𝑓 𝑥 − 𝑢𝑠 𝑥
Note: The text takes a direct approach. It doesn’t make use of 𝑢𝑠 , which makes
the solution a little messy.
 Solution x by separation of variables:
Try 𝐔 = 𝑿 𝒙 𝑻(𝒕). This is a special form of solution.
𝑼 𝒕 = 𝑿 𝒙 𝑻′ 𝒕 𝑼𝒙𝒙 = 𝒙′′ 𝒙 𝑻(𝒕)
Plug these into PDE:
𝑿 𝒙 𝑻′ 𝒕 = 𝜶𝟐 𝑿′′ 𝑿 𝑻 𝒕
Now divide each side by 𝑋 𝑥 𝑇(𝑡)
𝑻′ (𝒕) 𝑿′′ (𝒙)
= = −𝒌𝟐 ----------eq.1 (variables are
𝜶𝟐 𝑻(𝒕) 𝑿(𝒙)
separated!)
Notice that the left-hand-side is a function of 𝒕 and the right-hand-side is a
function of 𝒙. But 𝒙 and 𝒕 are independent variables; we can change one
without changing the others. Thus equation 1 makes senses only if each
side=constant.
𝑻′ 𝒕 𝑿′′ 𝒙
So = −𝒌𝟐 , = −𝒌𝟐
𝜶𝟐 𝑻(𝒕) 𝑿 𝒙

But 𝑋 ′′ 𝑥 = −𝑘 2 𝑋 𝑥 ⇒ 𝑋(𝑥) = 𝐴𝑐𝑜𝑠(𝑘𝑥) + 𝐵𝑠𝑖𝑛(𝑘𝑥)


𝟐 𝜶𝟐 𝒕
𝑇 ′ 𝑡 = −𝑘 2 𝛼 2 𝑇 𝑡 ⇒ 𝑻 𝒕 = 𝑪𝒆−𝒌
 Apply boundary conditions:
Need 𝑈 0, 𝑡 = 𝑈 𝐿, 𝑡 = 0. This works if X(0) and 𝑋(𝐿) = 0.
𝑋 0 = 0 ⇒ A=0 So 𝑋 𝑥 = 𝐵𝑠𝑖𝑛(𝑘𝑥)
𝑋 𝐿 = 0 ⇒ 𝐵 sin 𝑘𝐿 = 0 -------------eq.2
If 𝐵 = 0 then we end up with U = 0, which isn’t much use. But if KL is the
multiple of 𝜋 then equation 2 is satisfied.
So write 𝑘𝐿 = 𝑛𝜋, n=1,2,3,…
𝑛𝜋
or 𝑘=
𝐿

Our special solution is of the form


𝑛𝜋𝑥 −𝑛2𝜋22𝛼 2𝑡
𝑋 𝑥 𝑇 𝑡 = 𝐶𝐵𝑠𝑖𝑛 𝑒 𝐿
𝐿
2 2 2
𝑛𝜋𝑥 −𝑛 𝜋2 𝛼 𝑡
= 𝑘𝑛 𝑠𝑖𝑛 𝑒 𝐿 n=1,2,3,…
𝐿

But linear combinations of this will also satisfy the PDE and homogeneous
boundary condition. So go for an infinite linear combination:
𝑛𝜋𝛼
𝑛𝜋𝑥 −( )2 𝑡
U 𝑥, 𝑡 = σ∞ 𝑘
𝑛=1 𝑛 𝑠𝑖𝑛 𝑒 𝐿
𝐿
 Finding the constants 𝒌𝒏 :
Recall that 𝑈 𝑥, 0 = 𝑔(𝑥). But our series solution gives us 𝑈(𝑥, 0) in term of
the constants:
𝑛𝜋𝑥
𝑈 𝑥, 0 = σ∞
𝑛=1 𝑘𝑛 𝑠𝑖𝑛 =𝑔 𝑥 ------------eq.3
𝐿

Can we find each 𝑘𝑛 from this?


We make use of a special orthogonality property of sine functions:
𝐿 𝐿
𝑛𝜋𝑥 𝑚𝜋𝑥 𝑖𝑓 𝑚 = 𝑛
න 𝑠𝑖𝑛 𝑠𝑖𝑛 𝑑𝑥 = ቐ2
0 𝐿 𝐿 0 𝑖𝑓 𝑚 ≠ 𝑛
𝑚𝜋𝑥
We’ll verify this below. But for now, multiply equation (3) by 𝑠𝑖𝑛 and
𝐿
integrate each side from 0 to 𝐿
𝐿 𝑛𝜋𝑥 𝑚𝜋𝑥 𝐿 𝑚𝜋𝑥
‫׬‬0 σ∞
𝑛=1 𝑘𝑛 𝑠𝑖𝑛 𝐿
𝑠𝑖𝑛
𝐿
𝑑𝑥 = ‫׬‬0 𝑔(𝑥) 𝑠𝑖𝑛
𝐿
𝑑𝑥

If the series converges nicely, we can interchange the summation and


integration so that
𝐿 𝑛𝜋𝑥 𝑚𝜋𝑥 𝐿 𝑚𝜋𝑥
σ∞
𝑛=1 𝑘𝑛 ‫׬‬0 𝑠𝑖𝑛 𝑠𝑖𝑛 𝑑𝑥 = ‫׬‬0 𝑔 𝑥 𝑠𝑖𝑛 𝑑𝑥
𝐿 𝐿 𝐿
But only one term in the sum on the L.H.S. is non-zero; the term
corresponding to 𝑛 = 𝑚. So we obtain
𝐿
𝐿 𝑚𝜋𝑥
𝑘𝑚 = න 𝑔 𝑥 𝑠𝑖𝑛 𝑑𝑥
2 0 𝐿
and this gives a formula for 𝑘𝑚 :
2 𝐿 𝑚𝜋𝑥
𝑘𝑚 = න 𝑔 𝑥 sin 𝑑𝑥
𝐿 0 𝐿
Example:
Suppose that 𝑔(𝑥) = 𝑇0 (a constant)
2 𝐿 𝑛𝜋𝑥 2𝑇0 −𝐿
𝑘𝑛 = ‫׬‬0 𝑇0 sin 𝑑𝑥 = [ 𝑐𝑜𝑠𝑛𝜋𝑥]𝐿0
𝐿 𝐿 𝐿 𝑛𝜋
2𝑇0
= −𝑐𝑜𝑠𝑛𝜋 + 1
𝑛𝜋
2𝑇0
= (1 − (−1)𝑛 )
𝑛𝜋
4𝑇0
, if 𝑛 is odd
= ቐ 𝑛𝜋
0 𝑖𝑓 𝑛 𝑖𝑠 𝑒𝑣𝑒𝑛
So
𝑛𝜋𝛼
𝑛𝜋𝑥 −( )2 𝑡
U(𝑥, 𝑡) = σ∞ 𝑘
𝑛=1 𝑛 𝑠𝑖𝑛 𝑒 𝐿
𝐿
𝑛𝜋𝛼 2
4𝑇0 1 𝑛𝜋𝑥 −( ) 𝑡
= σ𝑛 𝑜𝑑𝑑 𝑠𝑖𝑛 𝑒 𝐿
𝜋 𝑛 𝐿
2 3𝜋𝛼2 2
4𝑇0 𝜋𝑥 −(𝜋𝛼 )2 𝑡 1 3𝜋𝑥 −( ) 𝑡 1 5𝜋𝑥
i.e. U 𝑥, 𝑡 = (𝑠𝑖𝑛 𝑒 𝐿 + 𝑠𝑖𝑛 𝑒 𝐿 + 𝑠𝑖𝑛
𝜋 𝐿 3 𝐿 5 𝐿
5𝜋𝛼2 2
−( ) 𝑡
𝑒 𝐿 +⋯)
Home Task:
Compute the solution using MATLAB code.
For the case of a 10𝑐𝑚 copper rod, initially put in boiling water and
removed at 𝑡 = 0 we have
1.14𝑐𝑚 2
𝐿 = 10, 𝛼2 = , 𝑇0 = 100
𝑠𝑒𝑐
Also plot a graph showing u at several time values:
𝑥 = 𝑙𝑖𝑛𝑠𝑝𝑎𝑐𝑒 0,10 ;
𝑝𝑙𝑜𝑡 𝑥. 𝑢 𝑥, 0 , 𝑥, 𝑢 𝑥, 1 , 𝑥, 𝑢 𝑥, 5 , 𝑥, 𝑢 𝑥, 12
Also verify the orthogonality conditions.
Fourier Series
These are series of sines and cosines such as those we found when solving the
heat equation. We need to study these series more carefully.
Preliminaries
𝑓 is even and odd if 𝑓 𝑥 = 𝑓(−𝑥) and 𝑓 𝑥 = −𝑓(−𝑥) respectively.
Note:
1. Even + even = even
2. Odd + odd = odd
3. Even x even = even
4. Odd x odd = even
5. Odd x even = odd
𝐴
If 𝑓 is odd then ‫׬‬−𝐴 𝑓 𝑥 𝑑𝑥 = 0
𝐴 𝐴
If 𝑓 is even then ‫׬‬−𝐴 𝑓 𝑥 𝑑𝑥 = 2 ‫׬‬0 𝑓 𝑥 𝑑𝑥
Any function can be written as a sum of even and odd function:
𝑓 𝑥 + 𝑓(−𝑥) 𝑓 𝑥 − 𝑓(−𝑥)
𝑓 𝑥 = +
2 2
even odd
e.g.
𝑒 𝑥 +𝑒 −𝑥 𝑒 𝑥 −𝑒 −𝑥
𝑓 𝑥 = 𝑒𝑥 = +
2 2
= cosh 𝑥 + sinh(𝑥)
If 𝑓 𝑥 + 𝑇 = 𝑓(𝑥) we say that 𝑓 is periodic with period 𝑇. If 𝑓 has period
𝑇 then it also has period 2𝑇, 3𝑇, etc. The smallest period of a function is
called its fundamental period. 𝑆𝑖𝑛𝑒 and cos each has period 2𝜋 while
tan has period 𝜋.
Fourier series of a periodic function
𝑛𝜋𝑥 𝑛𝜋𝑥
The functions cos , 𝑛 = 0,1,2, … and sin , 𝑛 = 1,2, … each has
𝑙 𝑙
period 2𝑙
So if 𝑓(𝑥) has period 2𝑙, can we write
∞ ∞
𝑛𝜋𝑥 𝑛𝜋𝑥
𝑓 𝑥 = ෍ 𝑎𝑛 cos + ෍ 𝑏𝑛 sin( )
𝑙 𝑙
𝑛=0 𝑛=1
𝑛𝜋𝑥 𝑛𝜋𝑥
= 𝑎0 + σ∞
𝑛=1 𝑎𝑛 cos + σ∞
𝑛=1 𝑏𝑛 sin( ) ----
𝑙 𝑙
eq.1
Orthogonality equations
𝑙 𝑚𝜋𝑥 𝑛𝜋𝑥
1. ‫׬‬−𝑙 sin 𝑙
cos
𝑙
𝑑𝑥 = 0

𝑙 𝑚𝜋𝑥 𝑛𝜋𝑥 0 𝑚≠𝑛


2. ‫׬‬−𝑙 sin sin 𝑑𝑥 = ቊ
𝑙 𝑙 𝑙 𝑚=𝑛

0 𝑚≠𝑛
𝑙 𝑚𝜋𝑥 𝑛𝜋𝑥
3. ‫׬‬−𝑙 cos 𝑙 cos
𝑙
𝑑𝑥 = ቐ 𝑙 𝑚=𝑛≠0
2𝑙 𝑚=𝑛=0
Hence if eq.(1) holds then by using orthogonality we have
1 𝑙
𝑎0 = ‫𝑓 ׬‬ 𝑥 𝑑𝑥 Average value of 𝑓
2𝑙 −𝑙
𝑙
1 𝑚𝜋𝑥
𝑎𝑚 = න 𝑓 𝑥 𝑐𝑜𝑠 𝑑𝑥 𝑚 ≥ 1
𝑙 −𝑙 𝑙
1 𝑙 𝑚𝜋𝑥
𝑏𝑚 = ‫׬‬−𝑙 𝑓 𝑥 𝑠𝑖𝑛 𝑑𝑥
𝑙 𝑙

Fourier Convergence Theorem


Let 𝑓 and 𝑓 ′ be piecewise continuous on [−𝑙, 𝑙], where 𝑓 is a 2𝑙-periodic
function. Then the Fourier series of 𝑓 converges to 𝑓(𝑥) at each point 𝑥 at
which 𝑓 is continuous, and to the mean value
1
(𝑓 𝑥 − + 𝑓 𝑥 + )
2
At each point at which 𝑓 is not continuous.
Example (saw-tooth):

-2 -1 1 2 3

𝑓 and 𝑓 ′ piecewise continuous. In fact, 𝑓 is continuous so the Fourier


senses converges to 𝑓(𝑥).
 Example square wave:

y
𝐹=4 𝐹=4
𝐹=0

-2𝜋 -𝜋 0 𝜋 2𝜋 3𝜋 x

 The Fourier series converges to:

0 𝜋 2𝜋 3𝜋
 Let’s calculate it:
𝑙=𝜋
1 𝑙 1 𝜋
𝑎0 = න 𝑓(𝑥) 𝑑𝑥 = න 4𝑑𝑥 = 2
2𝑙 −𝑙 2𝜋 0
1 𝑙 1 𝜋
𝑎𝑛 = ‫׬‬−𝑙 𝑓 𝑥 𝑐𝑜𝑠𝑛𝑥𝑑𝑥 = ‫׬‬0 4𝑐𝑜𝑠𝑛𝑥𝑑𝑥
𝑙 𝜋
1 4
= [ 𝑠𝑖𝑛𝑥]𝜋0 = 0
𝜋 𝑛
1 𝑙 1 𝜋
𝑏𝑛 = ‫׬‬−𝑙 𝑓 𝑥 𝑠𝑖𝑛𝑥𝑑𝑥 = ‫׬‬0 4𝑠𝑖𝑛𝑥𝑑𝑥
𝑙 𝜋
1 −4 −4
= [ 𝑐𝑜𝑠𝑥]𝜋0 = (𝑐𝑜𝑠𝑛𝜋 − 1)
𝜋 𝑛 𝑛𝜋
4
= (1 − (−1)𝑛 )
𝑛𝜋
4 ∞ 1−(−1)𝑛
So: 𝑓 𝑥 =2 + σ𝑛=1 𝑠𝑖𝑛𝑛𝑥
𝜋 𝑛

You might also like