neumann bc example • summary of steps for solving the ...today • neumann bc example • summary...

33
Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann BCs using Fourier Series. • Nonhomogeneous BCs • Eigenvalue / eigenvector interpretation • End-of-term info: • Don’t forget to complete the online teaching evaluation survey. • Review and office hours during exams TBA - by online poll

Upload: others

Post on 02-Jan-2020

17 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

Today

• Neumann BC example

• Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann BCs using Fourier Series.

• Nonhomogeneous BCs

• Eigenvalue / eigenvector interpretation

• End-of-term info:

• Don’t forget to complete the online teaching evaluation survey.

• Review and office hours during exams TBA - by online poll

Page 2: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

The Diffusion equation

dc

dt= D

d2c

dx2Solve the equation

subject to boundary conditions

and initial condition defined on [0,2].c(x, 0) = x

∂c

∂x(0, t) = 0,

∂c

∂x(2, t) = 0

What is the steady state in this case? css(x) = Ax+B

c(x, t) =a0

2+∞�

n=1

ane−n2π2

4 Dt cos�nπx

2

BC says A=0. B=?Total initial mass =

� L

0c(x, 0) dx

Total “final” mass =� L

0css(x) dx

css(x)=a0/2

No flux BCs so these must be equal.}

In this case, the Fourier series also tells us the answer:

Page 3: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

The Diffusion equation

dc

dt= D

d2c

dx2Solve the equation

subject to boundary conditions

and initial condition defined on [0,2].c(x, 0) = x

∂c

∂x(0, t) = 0,

∂c

∂x(2, t) = 0

Page 4: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

The Diffusion equation

dc

dt= D

d2c

dx2Solve the equation

subject to boundary conditions

and initial condition defined on [0,2].c(x, 0) = x

∂c

∂x(0, t) = 0,

∂c

∂x(2, t) = 0

c(x, t) =a0

2+∞�

n=1

ane−n2π2

4 Dt cos�nπx

2

Page 5: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

The Diffusion equation

dc

dt= D

d2c

dx2Solve the equation

subject to boundary conditions

and initial condition defined on [0,2].c(x, 0) = x

∂c

∂x(0, t) = 0,

∂c

∂x(2, t) = 0

c(x, t) =a0

2+∞�

n=1

ane−n2π2

4 Dt cos�nπx

2

c(x, 0) =a0

2+∞�

n=1

an cos�nπ

Lx�

= x

Page 6: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

The Diffusion equation

dc

dt= D

d2c

dx2Solve the equation

subject to boundary conditions

and initial condition defined on [0,2].c(x, 0) = x

∂c

∂x(0, t) = 0,

∂c

∂x(2, t) = 0

c(x, t) =a0

2+∞�

n=1

ane−n2π2

4 Dt cos�nπx

2

c(x, 0) =a0

2+∞�

n=1

an cos�nπ

Lx�

= x

Page 7: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

The Diffusion equation

dc

dt= D

d2c

dx2Solve the equation

subject to boundary conditions

and initial condition defined on [0,2].c(x, 0) = x

∂c

∂x(0, t) = 0,

∂c

∂x(2, t) = 0

Page 8: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

Solving the Diffusion equation using FS - summary

• The Diffusion equation ties the time-exponent to the space-frequency:

d(x, t) = ae−w2Dt cos(wx)dc

dt= D

d2c

dx2

g(x, t) = constant

c(x, t) = be−w2Dt sin(wx)

Page 9: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

Solving the Diffusion equation using FS - summary

• The Diffusion equation ties the time-exponent to the space-frequency:

d(x, t) = ae−w2Dt cos(wx)dc

dt= D

d2c

dx2

g(x, t) = constant

• Boundary conditions whether you need a Fourier sine or cosine series and determines the frequency ω.

c(0, t) = 0, c(L, t) = 0 ⇒ cn(x, t) = bne−n2π2

L2 Dt sin�nπx

L

c(x, t) = be−w2Dt sin(wx)

⇒ dn(x, t) = ane−n2π2

