Differential Algebra (DA) based Fast Multipole Method (FMM) He - - PowerPoint PPT Presentation

differential algebra da based fast multipole method fmm
SMART_READER_LITE
LIVE PREVIEW

Differential Algebra (DA) based Fast Multipole Method (FMM) He - - PowerPoint PPT Presentation

Differential Algebra (DA) based Fast Multipole Method (FMM) He Zhang, Martin Berz, Kyoko Makino Department of Physics and Astronomy Michigan State University June 27, 2010 He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based


slide-1
SLIDE 1

Differential Algebra (DA) based Fast Multipole Method (FMM)

He Zhang, Martin Berz, Kyoko Makino

Department of Physics and Astronomy Michigan State University

June 27, 2010

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-2
SLIDE 2

Space charge effect

Space charge effect : the fields of the charged particles in a bunch on each other affect the motion of themselves. Pair-to-pair method, time consuming, O(N2) Tree code, O(N log N). (The field of the electrons far away from the observer point, can be represented by the field of a multipole.) Fast multipole method, much faster, O(N). (Multipole expansion and local expansion, recursive progress.)

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-3
SLIDE 3

Space charge effect

  • M
  • M
  • L

O(N log N) O(N)

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-4
SLIDE 4

History of FMM

1 J.Barnes, and P.Hut. A Hierarchical O(N log N) Force-Calculation Algorithm. Nature Vol. 324, pp. 446-449,

  • Dec. 4, 1986

2 L.Greengard, and V.Rokhlin. A Fast Algorithm for Particle

  • Simulations. J. Comput. Phys. 73, pp. 325-348, 1987

3 J.Carrier, L.Greengard, and V.Rokhlin. A Fast Adaptive Multipole Algorithm for Particle Simulations. SIAM J. Sci.

  • Stat. Comput. Vol. 9, No. 4, pp. 669-686, July 1988.

4 R.Beatson and L.Greengard. A Short Course on Fast Multipole Methods. Numerical Methematics and Scientific Computation, Wavelets, Multilevel Methods and Elliptic

  • PDEs. Oxford University Press, pp. 1-37, 1997

5 B.Shanker and H.Huang. Accelerated Cartesian Expansions - A Fast Method for Computing of Potentials of the Form R−ν for All Real v. J. Comput. Phys. 226, pp. 732-753, 2007

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-5
SLIDE 5

Some concepts

Cut box, near region, and far region.

First Level Second Level

Near region (neighbors) Far region

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-6
SLIDE 6

Some concepts

Interaction list and how it works.

Interaction list Interaction list Already calculated

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-7
SLIDE 7

Brief introduction of FMM

The process of FMM can be described as follows. Select the level of boxes according to the accuracy needed. From the finest level to the coarest level, calculate the multipole expansion of the charges inside each box. For each box in each level, convert the multipole expansions

  • f the boxes in its interaction list into its local expansion.

From the coarest to the finest level, translate the local expansion of each box into its child boxes and add it to the local expansion of the child box In the finest level, in each box calculate the potential or field by the local expansion on each particle inside. The potentials

  • r fields of the particles inside the box or in its near region are

calculated directly.

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-8
SLIDE 8

How we do it in the Differential Algebra (DA) frame

Automatic Taylor expansion of a function f (x + δx) = f (x) + f ′(x)δx + 1 2!f ′′(x)δx2 + 1 3!f ′′′(x)δx3 + ... In Cosy, f (x+da(1)) = f (x)+f ′(x)da(1)+ 1 2!f ′′(x)da(1)2+ 1 3!f ′′′(x)da(1)3+... Composition of two maps G(x) = G(F) ◦ F(x),

  • r G(x) = G(F(x))

In COSY, it can be done by the command POLVAL L P NP A NA R NR

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-9
SLIDE 9

How we do it in the Differential Algebra (DA) frame

Multipole expansion from charges

S(0, 0, 0)

  • R1

R2

  • Ri
  • R(x, y, z)

S(0, 0, 0)

  • R(x, y, z)
  • M

φ

R(

Ri) = φ

R(

M)

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-10
SLIDE 10

How we do it in the Differential Algebra (DA) frame

Multipole expansion from charges (for boxes in the finest level) φc2m =

N

  • i=1

Qi

  • (xi − x)2 + (yi − y)2 + (zi − z)2

= Qi/

  • x2 + y 2 + z2
  • 1 + x2

i +y2 i +z2 i

x2+y2+z2 − 2xix x2+y2+z2 − 2yiy x2+y2+z2 − 2ziz x2+y2+z2

= Qi · d1

  • 1 + (x2

i + y 2 i + z2 i )d2 1 − 2xid2 − 2yid3 − 2zid4

, with d1 = 1

  • x2 + y 2 + z2 = 1

r , d2 = x x2 + y 2 + z2 = x r2 , d3 = y x2 + y 2 + z2 = y r2 , d4 = z x2 + y 2 + z2 = z r2 ,

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-11
SLIDE 11

How we do it in the Differential Algebra (DA) frame

Multipole expansion in the higher level boxes

  • M
  • M
  • M
  • M
  • M

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-12
SLIDE 12

How we do it in the Differential Algebra (DA) frame

Translation of a Multipole Expansion

  • M

S(0, 0, 0) S′(x′

s, y′ s, z′ s)

  • R(x, y, z)
  • R(x′, y′, z′)
  • M′

S′(0, 0, 0) S(−x′

s, −y′ s, −z′ s)

φ

R(

M) = φ

R(

M′)

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-13
SLIDE 13

How we do it in the Differential Algebra (DA) frame

