time discretization ( it’s about time…)

48
Time Discretization (It’s about time…) Sauro Succi

Upload: josh

Post on 06-Jan-2016

57 views

Category:

Documents


3 download

DESCRIPTION

Time Discretization ( It’s about time…). Sauro Succi. Time Evolution. Initial and Boundary Conditions. Time Marching: Formal. Time Marching: Matrix Exponential. L banded b, L*L banded 2b+1, L*L*L banded 3b+2 …. UNPRACTICAL. Numerical Marching. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Time  Discretization ( It’s about  time…)

Time Discretization(It’s about time…)

Sauro Succi

Page 2: Time  Discretization ( It’s about  time…)

Time Evolution

Initial and Boundary Conditions

Page 3: Time  Discretization ( It’s about  time…)

Time Marching: Formal

Page 4: Time  Discretization ( It’s about  time…)

Time Marching: Matrix Exponential

L banded b, L*L banded 2b+1, L*L*L banded 3b+2 …. UNPRACTICAL

Page 5: Time  Discretization ( It’s about  time…)

Numerical Marching

On the lattice x_j=j*d:

Page 6: Time  Discretization ( It’s about  time…)

Numerical Marching

On the lattice x_j=j*d:

Page 7: Time  Discretization ( It’s about  time…)

Space-Time Connectivity

Page 8: Time  Discretization ( It’s about  time…)

Numerical Marching

Explicit

Crank-Nicolson

Fully Implicit

Page 9: Time  Discretization ( It’s about  time…)

Numerical Marching

Explicit

Crank-Nicolson

Page 10: Time  Discretization ( It’s about  time…)

Stability

Page 11: Time  Discretization ( It’s about  time…)

Unconditionally stable --> large dt

Non-local, matrix algebra, expensive

Time marching: Explicit/Implicit methods

Conditionally stable (|1+Ldt|<1)---> small dt

Matrix-free (local in spacetime)Simple and fast

X ----------X----------X

X ----------X----------X

X ----------X----------X X ----------X----------X

X ----------X----------X

Euler fwd

- t -

- t+dt -

- t+2dt -

Cranck-Nicolson

Page 12: Time  Discretization ( It’s about  time…)

Forward Euler

Stability (for stable phys)

Page 13: Time  Discretization ( It’s about  time…)

Crank-Nicolson

Trapezoidal rule

Page 14: Time  Discretization ( It’s about  time…)

Implicit=Non-local

3 spatial connections

5 spatial connections

2p+1 spatial connections

Page 15: Time  Discretization ( It’s about  time…)
Page 16: Time  Discretization ( It’s about  time…)

Implicit Diffusion

Page 17: Time  Discretization ( It’s about  time…)

Matrix problem

Page 18: Time  Discretization ( It’s about  time…)

Implicit Time-Marching

Page 19: Time  Discretization ( It’s about  time…)
Page 20: Time  Discretization ( It’s about  time…)

Matrix Algebra

Direct Methods

Iterative Methods

Algebraic Methods

Page 21: Time  Discretization ( It’s about  time…)

Matrix Inversion

Page 22: Time  Discretization ( It’s about  time…)

Direct Methods

1. Forward sweep: y

2. Backward sweep: x

Page 23: Time  Discretization ( It’s about  time…)

Gaussian elimination

Zeroes included!

Page 24: Time  Discretization ( It’s about  time…)

Multiple Dimensions

Page 25: Time  Discretization ( It’s about  time…)

Memory is 1d: Addressing

Sequential index:

Page 26: Time  Discretization ( It’s about  time…)

Physical vs Logical indexing

Page 27: Time  Discretization ( It’s about  time…)

Bandwidth minimization (d>1)

Page 28: Time  Discretization ( It’s about  time…)

Splitting

Relaxation

Gradient

Conjugate Gradient

Iterative: Methods

No matrix inversion: only matrix*vector products

Page 29: Time  Discretization ( It’s about  time…)

Iterative: Jacobi splitting

Stopping criteria:

Page 30: Time  Discretization ( It’s about  time…)

Gauss-Seidel: aggressive Jacobi

Convergence criteria:

Page 31: Time  Discretization ( It’s about  time…)

Jacobi: does it converge?

Diagonal dominant:

Good matrix condition:

Page 32: Time  Discretization ( It’s about  time…)

Optimum condition=1 Bad condition >>1

Page 33: Time  Discretization ( It’s about  time…)

Alternating Direction Implicit

Page 34: Time  Discretization ( It’s about  time…)

Directional Splitting

A sequence of Ny one-dimensionalProblems of size NX:

Page 35: Time  Discretization ( It’s about  time…)

Over/Under relaxation methods

Accelerated Relaxation

Conservative, oscillating convergence

Aggressive, montonic convergence

Page 36: Time  Discretization ( It’s about  time…)

Gradient methods

Page 37: Time  Discretization ( It’s about  time…)

Relaxation methods

Fictitious time

Iteration loop

Convergence criterion:

Usually very slow!

Page 38: Time  Discretization ( It’s about  time…)

Steepest descent: gradient

Residual=Gradient of the energy

r is the gradient ofE=1/2<x,Ax>-<b,x>

Page 39: Time  Discretization ( It’s about  time…)

Steepest descent: “timestep”

Page 40: Time  Discretization ( It’s about  time…)

Steepest Descent

Convergent guaranteed only for SPD matrices [(x,Ax)>0]

Long-term slow because r-->0 as Ax-->b

Round-off sensitive, needle-sensitive

Page 41: Time  Discretization ( It’s about  time…)

Conjugate Gradient

The steepest descent is not the shortest path to the minimum

g=r= Ax-b; <g,t>=0

c defined by <c,At> = 0

One shot on the local minimum at each plane x_k,x_(k+1)

tgc

x_k

x_(k+1)

x

Page 42: Time  Discretization ( It’s about  time…)

Conjugate Gradient

The steepest descent is not the shortest path to the minimum!

0. x0, p0=r0=A*x0-b The new search direction is between r and old p1. a0=<r0,p0>/<r0,A*p0>

2. x1=x0+a0*p0; r1=r0-a0*A*p0 Out? 3. b0=<r1*r1>/<r0*r0> p1 = r1+b0*p0 next search direction based upon <p1,A*p0>=0 4. Go to 1 with p1

t

gc

x

{p0,A*p0,A^2*p0 … A^N p0} is a Krylov sequence: N step convergent for SPD

Page 43: Time  Discretization ( It’s about  time…)

End of Lecture

Page 44: Time  Discretization ( It’s about  time…)

Time Marching: Spectral

Hermitian Stable/Unstable

Example: diffusion

Page 45: Time  Discretization ( It’s about  time…)
Page 46: Time  Discretization ( It’s about  time…)

Operator Splitting (useful in d>1)

Page 47: Time  Discretization ( It’s about  time…)

Non-commuting propagators

Page 48: Time  Discretization ( It’s about  time…)

Trotter splitting