L2 Dt cos�nπx

L

�∂c

∂x(0, t) = 0,

∂c

∂x(L, t) = 0

Page 10: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

Solving the Diffusion equation using FS - summary

• The Diffusion equation ties the time-exponent to the space-frequency:

d(x, t) = ae−w2Dt cos(wx)dc

dt= D

d2c

dx2

g(x, t) = constant

• Boundary conditions whether you need a Fourier sine or cosine series and determines the frequency ω.

c(0, t) = 0, c(L, t) = 0 ⇒ cn(x, t) = bne−n2π2

L2 Dt sin�nπx

L

c(x, t) = be−w2Dt sin(wx)

⇒ dn(x, t) = ane−n2π2

L2 Dt cos�nπx

L

�∂c

∂x(0, t) = 0,

∂c

∂x(L, t) = 0

• The initial condition determines the an or bn values via Fourier series.

c(x, 0) =∞�

n=1

bn sin�nπx

L

�= f(x) c(x, 0) =

a0

2+∞�

n=1

an cos�nπx

L

�= f(x)or

Page 11: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

Solving the Diffusion equation using FS - summary

• The Diffusion equation ties the time-exponent to the space-frequency:

d(x, t) = ae−w2Dt cos(wx)dc

dt= D

d2c

dx2

g(x, t) = constant

• Boundary conditions whether you need a Fourier sine or cosine series and determines the frequency ω.

c(0, t) = 0, c(L, t) = 0 ⇒ cn(x, t) = bne−n2π2

L2 Dt sin�nπx

L

c(x, t) = be−w2Dt sin(wx)

⇒ dn(x, t) = ane−n2π2

L2 Dt cos�nπx

L

�∂c

∂x(0, t) = 0,

∂c

∂x(L, t) = 0

• The initial condition determines the an or bn values via Fourier series.

c(x, 0) =∞�

n=1

bn sin�nπx

L

�= f(x) c(x, 0) =

a0

2+∞�

n=1

an cos�nπx

L

�= f(x)or

Solution:

c(x, t) =a0

2+∞�

n=1

ane−n2π2

L2 Dt cos�nπx

L

Page 12: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

Using Fourier Series to solve the Diffusion Equation

ut = 4uxx

du

dx

����x=0,2

= 0

u(x, 0) = sin3πx

2

Write down the solution to this IVP.

Page 13: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

Using Fourier Series to solve the Diffusion Equation

ut = 4uxx

du

dx

����x=0,2

= 0

u(x, 0) = sin3πx

2

u(x, t) =a0

2+∞�

n=1

ane−n2π2t cosnπx

2

u(x, t) =∞�

n=1

bne−n2π2t sinnπx

2

(A)

(B) u(x, t) = e−9π2t sin3πx

2

(C)

(D)

u(x, t) = e−9π2t cos3πx

2

an =� 2

0sin

3πx

2cos

nπx

2dx

bn =� 2

0sin

3πx

2sin

nπx

2dx

Write down the solution to this IVP.

Page 14: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

Using Fourier Series to solve the Diffusion Equation

ut = 4uxx

du

dx

����x=0,2

= 0

u(x, 0) = sin3πx

2

u(x, t) =a0

2+∞�

n=1

ane−n2π2t cosnπx

2

u(x, t) =∞�

n=1

bne−n2π2t sinnπx

2

(A)

(B) u(x, t) = e−9π2t sin3πx

2

(C)

(D)

u(x, t) = e−9π2t cos3πx

2

an =� 2

0sin

3πx

2cos

nπx

2dx

bn =� 2

0sin

3πx

2sin

nπx

2dx

Write down the solution to this IVP.

Page 15: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

Using Fourier Series to solve the Diffusion Equation

ut = 4uxx

du

dx

����x=0,2

= 0

u(x, 0) = sin3πx

2

u(x, t) =a0

2+∞�

n=1

ane−n2π2t cosnπx

2

u(x, t) =∞�

n=1

bne−n2π2t sinnπx

2

(A)

(B) u(x, t) = e−9π2t sin3πx

