20
Lecture 6: Grid discretization October 5, 2015 1 Goal We discuss the bais ideas behind the discretization of time-dependent PDE’s. 2 Evolution problem: continuum We consider teh first order evolution PDE: t φ = 1

Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

Lecture 6: Grid discretization

October 5, 2015

1 Goal

We discuss the bais ideas behind the discretization of time-dependent PDE’s.

2 Evolution problem: continuum

We consider teh first order evolution PDE:

∂tφ = Lφ

1

Page 2: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

where L, the Liouville operator, usually contains space derivatives.The Cauchy problem is formally solved by

φ(t) = Ttφ(0)

whereTt ≡ eLt

is the so-called time-propagator.

3 Finite differencing time-dependent PDE’s

We make reference to a uniform spacetime crystal

(xj , tn) = [jd, nh], j = 0, J, n = 0, N

The values of the crystal filed follow

φnj ∼ φ(xj , tn)

4 The guiding principles

4.1 Consistency

In the continuum limith→ 0, d→ 0

the discretized system should recover the continuum one.Consistency is not a given: consider for instance the space derivative ∂xφ =

φ(x+ pd)− phi(x− qd)/rd. This is consistent only if p+ q = r.

4.2 Accuracy

The accuracy dictates the rate at which the errir vanishes as the continuumlimit is approached

ε = dis(φnj , φ(x = xj , t = tn)) ∝ Cpqdphq

where ”dis” is the distance in some appropriate metric, and the exponents pand q control the rate of convergence in space and time. High order scheme cansave a lot of computations. For instance, with a first order scheme, doubling thegrid halves the errror, while with a second order scheme the error goes down bya factor 4. The iso-error condition:

C1/N1 = C2/N22

gives N2 =√

C2

C1

√N1

2

Page 3: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

On the assumption C2 ∼ C1, this means that the same error achieved on a10, 000 grid points by a firts order scheme can be achieved with only 100 gridpoints by a second order method.

Several caveats: first, usually he prefactor C2 > C1; second, pushing the ac-curacy beyond second order often runs against instabilities. Thus many tradeoffsmust be considered in practice. In general, first order is indeed poor, but secondorder is often good enough for most problems.

4.3 Stability

A physically stable system should remain numerically stable. Physical stability:

||T || ≤ 1

In other terms, the transfer operator has a non-positive spectrum

λ < 0

The numerical spectrum should share the same property.Stability is usually associated with causality constraints, also known as

Courant-Friedrichs-Lewy (CFL) conditions.For instance, for the advection equation ∂tφ+U∂xφ = 0 and an explicit time

marching ∂tφ ∼ (φ(t+ h)− φ(t))/h:

CA ≡Uh

d< 1

The physical speed should not exceed the maximum speed allowed in the lattice(lattice light speed), i.e.

U < Ul ≡d

h

The same crietrion applies to any physical mechanism, for instance the CFL forthe diffusion equation is

CD ≡Dh

d2< 1

i.e.

D < Dl ≡d2

h

The physical diffusivity should not exceed the maximum one alowed in thelattice.

3

Page 4: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

4.4 Efficiency

The number of operations to complete a task, for instance advancing the solutionover the entire lattice by a single step, usually measured in Flops=Floating PointOperations. Typically the computational density Flops/lattice site/step. Forinstance, a scheme which takes 100 Flops/site/step, requires 100 Mflops/siteto update a one million site lattice. On a computer delivering 100 Mflops/s,this updates the lattice in 1 second CPU per time step. An important propertyof numerical schemes is locality. This means that the number of operations,often called computational complexity (CC), is proportional to the number ofgrid points, i.e. the cpmputtaional density (CD) is constant. Few schemeshave this nice property, since usually the cost of updating a single degree offreedom grows with the total number. A typical case is provided by unscreenedlong-range interactions, 1/r, such as gravity and one-signed charges, in whicheach degree of freedom interacts with all others. Under these conditions, Cdscales like N and CC like N2. Computer speed has increased of a factor 1.5every two years (Moore’s law), i.e. a factor 1000 every 15 years, for the lastfourty years. This has taken us from about 1Mflops/s of the 80’s to the nearPetaFlops/s (1015) of present-day supercomputers. Note that this not only rawclock rates (about 1 GhZ) but also the concurrent use of multiple computers(Parallel computing).

4.5 Causality versus Locality

This peratins to time marching. Causality means that the the present dependson the past and not on the future. This may seem obvious, but some systemsare not causal: for instance the Poisson equation of electrostatics

∆Φ = ρe

states that the potential at a given point in space x and a given time t dependson teh charge distribution at the same time t, i.e.e simultaneous dependence.This is also known as action at distance.

Lack of causality usually implies loss of locality: the solution of the Poissionproblem is formally given by

φ(x) =

∫G(x− y)ρe(y)dy

where G(x− y), the Green-function (inverse Laplace) is generally non-zero ev-erywhere, typically G(x, y) = 1/r, where r = dis(x, y).

4.6 Reversibility

particularly important for non-dissipative systems, say hamiltonians. The en-ergy should be exactly conserved, and by moving the sistem on a loop in time,forward and backward, the initial state shoudl be exactly regained.

4

Page 5: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

φ(t) = Ttφ(0)

φ(t− t) = T−tTtφ(0) = φ(0)

This is true only iffT (−t)T (t) = I,

namelyT (−t) = T (t)−1

which is also called group property.We shall return on this when discussing time-marching schemes.

5

Page 6: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

6

Page 7: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

7

Page 8: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

8

Page 9: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

9

Page 10: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

10

Page 11: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

11

Page 12: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

12

Page 13: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

13

Page 14: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

14

Page 15: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

15

Page 16: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

16

Page 17: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

17

Page 18: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

18

Page 19: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

19

Page 20: Lecture 6: Grid discretization - Harvard University4 The guiding principles 4.1 Consistency In the continuum limit h!0; d!0 the discretized system should recover the continuum one

20