1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many...

29
1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej, Bruno Z., Elias, Erk, Gianluigi, Giovanni, Massimo, Rama, Rogelio

Transcript of 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many...

Page 1: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

1

Trying to understand the routine that Bruno is using to get the impedance

from the wake

Many thanks for their help to:

Bruno S. (of course), Alexej, Bruno Z., Elias, Erk, Gianluigi, Giovanni, Massimo, Rama,

Rogelio

Page 2: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

2

Context• Simulation campaign to gather the impedance of SPS elements in

ZBASE.

• Collaboration with Bruno Spataro (INFN).

• Time domain and frequency domain MAFIA simulations (1st version, ~ 1988, now unavailable) to obtain the wakes and impedance (longitudinal and transverse).

• The main objective here is to understand what results Bruno is giving us, so that we know how to compile these results in ZBASE and how to use them in a relevant way in HEADTAIL.

Page 3: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

3

Study triggered by strong differences between the impedance computed by Bruno from the wake

and the plain FFT of the wake computed by myself

Both signals share common features, but :- Plain FFT of the wake yields negative longitudinal real impedance for certain frequencies not physical- Bruno’s sampling is ~8 times higher than mine- Peaks appear around the same frequencies but their shapes are very different- in addition, suspicions with the given negative sign of the imaginary part of the transverse impedance

Bruno provided us with his routine to obtain the impedance.

Page 4: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

4

Bruno’s routine

• Bruno took this small routine from the ABCI Fortran source code (Yong Ho Chin)to transform the computed wake into impedance.

• What does this routine do? Let’s see…

Page 5: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

5

Initial longitudinal wake obtained from Mafia time domain simulations

Page 6: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

6

Obtaining a Matlab code that behaves like the Fortran code

I will use the Matlab routine from now on.

Page 7: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

7

N

j

l

NAt

Tjki

t

TjHjW

cA

fktkZ

1

2

.

11.2exp.

.

...2

2