2

(C)

(D)

u(x, t) = e−9π2t cos3πx

2

an =� 2

0sin

3πx

2cos

nπx

2dx

bn =� 2

0sin

3πx

2sin

nπx

2dx

doesn’t satisfy IC.

Write down the solution to this IVP.

Page 16: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

Using Fourier Series to solve the Diffusion Equation

ut = 4uxx

du

dx

����x=0,2

= 0

u(x, 0) = sin3πx

2

u(x, t) =a0

2+∞�

n=1

ane−n2π2t cosnπx

2

u(x, t) =∞�

n=1

bne−n2π2t sinnπx

2

(A)

(B) u(x, t) = e−9π2t sin3πx

2

(C)

(D)

u(x, t) = e−9π2t cos3πx

2

an =� 2

0sin

3πx

2cos

nπx

2dx

bn =� 2

0sin

3πx

2sin

nπx

2dx

doesn’t satisfy IC.

don’t satisfy BCs.

Write down the solution to this IVP.

Page 17: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

...with nonhomogeneous boundary conditions

ut = Duxx

u(0, t) = 0u(2, t) = 4

u(x, 0) = x2

Page 18: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

...with nonhomogeneous boundary conditions

ut = Duxx

Nonhomogeneous BCsu(0, t) = 0u(2, t) = 4

u(x, 0) = x2

Page 19: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

...with nonhomogeneous boundary conditions

ut = Duxx

Nonhomogeneous BCsu(0, t) = 0u(2, t) = 4

Still use sin(nπx/L) but need to get end(s) away from zero!

What is steady state?

u(x, 0) = x2

Page 20: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

...with nonhomogeneous boundary conditions

ut = Duxx

Nonhomogeneous BCsu(0, t) = 0u(2, t) = 4

Still use sin(nπx/L) but need to get end(s) away from zero!

What is steady state?

u(x, 0) = x2

uss(x) = 2x

Page 21: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

...with nonhomogeneous boundary conditions

ut = Duxx

Nonhomogeneous BCsu(0, t) = 0u(2, t) = 4

u(x, t) = 2x +∞�

n=1

bne−n2π2Dt/L2sin

nπx

LUltimately, we want

Still use sin(nπx/L) but need to get end(s) away from zero!

What is steady state?

u(x, 0) = x2

uss(x) = 2x

Page 22: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

...with nonhomogeneous boundary conditions

ut = Duxx

Nonhomogeneous BCsu(0, t) = 0u(2, t) = 4

u(x, t) = 2x +∞�

n=1

bne−n2π2Dt/L2sin

nπx

LUltimately, we want

∞�

n=1

bn sinnπx

LWhat function do we use to calculate the Fourier series ?

(A) x2 (B) x2 - 2 (C) x2 - 2x (D) x2 + 2x

Still use sin(nπx/L) but need to get end(s) away from zero!

What is steady state?

u(x, 0) = x2

uss(x) = 2x

Page 23: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

...with nonhomogeneous boundary conditions

ut = Duxx

Nonhomogeneous BCsu(0, t) = 0u(2, t) = 4

u(x, t) = 2x +∞�

n=1

bne−n2π2Dt/L2sin

nπx

LUltimately, we want

∞�

n=1

bn sinnπx

LWhat function do we use to calculate the Fourier series ?

(A) x2 (B) x2 - 2 (C) x2 - 2x (D) x2 + 2x

Still use sin(nπx/L) but need to get end(s) away from zero!

What is steady state?

u(x, 0) = x2

uss(x) = 2x

Page 24: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

...with nonhomogeneous boundary conditions

• Solve the Diffusion Equation with nonhomogeneous BCs:

ut = Duxx

u(0, t) = a

u(L, t) = b

u(x, 0) = f(x)

Page 25: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

...with nonhomogeneous boundary conditions

• Solve the Diffusion Equation with nonhomogeneous BCs:

ut = Duxx

u(0, t) = a

u(L, t) = b

u(x, 0) = f(x)

Page 26: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

