2 Homogeneous Heat PDE in 1D

 2.1 Boundary conditions both Dirichlet and Homogeneous
  2.1.1 Example 1
  2.1.2 Example 2
  2.1.3 Example 3
 2.2 Boundary conditions both Dirichlet, one homogeneous other end nonHomogeneous
 2.3 Boundary conditions both Neumann and homogeneous
 2.4 Boundary conditions one end Neumann, the other nonHomogeneous Dirichlet
 2.5 Boundary conditions at both ends homogeneous Neumann (insulated)
 2.6 Boundary conditions at one end non-homogeneous Neumannm other end homogeneous Dirichlet

2.1 Boundary conditions both Dirichlet and Homogeneous

  2.1.1 Example 1
  2.1.2 Example 2
  2.1.3 Example 3

2.1.1 Example 1

Solve

1-∂u-  ∂2u-
k ∂t = ∂x2    0 < x < L,t > 0

Boundary conditions

pict

Initial conditions

         {
u (x,0) =     x      0 < x < L2
           L − x    L2 < x < L

Solution.      (nπ)2
λn =  L-

            ∞∑   (      (   ))             ( ∘ ---)
u(x,t) = 4L      -1 sin  nπ-  exp (− kλnt)sin    λnx
        π2 n=odd n2      2

  

2.1.2 Example 2

A bar length L = 10  cm with insulated sides is initially at 100  degrees. starting at t = 0  , the ends are held at zero degree. Find the temperature distribution in the bar at time t

1-∂u-   ∂2u-
α2 ∂t = ∂x2    0 < x < L,t > 0

Boundary conditions

pict

Initial conditions

u(x,0) = T0 = 1000

Solution

Let

u = X (x)T (t)

Substituting this into the PDE gives

1  ′      ′′
α2T X = X  T

Dividing by XT

    ′    ′′
1-T- = X--
α2 T    X

Therefore

-1-T′   X′′
α2 T =  X  = − λ

Where λ  is some constant. Hence we obtain two ODE’s to solve. They are

pict

And

T′ + λα2T = 0

case λ = 0

pict

From first boundary conditions, X (0) = 0  , the above becomes

0 = B

Hence X  = Ax  . From second boundary conditions 0 = AL  , or A = 0  , therefore trivial solution and λ = 0  is not an eigenvalue.

case λ > 0

  ′′
X  + λX  = 0

The solution is

         (  --)       ( -- )
X = A cos √ λx + B sin  √λx

From first B.C.  0 = A  and the solution becomes          (    )
X = B sin  √λx . From second B.C.

        (    )
0 = B sin √λL

For non-trivial solution, we want    (√ --)
sin    λL  = 0  or

pict

Therefore

             ( nπ )
Xn (x) = bn sin --x
               L

Now we solve the time ODE  T ′ +λn α2T = 0  . This has solution

Tn = ane−λnα2t

Therefore the solution becomes

pict

To find Bn  , we use orthoginality. At t = 0  , we are given u (x,0)  . Hence at t = 0  the solution becomes

         ∞∑       (    )
u (x,0) =    Bn sin  nπx
         n=1       L

Multiplying both sides by    (mπ- )
sin  L x and integrating

pict

Therefore

pict

Therefore, the solution is

pict

Here is an animation.

  

2.1.3 Example 3

Problem

Solve ut = uxx  with boundary conditions u (− 1,t) = 0,u (1,t) = 0  and initial conditions u (x,0) = f (x).

Solution

Let u = X (x)T (t)  . By separation of variables we obtain the following two ODEs. The spatial ODE is

pict

And the time ODE

 ′
T (t)+ λT = 0
(2)

We can quickly see that λ > 0  is only possible case. Hence solution to (1) is

           (√ --)       (√ --)
X (x) = Acos   λx  + B sin   λx
(2A)

Applying boundary conditions X (− 1) = 0  gives

pict

Applying boundary conditions X (1) = 0  gives

0 = A cos√λ-+ B sin√ λ
(4)

(4),(3) give the system

(cos√ λ- − sin√ λ)(A )  (0 )
 cos√ λ- sin√ λ-   B  =   0
(5)

For non-trivial solution we want

pict

But    √ --  (√--)  1   (  √-)
cos  λsin   λ  = 2 sin  2 λ , hence 1   ( √ -)
2 sin 2  λ  = 0  or  √--
2 λ = nπ  for n = 1,2,⋅⋅⋅ . Therefore

∘---  n π
 λn = -2-    n = 1,2,⋅⋅⋅

Each eigenvalue has associated eigenvector. For n = 1  , (5) becomes

pict

First equation gives − B1 = 0  . Hence B1 = 0  and A1  can be anything. Hence first eigenfunction from (2A) is

             (   )
X1(x) = A1cos π-x
               2

For n = 2  (5) becomes

pict

First equation gives − A = 0
   2  . Hence A  = 0
  2  and B
 2  can be anything. Hence second eigenfunction from (2A) is

X  (x) = B sin (πx )
  2       2

We continue this way and find that for n = 1,3,5,⋅⋅⋅ the eigenfunctions are

              (    )
Xn (x) = An cos nπ-x
                2

And for n = 2,4,6,⋅⋅⋅ the eigenfunctions are

              (    )
Xn (x) = Bn sin nπx
                2

Therefore the spatial solution is

pict

The solution to the time domain ODE is T (t) = e− λnt  , therefore the complete solution is

pict

To find An  , we apply orthogonality. At t = 0  . For n = 1,3,⋅⋅⋅ case

pict

To find Bn  , we apply orthogonality. At t = 0  . For n = 2,4,⋅⋅⋅ case

pict

Hence the solution is

pict

To verify

Example 1 here is solution for f (x) = 1− x2  which satisfies boundary conditions. Using this we find

pict

And

pict

Hence analytical solution (6) is

pict

The source code for Manipulate

Animation of the above

  

Example 2 f (x) = (1− x2)x  which satisfies boundary conditions. Using this we find

pict

And

pict

Hence analytical solution (6) is

pict

The source code for Manipulate

Animation of the above

  

Example 3

            2
f (x) = (1 − x )(x + 1)  which satisfies boundary conditions. Using this we find

pict

And

pict

Hence analytical solution (6) is

pict

The source code for Manipulate

Animation of the above

  

2.2 Boundary conditions both Dirichlet, one homogeneous other end nonHomogeneous

A bar length L

1 ∂u    ∂2u
-2---=  --2-   0 < x < L,t > 0
α  ∂t   ∂x

Boundary conditions

pict

Initial conditions

u (x,0) = x

Solution,      (nπ)2
λn =  L-

                       ∑∞                   (  ---)
u (x,t) = T0 − T0x − 4T0     1-exp (− α2λnt)sin ∘ λnx
             L      π n=evenn

  

2.3 Boundary conditions both Neumann and homogeneous

A bar length L

         2
1-∂u-=  ∂-u-   0 < x < L,t > 0
α2 ∂t   ∂x2

Boundary conditions, insulated

pict

Initial conditions

u (x,0) = x

Solution, λn = (nπ)2
      L

         L-  4L- ∞∑   1-    (  2   )   (∘ ---)
u (x,t) = 2 − π2      n2 exp − α λnt cos  λnx
                n=odd

  

2.4 Boundary conditions one end Neumann, the other nonHomogeneous Dirichlet

A bar length L = 2

         2
1-∂u-=  ∂-u-   0 < x < L,t > 0
α2 ∂t   ∂x2

Boundary conditions, left end only insulated

pict

Initial conditions

u(x,0) = 00

Solution, λn = (nπ)2,n = 1,3,5,⋅⋅⋅
      2L

             4T0  ∑∞    (− 1)n   (   2  )   (∘ --- )
u (x,t) = T0 − π         2n+ 1 exp − α λnt cos  λnx
                n=1,3,5,⋅⋅⋅

  

2.5 Boundary conditions at both ends homogeneous Neumann (insulated)

See my solution for exam 1, Math 322. UW, Fall 2016, problem 3.

Solve

        2
∂u-= α ∂-u− βu    0 < x < π,t > 0
∂t     ∂x2

with, a > 0,β > 0

pict

And initial conditions

u (x,0) = x

Solution

λ  = (nπ)2
 n    L

         π    (       )   2∑∞  (− 1n − 1)         (2   )
u (x,t) = 2 + c0 e−βt − 1 + π   ---n2----cos(nx)e− n α+β t
                           n=1

Solution is not unique, since there is unknown c0  . To find c0  , the solvability condition for   2
∇ u = 0  with Neumann B.C. is used, which says that total flux must be zero at steady state, which is the case here, since flux is zero as given (insulated). Since solvability condition is satisfied, then energy is conserved. Solution at t = ∞ from above is

         1
u(x,∞ ) = 2 π− c0

Since energy is conserved then comparing it to energy at initial conditions

∫ π             ∫ π
   ρcu(x,0)dx =    ρcu(x,∞ )dx
 0               0

But u(x,0) = x  , hence

pict

Hence the final solution is

              ∑∞    n              (    )
u(x,t) = π-+ 2   (− 1-−-1)cos(nx)e− n2α+ βt
        2   π n=1   n2

Using α = 2,β = 1  , here is animation for 3.5 seconds

  

2.6 Boundary conditions at one end non-homogeneous Neumannm other end homogeneous Dirichlet

This 1D heat PDE has one end with boundary condition that is time dependent.

pict

Now let

pict

Be some reference temperature distribution that only needs to satisfy the boundary conditions given. i.e. -∂r (0,t) = et,r(L,t) = 0
∂x  . Then the difference temperature distribution is

v (x,t) = u (x,t)− r(x,t)

Since u,r  satisfy the nonhomogeneous B.C’s, then v  satisfies the homogeneous B.C which is ∂∂vx (0,t) = 0,v(L,t) = 0  . With the initial conditions

pict

Since v(x,t)  has homogeneous B.C. it can be easily solved. The solution can be found by separation of variables to be

          ∑∞         (∘ ---) − kλ t
v(x,t) =        An cos   λnx  e  n
        n=1,3,5,⋅⋅⋅

Where eigenvalue      (nπ)2
λn =  2L  . An  is now found from initial conditions.

           ∞∑         ( nπ )
v (x,0) =        An cos  --x
        n=1,3,5,⋅⋅⋅       2L

Multiplying both sides by cos(m2Lπx),  integrating and changing the order of integration and summation on RHS gives

∫                           ∞       ∫
  L(− x + L)cos(m-πx) dx =  ∑    A    Lcos(m-πx) cos(nπ-x)dx
 0             2L        n=1,3,5,⋅⋅⋅ n  0     2L        2L

By orthogonality of cos  the above reduces to one term

pict

Hence the solution is

          ∑∞         (    )    ( )
v (x,t) =        Ancos  nπx  e−k nπ2L-2t
        n=1,3,5,⋅⋅⋅       2L

But u = v+ r  , therefore the final solution is

                     ∞
u(x,t) = et(x− L) +  ∑    A  cos( nπx) e−k(n2Lπ)2t
                  n=1,3,5,⋅⋅⋅ n     2L

Here is animation using Mathematica, for L = 1,k = 0.01  for 2 seconds.