lecture 8 solution to the inhomogeneous heat equation with ...€¦ · lecture 6 analytic solution...

14
BENG 221: Mathematical Methods in Bioengineering Lecture 8 Solution to the Inhomogeneous Heat Equation with Fourier Series Eigenmode Expansions References Haberman APDE, Ch. 2. Haberman APDE, Ch. 3.

Upload: others

Post on 03-Oct-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 8 Solution to the Inhomogeneous Heat Equation with ...€¦ · Lecture 6 Analytic solution of the diffusion/heat equation The partial differential equation that governs diffusion

BENG 221: Mathematical Methods in Bioengineering Lecture 8 Solution to the Inhomogeneous Heat Equation with Fourier Series Eigenmode Expansions References Haberman APDE, Ch. 2. Haberman APDE, Ch. 3.

Page 2: Lecture 8 Solution to the Inhomogeneous Heat Equation with ...€¦ · Lecture 6 Analytic solution of the diffusion/heat equation The partial differential equation that governs diffusion
Page 3: Lecture 8 Solution to the Inhomogeneous Heat Equation with ...€¦ · Lecture 6 Analytic solution of the diffusion/heat equation The partial differential equation that governs diffusion
Page 4: Lecture 8 Solution to the Inhomogeneous Heat Equation with ...€¦ · Lecture 6 Analytic solution of the diffusion/heat equation The partial differential equation that governs diffusion
Page 5: Lecture 8 Solution to the Inhomogeneous Heat Equation with ...€¦ · Lecture 6 Analytic solution of the diffusion/heat equation The partial differential equation that governs diffusion
Page 6: Lecture 8 Solution to the Inhomogeneous Heat Equation with ...€¦ · Lecture 6 Analytic solution of the diffusion/heat equation The partial differential equation that governs diffusion
Page 7: Lecture 8 Solution to the Inhomogeneous Heat Equation with ...€¦ · Lecture 6 Analytic solution of the diffusion/heat equation The partial differential equation that governs diffusion
Page 8: Lecture 8 Solution to the Inhomogeneous Heat Equation with ...€¦ · Lecture 6 Analytic solution of the diffusion/heat equation The partial differential equation that governs diffusion

BENG 221 M. Intaglietta Lecture 6 Analytic solution of the diffusion/heat equation

The partial differential equation that governs diffusion processes can be solved analytically. If the boundary conditions are simple we can compute this solution readily. The method requires the use of some fundamental mathematical properties. Linearity A linear operator L has the property:

1 1 2 2 1 1 2 2( ) ( )L c u c u c L u c L u+ = + ( )

2

2andt x∂ ∂∂ ∂

are linear operators, therefore the “diffusion operator” 2

2t x∂ ∂

−∂ ∂

is a linear operator.

A linear equation for u = u(x,t) has the form: L(u) = f(x,t)

2

2 ( )u uk ft x

∂ ∂− =

∂ ∂x is a linear operator on u(x,t) since:

2

1 1 2 2 1 1 2 22

( ) ( ) ( , )c u c u c u c uk ft x

∂ + ∂ +− =

∂ ∂x t =

2 21 2 1 2

1 2 1 22 2 ( , )u u u uc c k c c f xt t x x

⎛ ⎞∂ ∂ ∂ ∂+ − + =⎜ ⎟∂ ∂ ∂ ∂⎝ ⎠

t

If f(x,t) = 0 then L(u) = 0 is a linear homogeneous equation. A fundamental principle: If u1 and u2 satisfy a linear homogenous equation then any arbitrary linear combination c1u1 + c2u2 satisfies the same linear homogenous equation. The concept of linearity also applies to boundary conditions. The complete diffusion equation is:

1

Page 9: Lecture 8 Solution to the Inhomogeneous Heat Equation with ...€¦ · Lecture 6 Analytic solution of the diffusion/heat equation The partial differential equation that governs diffusion

2

2 ( , )C CD G xt x

∂ ∂= +

∂ ∂t

where G(x,t) is the material generated or consume within the control volume. The diffusion equation is linear and homogeneous if G(x,t) = 0. Solution of the diffusion equation with specified concentration at the ends of the region, and no sources. Separation of variables. We propose to solve the linear homogeneous diffusion equation:

2

2

( , ) ( , ) 0 . . (0, ) ( , ) 0 . . ( ,0) (u x t u x tk B C s u t u L t I C u xt x

∂ ∂− = = = =

∂ ∂)f x (11)

in terms of solutions of the form:

( , ) ( ) ( )u x t w x g t= (12) which reduces PDEs to ODEs. Accordingly, and to obtain terms that are present in the diffusion equation we take the partial derivatives of (12) and obtain:

( , ) ( )( )u x t dg tw xt d

∂=

∂ t and

2 2

2 2

( , ) ( ) ( )u x t d w x g tx dx

∂=

Leading to a new form of the diffusion equation which can now be written as an ordinary differential equation:

2

2

( ) ( )( ) ( ) 0dg t d w xw x kg tdt dx

− = which can be also written as: 2

2

1 ( ) 1 (( ) ( )

dg t d w xkg t dt w x dx

=)

where each side is the function of only one variable. One side of this equation, a function of t, is equal to function of x. This is only possible if both sides equal a constant, which for convenience is taken as λ− or:

2

2

1 ( ) 1 ( )( ) ( )

dg t d w xkg t dt w x dx

λ= = − (13)

which results into two ODEs, namely:

2

2

dg d wkg and wdt dx

λ λ= − = −

2

Page 10: Lecture 8 Solution to the Inhomogeneous Heat Equation with ...€¦ · Lecture 6 Analytic solution of the diffusion/heat equation The partial differential equation that governs diffusion

General solution of the time dependent equation:

( ) ktg t ce λ−= where c is an arbitrary constant. Note that if λ > 0 the solution decays in time, which we expect. Boundary value problems and solution of the x dependent equation Note that w(x) = 0 satisfies (11). However this is a trivial solution. Other non trivial solutions that also satisfy the B.C.s exist for specific values of λ . These are called eigenvalues, and a non trivial w(x) that exists only for the eigenvalues is called an eigenfunction.

The second order O.D.E. 2

2

d w wdx

λ= − solution is obtained by substituting and

obtaining the characteristic polynomial

( ) rxw x e=

2r λ= − which yields 3 different types of solutions: 1. λ > 0 roots are imaginary and complex conjugates, r i λ= ± . 2. λ = 0, r = 0,0. 3. λ < 0, roots a real, r λ= ± − . Solutions for λ > 0. For λ > 0 the exponential solutions have imaginary exponents, namely i xe λ± . Linear combinations of these exponents yield trigonometric function, namely: 1 1( ) cos ( ) sin2 2

i x i x i x i xe e x and e e xi

λ λ λ λλ λ− −+ = − =

Therefore 1 2( ) cos sinw x c x c xλ λ= + is a solution since it is a linear combination of solutions. The B.C. w(0) = 0 implies that 1 0c = and the cosine term vanishes. In order to satisfy the other boundary condition w(L) = 0 either 2 0c = in which case w(x) = 0 is a trivial

solution, or we search for values of λ that satisfy the relationship sin 0Lλ = , namely the zeros of the sine function which occur at L nλ π= . Therefore

2

1, 2,3,...n nLπλ ⎛ ⎞= =⎜ ⎟

⎝ ⎠

3

Page 11: Lecture 8 Solution to the Inhomogeneous Heat Equation with ...€¦ · Lecture 6 Analytic solution of the diffusion/heat equation The partial differential equation that governs diffusion

are the eigenvalues λ and the corresponding eigenfunctions are:

2 2( ) sin sin n xw x c x cLπλ ⎛ ⎞= = ⎜ ⎟

⎝ ⎠

Is 0λ = a non trivial solution? The equation being solved is:

2

2

( ) ( ) 0d w x w xdx

λ= − =

Which this leads to and in order to satisfy the boundary conditions w(x) = 0 at x = L then , a trivial solution, and the only one possible.

1 2( )w x c c x= +

1 2 0c c= = Solutions for λ < 0. When λ < 0 the roots of the characteristic are r λ= ± − which is a real number. To avoid confusion it is convenient to set sλ = − which results in two independent solutions

sxe and sxe− leading to the general solution:

1 2( ) sx sw x c e c e−= + x which can be expressed as hyperbolic functions, since these are linear combinations of exponentials functions, namely

( ) ( )1 1cosh sinh2 2

x x x xx e e x e e− −= + = −

leading to the solution:

3 4( ) cosh sinhw x c sx c sx= + Which has a solution that satisfies the boundary conditions only if 3 4 0c c= = or w(x) = 0

a trivial solution since sinh sL is never zero for a positive argument. Product solution of the P.D.E with specified boundary conditions The product solution of (11) therefore exists for λ > 0 and is of the form:

4