...with nonhomogeneous boundary conditions

• Solve the Diffusion Equation with nonhomogeneous BCs:

ut = Duxx

u(0, t) = a

u(L, t) = b

u(x, 0) = f(x)

Page 27: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

...with nonhomogeneous boundary conditions

• Solve the Diffusion Equation with nonhomogeneous BCs:

ut = Duxx

u(0, t) = a

u(L, t) = b

u(x, 0) = f(x)

• Recall - rate of change is proportional to concavity so bumps get ironed out.

Page 28: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

...with nonhomogeneous boundary conditions

• Solve the Diffusion Equation with nonhomogeneous BCs:

ut = Duxx

u(0, t) = a

u(L, t) = b

u(x, 0) = f(x)

• Recall - rate of change is proportional to concavity so bumps get ironed out.

Page 29: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

...with nonhomogeneous boundary conditions

• Solve the Diffusion Equation with nonhomogeneous BCs:

ut = Duxx

u(0, t) = a

u(L, t) = b

u(x, 0) = f(x)

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

a +b− a

Lx

• Recall - rate of change is proportional to concavity so bumps get ironed out.

Page 30: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

...with nonhomogeneous boundary conditions

• Solve the Diffusion Equation with nonhomogeneous BCs:

ut = Duxx

u(0, t) = a

u(L, t) = b

u(x, 0) = f(x)

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

a +b− a

Lx

vt = ut

vxx = uxx

�⇒ vt = Dvxx

v(0, t) = u(0, t)− a = 0

v(L, t) = u(L, t)− b = 0

v(x, 0) = u(x, 0)−�

a +b− a

Lx

• Recall - rate of change is proportional to concavity so bumps get ironed out.

Page 31: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

...with nonhomogeneous boundary conditions

• Solve the Diffusion Equation with nonhomogeneous BCs:

ut = Duxx

u(0, t) = a

u(L, t) = b

u(x, 0) = f(x)

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

a +b− a

Lx

vt = ut

vxx = uxx

�⇒ vt = Dvxx

v(0, t) = u(0, t)− a = 0

v(L, t) = u(L, t)− b = 0

v(x, 0) = u(x, 0)−�

a +b− a

Lx

• v(x,t) satisfies the Diffusion Eq with homogeneous Dirichlet BCs and a new IC.

• Recall - rate of change is proportional to concavity so bumps get ironed out.

Page 32: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

...with nonhomogeneous boundary conditions

• Solve the Diffusion Equation with nonhomogeneous BCs:

ut = Duxx

u(0, t) = a

u(L, t) = b

u(x, 0) = f(x)

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

a +b− a

Lx

vt = ut

vxx = uxx

�⇒ vt = Dvxx

v(0, t) = u(0, t)− a = 0

v(L, t) = u(L, t)− b = 0

v(x, 0) = u(x, 0)−�

a +b− a

Lx

• v(x,t) satisfies the Diffusion Eq with homogeneous Dirichlet BCs and a new IC.

• General trick: define v=u-SS and find v as before.

• Recall - rate of change is proportional to concavity so bumps get ironed out.

Page 33: Neumann BC example • Summary of steps for solving the ...Today • Neumann BC example • Summary of steps for solving the Diffusion Equation with homogeneous Dirichlet or Neumann

...with nonhomogeneous boundary conditions

• Solve the Diffusion Equation with nonhomogeneous BCs:

ut = Duxx

u(0, t) = a

u(L, t) = b

u(x, 0) = f(x)

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

a +b− a

Lx

vt = ut

vxx = uxx

�⇒ vt = Dvxx

v(0, t) = u(0, t)− a = 0

v(L, t) = u(L, t)− b = 0

v(x, 0) = u(x, 0)−�

a +b− a

Lx

• v(x,t) satisfies the Diffusion Eq with homogeneous Dirichlet BCs and a new IC.

• General trick: define v=u-SS and find v as before.

• Recall - rate of change is proportional to concavity so bumps get ironed out.

https://www.desmos.com/calculator/6jp7jggsf9