15
Boundary-value problems Phys 750 Lecture 8

Boundary-value problemskbeach/courses/fall2017/phys... · Boundary-value problems ‣ Boundary-value ODEs also arise if we solve for the normal modes of time-dependent partial-differential

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Boundary-value problemskbeach/courses/fall2017/phys... · Boundary-value problems ‣ Boundary-value ODEs also arise if we solve for the normal modes of time-dependent partial-differential

Boundary-value problems

Phys 750 Lecture 8

Page 2: Boundary-value problemskbeach/courses/fall2017/phys... · Boundary-value problems ‣ Boundary-value ODEs also arise if we solve for the normal modes of time-dependent partial-differential

Boundary-value problems‣ Important class of problems in physics:

differential equations with solutions having specified conditions at the boundaries

‣ For example,

‣ Electrostatic potentials

‣ Normal modes in wave problems

‣ Heat flow

u��(x) = F (u(x), u�(x);x)

⇥x � �R :

⇥x � R :

u(x) = �(x) oru�(x) = ⇥(x)

DirichletNeumann

Page 3: Boundary-value problemskbeach/courses/fall2017/phys... · Boundary-value problems ‣ Boundary-value ODEs also arise if we solve for the normal modes of time-dependent partial-differential

Boundary-value problems‣ Electric potential produced by a distribution of static

charges is described by the Poisson equation:

‣ Or, in free space, by the Laplace equation:

‣ Must be augmented by specific values of the potential and electric field ( and ) at the boundaries

�2� =�

⇤2

⇤x+

⇤2

⇤y+

⇤2

⇤z

⇥�(x, y, z) = 0

⇤E = �⇤⇥��

�2⇥ =�

⌅2

⌅x+

⌅2

⌅y+

⌅2

⌅z

⇥⇥(x, y, z) = �(x, y, z)

Page 4: Boundary-value problemskbeach/courses/fall2017/phys... · Boundary-value problems ‣ Boundary-value ODEs also arise if we solve for the normal modes of time-dependent partial-differential

Boundary-value problems‣ Boundary-value ODEs also arise if we solve for the

normal modes of time-dependent partial-differential equations (PDEs)

‣ Connected by a Fourier transform in the time coordinate:

u(x, t) =�

d� u�(x)ei�t

u���(x) = F (u�(x), u�

�(x);x)� i�u�

⇥u

⇥t= uxx(x, t)� F (u(x, t), ux(x, t);x)

Page 5: Boundary-value problemskbeach/courses/fall2017/phys... · Boundary-value problems ‣ Boundary-value ODEs also arise if we solve for the normal modes of time-dependent partial-differential

Boundary-value problems‣ Familiar analytical approach is to expand the solution

using special functions: (sinusoidal or Bessel functions, cylindrical or spherical harmonics)

‣ The goal of such spectral methods is to decompose the solution in a complete set of functions that automatically satisfy the given boundary conditions

‣ Only convenient in situations with high symmetry (e.g., sphere, cylinder, or box)

Page 6: Boundary-value problemskbeach/courses/fall2017/phys... · Boundary-value problems ‣ Boundary-value ODEs also arise if we solve for the normal modes of time-dependent partial-differential

Discretization

‣ For regions with no special symmetry, we have to resort to finite-difference methods

interior points (variable)

boundary points (fixed)

Page 7: Boundary-value problemskbeach/courses/fall2017/phys... · Boundary-value problems ‣ Boundary-value ODEs also arise if we solve for the normal modes of time-dependent partial-differential

Discretization‣ Generalize spatial derivatives to multiple dimensions

uxx + uyy ⇥1

(�x)2�u(xi�1, yj) + u(xi+1, yj)

+ u(xi, yj�1) + u(xi, yj+1)� 4u(xi)⇥

uxx ⇥1

(�x)2�u(xi�1)� 2u(xi) + u(xi+1)

1 -2 11-21

11 -4 11

+ = (�x = �y)

⇤2u ⇥ 1(�x)2

�⇤

⇥�

u(⌃r + ⌃�)�Nnnu(⌃r)⇥

(orthogonal mesh)

Nearest neighbour count

Page 8: Boundary-value problemskbeach/courses/fall2017/phys... · Boundary-value problems ‣ Boundary-value ODEs also arise if we solve for the normal modes of time-dependent partial-differential