DA variables in S′ frame. d′

1 =

1

  • x′2 + y ′2 + z′2 = 1

r′ , d′

2 =

x′ x′2 + y ′2 + z′2 = x′ r′2 , d′

3 =

y ′ x′2 + y ′2 + z′2 = y ′ r′2 , d′

4 =

z′ x′2 + y ′2 + z′2 = z′ r′2 , Relation between the new and old DA variables (M1). d1 = d′

1

  • 1 + (x′2

s + y ′2 s + z′2 s )d′2 1 + 2x′ sd′ 2 + 2y ′ sd′ 3 + 2zsd′ 4

d2 = d′

2

d′2

1

+ x′

s

  • · d2

1,

d3 = d′

3

d′2

1

+ y ′

s

  • · d2

1 ,

d4 = d′

4

d′2

1

+ z′

s

  • · d2

1.

Potential in S′ frame is φm2m = φc2m ◦ M1.

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-14
SLIDE 14

How we do it in the Differential Algebra (DA) frame

Conversion of a Multipole Expansion (in the interaction list) into a Local Expansion

  • M

S(0, 0, 0)

  • R(x, y, z)
  • R(x′, y′, z′)
  • L

O(0, 0, 0) O(xo, yo, zo) S(−xo, −yo, −zo)

φ

R(

M) = φ

R(

L)

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-15
SLIDE 15

How we do it in the Differential Algebra (DA) frame

DA variables in the observer frame O. d′

1 = x′,

d′

2 = y ′,

d′

3 = z′.

Relation between the DA variables in the source frame S and the

  • bserver frame O. (M2)

d1 = 1

  • (xo + d′

1)2 + (yo + d′ 2)2 + (zo + d′ 3)2

d2 = xo + d′

1

(xo + d′

1)2 + (yo + d′ 2)2 + (zo + d′ 3)2 ,

d3 = yo + d′

2

(xo + d′

1)2 + (yo + d′ 2)2 + (zo + d′ 3)2 ,

d4 = zo + d′

3

(xo + d′

1)2 + (yo + d′ 2)2 + (zo + d′ 3)2 .

The potential in the observer frame O is φm2l = φc2m ◦ M2.

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-16
SLIDE 16

How we do it in the Differential Algebra (DA) frame

Local Expansion inherited from the parent box.

  • L
  • L
  • L
  • L
  • L

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-17
SLIDE 17

How we do it in the Differential Algebra (DA) frame

Translation of a Local Expansion

O(0, 0, 0)

  • L O′(x′
  • , y′
  • , z′
  • )
  • R(x, y, z)
  • R(x′, y′, z′)
  • L′

O′(0, 0, 0) φ

R(

L) = φ

R(

L′) O(−x′

  • , −y′
  • , −z′
  • )

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-18
SLIDE 18

How we do it in the Differential Algebra (DA) frame

DA variables in the new observer frame O′. d′

1 = x′,

d′

2 = y ′,

d′

3 = z′.

Relation between the DA variables in the old and new frame. (M3) d1 = x′

  • + d′

1,

d2 = y ′

  • + d′

2,

d3 = z′

  • + d′

3.

The potential in the observer frame O′ is φl2l = φm2l ◦ M3.

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-19
SLIDE 19

How we do it in the Differential Algebra (DA) frame

Field is easy to calculate. In the local expansion, the potential is represented as a polynomial of the local coordinates. The calculate the field, one just need to take derivative of the the respect coordinate. This is also important in the high order map method.

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-20
SLIDE 20

How we do it in the Differential Algebra (DA) frame

Check the convergence. Case 1, source box center (0,0,0), observer box center (2,0,0), length of the box side 1, 50 electrons in each box, repeat 1000 times.

  • rder

3 4 5 6 7

  • M error

1.488E-3 1.040E-3 1.454E-4 6.067E-5 2.104E-5

  • L error

3.026E-3 1.264E-3 2.170E-4 8.357E-5 2.655E-5 Case 2, source box center (0,0,0), observer box center (2,2,0), length of the box side 1, 50 electrons in each box, repeat 1000 times.

  • rder

3 4 5 6 7

  • M error

3.923E-4 1.038E-4 2.196E-5 7.561E-6 1.482E-6

  • L error

7.109E-4 1.568E-4 3.698E-5 9.741E-6 2.075E-6

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-21
SLIDE 21

How we do it in the Differential Algebra (DA) frame

Case 3, source box center (0,0,0), observer box center (2,2,2), length of the box side 1, 50 electrons in each box, repeat 1000 times.

  • rder

3 4 5 6 7

  • M error

2.567E-4 7.852E-5 8.991E-6 2.315E-6 4.031E-7

  • L error

4.281E-4 1.088E-4 1.475E-5 3.451E-6 6.133E-7 Case 4, DA order 3, 50 electrons in each box, repeat 1000 times, change the position of the observer box,50 electrons in each box, repeat 1000 times.

  • bserver

(2,0,0) (3,0,0) (4,0,0) (5,0,0)

  • M error

1.488E-3 3.361E-4 1.248E-4 5.966E-5

  • L error

3.026E-3 6.308E-4 2.116E-4 9.265E-5

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-22
SLIDE 22

Work to do

Finish the code,some low level tools for COSY to increase efficiency. How about bunch size in some dimension is much larger/smaller than the other dimensions. Apply it in some simulation. Error Analysis, rigorous error bound by TM.

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)

slide-23
SLIDE 23

Thank you!

He Zhang, Martin Berz, Kyoko Makino Differential Algebra (DA) based Fast Multipole Method (FMM)