Page 12: Lecture 8 Solution to the Inhomogeneous Heat Equation with ...€¦ · Lecture 6 Analytic solution of the diffusion/heat equation The partial differential equation that governs diffusion

2

( , ) sin 1, 2,3,...nk tL

nn xu x t A e n

L

ππ ⎛ ⎞− ⎜ ⎟⎝ ⎠= =

Note that as there is a different solution for each n, and that as t increases all special solutions exponentially decay in time. Furthermore u(x,t) satisfies the special initial condition

( ,0) sinnn xu x A

=

and in general, given the principle of superposition:

2

1( , ) sin

nM k tL

nn

n xu x t A eL

ππ ⎛ ⎞− ⎜ ⎟⎝ ⎠

=

= ∑ (14)

It should be noted that (14) should satisfy the initial boundary condition u(x,0) = f(x) which requires finding a way to link An and f(x) for t = 0.

This can be done by noting that the eigenfunctions sin n xLπ satisfy the integral property:

0

sin sin 0( ); ( )2

L n x m x Ldx m n m nL Lπ π

= ≠ = =∫

In other words:

2

0

sin2

L n x LdxLπ

=∫

Note that this integral is associated with calculation of average power in periodic phenomena. In general the average power is calculated by taking the integral

2 /2 /2

00

1 1sin sin 22 4

tdt t tπ ωπ ω πω ω

ω⎡ ⎤= − =⎢ ⎥⎣ ⎦∫

Therefore in (14), for t = 0 when u(x,0) = f(x) we can set up the following relationship:

10 0

( )sin sin sinL L

nn

m x m x n xf x dx AL Lπ π∞

=

=∑∫ ∫ dxLπ

and whenever m = n

5

Page 13: Lecture 8 Solution to the Inhomogeneous Heat Equation with ...€¦ · Lecture 6 Analytic solution of the diffusion/heat equation The partial differential equation that governs diffusion

2

10 0

( )sin sinL L

mn

m x m xf x dx AL Lπ π∞

=

=∑∫ ∫ dx

and since

2

0

sin2

L m x LdxLπ

=∫

0

2 ( )sinL

mm xA f x dx

L Lπ

= ∫

A vector view of the computation of An

Consider the sample problem we just worked with the same boundary conditions. Consider now an ordinary vector, F, with components in three dimensional space with coordinates x, y, and z. The vector is defined by a basis set of the three perpendicular (or orthogonal) unit vectors, ex, ey and ez, pointing in the three dimensions. To describe the vector F, each unit vector has some magnitude, A, so that:

x y zA A A= + +x yF e e ze

x

If F is known we can find the Ai coefficients by taking the inner (or dot) product of the whole expression with each of the unit vectors in turn. As an example:

xA = ⋅ xF e 15 Now consider the expression:

1 2 3sin( ) sin(2 ) sin(3 ) ... ( )A x A x A x fπ π π+ + + = We can assume that each function sin(nπx) is a basis vector. We can define: 1

0

( )sin( 2 ) inner product of ( ) with n basis vector sin( )thf x n x dx f x n xπ π=∫

which satisfies the same conditions as our usual operation with three dimensional basis vectors, where we get zero for the inner product of any combination of basis functions, except when we take the inner product with itself. For example:

6

Page 14: Lecture 8 Solution to the Inhomogeneous Heat Equation with ...€¦ · Lecture 6 Analytic solution of the diffusion/heat equation The partial differential equation that governs diffusion

1

01

0

2 sin( )sin(2 ) 0

2 sin( )sin( ) 1

x x dx

x x dx

π π

π π

=

=

This expression is analogous to 0 and 1⋅ = ⋅x y x xe e e e = . Following this analogy to find the coefficients in front of each basis function we take the inner product of the whole expression with the first basis function (n = 1) as in equation 15: 1

1 2 30

[ sin( ) sin(2 ) sin(3 ) ... ( )]sin( )A x A x A x f x x dxπ π π+ + + =∫ π

Since the basis functions are orthogonal, the inner product is zero for any combination of unlike functions. Therefore the only non zero terms are: 1 1

11

0 0

[ sin( )sin( ) ( )sin( )2AA x x dx f x xπ π π= =∫ ∫ dx

an analogous expression to 15, and for any coefficient:

1

0

2 ( ) sin( )nA f x n x dxπ= ∫

The term on the right is the inner product of the first basis function with the known function f(x). Furthermore, just like x⋅F e gives the projection of F in the x direction, 1

0

( )sin( )f x n x dπ∫ x gives the projection of f(x) on sin(nπx).

7