Discretization‣ Discretized ODEs are linear; equivalent to a linear system

of equations

‣ Unified index:

‣ Solution possible via matrix inversion

‣ Method scales badly: vector size , matrix storage , matrix inversion complexity

�(i, j, k) = i + Lj + L2k

M�,⇥U⇥ = A⇥

U� = u(xi, yj , zk) � ui,j,k

U = M�1A

� 1/(�x)3 � L3

� L9� L6

(L�L�L box)

Page 9: Boundary-value problemskbeach/courses/fall2017/phys... · Boundary-value problems ‣ Boundary-value ODEs also arise if we solve for the normal modes of time-dependent partial-differential

Relaxation methods

�x

ui = u(xi) = u(a + i(b� a)/L)

u0 = u(a)

u1 = u0 + u�(a)�x

uL = u(b)

uL�1 = uL � u⇥(b)�x

u(a), u�(a)

u(b), u�(b)

Given Discrete mesh of points:

Converge via iteration?:

Fix two ofuxx = �(x)

ui =12�ui+1 + ui�1 + (�x)2�i

Page 10: Boundary-value problemskbeach/courses/fall2017/phys... · Boundary-value problems ‣ Boundary-value ODEs also arise if we solve for the normal modes of time-dependent partial-differential

Relaxation methods‣ Jacobi method algorithm:

• Set the fixed ui along the boundaries

• Loop though all interior points xi

– Set unewi = 1

2 (uoldi+1 + uold

i�1 + (�x)2⇥i)– Keep track of largest �u = |unew

i � uoldi |

• Repeat until �u < �

Page 11: Boundary-value problemskbeach/courses/fall2017/phys... · Boundary-value problems ‣ Boundary-value ODEs also arise if we solve for the normal modes of time-dependent partial-differential

Relaxation methods

...

‣ Various update orderings (with different convergence properties!) are possible

Jacobi

Gauss-Seidel

Checker-board

Page 12: Boundary-value problemskbeach/courses/fall2017/phys... · Boundary-value problems ‣ Boundary-value ODEs also arise if we solve for the normal modes of time-dependent partial-differential

Relaxation methods‣ Slow convergence since it takes many steps for changes to

propagate across the grid

‣ Better resolution ( ) means that the length scale for propagation increases ( )

‣ Might try to reweight so that new values incorporate more of the changes from neighbouring points:

0 < � < 11 < � < 2

� = 1

�x� 0L = 1/�x�⇥

unew = �u + (1� �)u

u(⌃r) =1

Nnn

u(⌃r + ⌃⇥)

Jacobi Underrelaxation Overrelaxation

Page 13: Boundary-value problemskbeach/courses/fall2017/phys... · Boundary-value problems ‣ Boundary-value ODEs also arise if we solve for the normal modes of time-dependent partial-differential

Relaxation methods‣ Overrelaxation can be connected to the corresponding

time-dependent diffusion problem

‣ Recover the original problem when

‣ Introduce a fictitious time step; over-relaxation parameter connected to the choice of

limt�⇥

ut = 0

u(n+1)i,j = u(n)

i,j + (�t)�

u(n)i+1,j + u(n)

i,j+1 � 4u(n)i,j + u(n)

i�1,j + u(n)i,j1

(�x)2� �i,j

�t/(�x)2

ut = uxx + uyy � F (ux, uy, u)

Page 14: Boundary-value problemskbeach/courses/fall2017/phys... · Boundary-value problems ‣ Boundary-value ODEs also arise if we solve for the normal modes of time-dependent partial-differential

Shooting method‣ A shooting strategy involves converting the boundary-

value problem to a related initial value problem

‣ Forward integrate assuming a derivative

‣ Yields a 1-parameter family of solutions

‣ Unique solution to the boundary-value problem corresponds to the root of

u�� = F (u, u�, x)u(a), u(b)

u(x; g)

G(g) = u(b)� u(b; g)

u(a)u�� = F (u, u�, x)

u(b)

g = u�(a)

Page 15: Boundary-value problemskbeach/courses/fall2017/phys... · Boundary-value problems ‣ Boundary-value ODEs also arise if we solve for the normal modes of time-dependent partial-differential

Shooting method

G(g) = 0

G(g) < 0

G(g) > 0u0 = u(a)u1 = u0 + g�x

‣ Apply root finding algorithms to G