1exp)(

After some work, Bruno (Yong Ho)’s “FFT” of the Wake W seems to be:

Amplitude factor due to Gaussian distribution

“Half” Blackman Harris Window

Zero padding

Time delay to account for centering the gaussian source

k: frequency iteratorj: time iteratori: imaginary unitN: number of wake samplesf: Impedance sampling frequencyt: Wake sampling timel: Bunch length (in sec)A: Zero padding factorc: speed of lightT: time delay between the wake start and the center of the gaussian distribution

For comparison, plain DFT of the wake W

N

j N

jkijWtkZ

1

112exp)(

Page 8: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

8

The source is not a point charge… but a gaussian bunch

Page 9: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

9

We need the impedance of a point charge Zpc, but MAFIA gives the impedance of a gaussian beam ZGB

1

0

..2exp)(

N

jGBGB N

jkijWtkZ

Longitudinal Impedance for a bunch at frequency f=k.f=k/(Nt) :

For a Gaussian beam (t rms):

'

'''t

pcGB dttttWtW

and in frequency domain(TF = Fourier Transform)

2

2exp

2exp

2

1 2

2

2t

tt

ftTFtTF

Discretizing for f=:

2

...2exp

2tfk

k

Therefore:

tTFfZdttttWTFtWTFfZ pc

t

pcGBGB .''''

tTF

fZfZ GB

pc

Finally, the impedance of a point charge is:

For a bunch, we have

N

jGB

ttGBpc N

jkijW

fkt

fkkZkZ

1

22 ..2exp

2

...2exp

2

...2exp

[Chou and Jin ANL LS-115 (1988)]

Page 10: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

10

In addition, the gaussian distribution is not centered with respect to the wake start

T

Source (t)

Wake WGB(t)

t

0

fTifTtTFtTF t

tt

2exp2

2exp

2

)(exp

2

1 2

2

2

1

0

2 ..2exp....2exp

2

...2exp

N

jGB

tpc N

jkijWTfki

fktkZ

1

0

2 ...2exp.

2

...2exp

N

jGB

tpc N

TfNjkijW

fktkZ

In this case,

2

2

2exp

2

1

tt

Ttt

For Matlab and Fortran, origin of time is at j=1 and origin of frequency is at k=1, so:

then,

so,

Finally

N

jGB

tpc N

TfNjkijW

fktkZ

1

2 ..112exp.

2

..1.2exp

Page 11: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

11

…continued

N

jGB

tpc N

TfNjkijW

fktkZ

1

2 ..112exp.

2

..1.2exp

With

N

jGB

lpc N

tT

jkijW

tNc

ktkZ

1

2 112exp.

..

.1.2

2

1exp

tNf

1

and cl

t

we get

Remarks: • if the source bunch is too long, then the exponential factor increases very rapidly with k, and the signal to noise ratio to estimate ZGB deteriorates, and. (ex of Bruno: l = 1.5 cm , N=1001, and ct = 3 mm). The cutoff frequency due to sampling in time domain is fc=1/(2t)~50 GHz - At f=4 GHz (k= f.N.t ~ 40), the exponential correction is a factor 2 - At f=8 GHz (k= f.N.t ~ 80), the exponential correction is a factor 23

Therefore, need for short source bunches. But shorter source bunches require smaller mesh, i.e. longer CPU time for the same wake length.Therefore there is a tradeoff between CPU time and accuracy.

Page 12: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

12

Plain DFT of the wake

N

j NtT

jkAijHjW

c

fAktkZ

1

2 11.2exp.

....2

2

1exp)(

N

j N

jkijWtkZ

1

112exp)(

Bruno’s DFT

Plain DFT of the wake

Page 13: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

13

DFT of the wake deconvoluted by the gaussian source bunch(only time delay)

N

j NtT

jkAijHjW

c

fAktkZ

1

2 11.2exp.

....2

2

1exp)(

Bruno’s DFT

DFT of the wake deconvoluted by the delay between the gaussian bunch center and the wake (the gaussian factor is not yet taken into account)

N

jGBpc N

TfNjkijWtkZ

1

..112exp.

Page 14: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

14

DFT of the wake deconvoluted by the gaussian source bunch(time delay and frequency dependant amplitude correction)

N

j NtT

jkAijHjW

c

fAktkZ

1

2 11.2exp.

....2

2

1exp)(

Bruno’s DFT

DFT of the wake deconvoluted by the gaussian bunch source

N

jGB

tpc N

TfNjkijW

fktkZ

1

2 ..112exp.

2

..1.2exp

Page 15: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

15

Remaining questions

• Why is Yong Ho’s exponential correction offset by 1 index?

Page 16: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

16

Windowing

Page 17: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

17

Half Blackman Harris window

N

j N

jkijHjWtkZ

1

112exp)()(

With H(j) = 0.40217 +0.49703*cos((j-1)/N) +0.09392*cos(2(j-1)/N) +0.00183*cos(3(j-1)/N)One of the 4 terms Blackman Harris windows

High dynamic bandwidth - low resolution window to increase the high frequency cutoff due to finite length wake field

Page 18: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

18

DFT of the windowed wake deconvoluted by the gaussian source bunch

N

j NtT

jkAijHjW

c

fAktkZ

1

2 11.2exp.

....2

2

1exp)(

Bruno’s DFT

DFT of the wake deconvoluted by the gaussian bunch source, and windowed

N

jGB

tpc N

TfNjkijHjW

fktkZ

1

2 ..112exp.

2

..1.2exp

Page 19: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

19

Zero padding• From Bruno’s file, it seems a strong zero padding is used.

• The factor is around 8 (NN/(FREQ.DT.NWW) in Yong Ho’s notation, in clear: 624/(fmax . t. N), where 624 is an “arbitrarily” chosen number smaller than N (1001 in our case), fmax is the lowest of the Nyquist frequency and the frequency at which the exponential factor gets bigger than 20.

N

jGB

tpc NA

TfNjkijHjW

A

fktkZ

1

2

.

..11.2exp.

2

..1.2exp

Page 20: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

20

Effect of Zero padding

N

jGB

tpc NA

TfNjkijHjW

A

fktkZ

1

2

.

..11.2exp.

2

..1.2exp

N

j NtT

jkAijHjW

c

fAktkZ

1

2 11.2exp.

....2

2

1exp)(

Bruno’s DFT

Zero padded windowed gaussian-source-deconvoluted DFT

Page 21: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

21

Conclusions

• To be used in Headtail, the wake should be first deconvoluted by the source beam gaussian distribution.

• The windowing leads to significant changes in the impedance spectrum. Is it legitimate to use it?

• The Zero padding does not change much but gives the fake impression of a higher resolution

• The current resolution (0.1 GHz) seems very poor to resolve the SPS impedance peaks.

Page 22: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

22

Ongoing work:Studies on resonator

(see also Bruno Zotter’s book)

Page 23: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

23

Parallel RLC circuit

0

0

1111

)(

jQ

R

jCjLR

ZR L C

Impedance:

Laplace transform (variable s):

22220

220

2

20

2

0

0

20

02

0

)(

)(

41

12

)(

)(

111

)(

ss

s

Q

RsX

s

s

Q

RsX

QQs

s

Q

RsX

Q

ss

s

Q

RsX

CsLsR

sX

u(t)

i(t)

LC

10

L

CRQ

With

Impulse response (t>0):

tttt

Q

Rtx

sinexpcosexp)( 0

2022000

4

11sin

14

1

4

11cos

2exp)(

Qt

QQt

Q

t

Q

Rtx

2

20

2

0

4

11

2

Q

Q

With

Page 24: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

24

2

0

0

2

0

0

2

0

0

2

2

0

0

2

0

0

0

0

0

0

0

0

0

0

11

)(

1

1

)(

11

1

)(

1

)(

Q

RQ

j

Q

RZ

Q

jQR

Z

jQjQ

jQR

Z

jQ

RZ

2

0

0

2

0

0

2

0

0

2 11

)(

Q

RQ

j

Q

RZ

If << 0 and Q >> 1

0)(0

2

02

Q

Rj

Q

RZ

If ~ 0 and Q >> 1

RZ ~)(

If >> 0 and Q >> 1

0)(

0

2

0

2

Q

Rj

Q

RZ

Page 25: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

25

2022000

4

11sin

14

1

4

11cos

2exp)(

Qt

QQt

Q

t

Q

Rtx

If Q>>1 and Q >> 0Tsimulated ~ 100

tQ

Rtx 0

0 cos)(

Page 26: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

26

Effect of truncating the wake (Q=10)

Page 27: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

27

Widening due to truncation(convolution with rectangular window in frequency domain)resolution in frequency domain is clearly missing

Re(Z)

Im(Z)

Effect of truncating the wake (Q=1000)

normalised

normalised

Page 28: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

28

Using the truncated wake as input into Bruno’s routine

theory

Page 29: 1 Trying to understand the routine that Bruno is using to get the impedance from the wake Many thanks for their help to: Bruno S. (of course), Alexej,

29

• Therefore windowing seems a good idea? Signal looks ‘nicer”, but the peak is strongly widened.

• With Bruno, we find: R=3.3 Ohm, and Q=14.5 R/Q=0.22 Ohm

• theoretical = 0.15 Ohm (150 Ohm/1000)