## Beam loading simulation of two active cavity system by RFMODE

Moderators: cyao, michael_borland

Chae
Posts: 3
Joined: 25 Jul 2017, 08:16

### Beam loading simulation of two active cavity system by RFMODE

HI Michael,

I am studying the transient beam loading with gaps. I made the progress in semianalytic method to compute the bunch profiles which varies over the train of bunches with beam loading effect included. Now I like to simulate the beam loading with RFMODE and I have encountered the difficulties to correct them.

I am able to control the cavity voltage and its phase by using AMPLITUDE_FILTER and PHASE_FILTER which comes with elegant/examples.

case 1) But I couldn't control both voltage and phase in the desired value when I use both the fundamental and harmonic cavity in active mode as RFMODE elements.
case 2) So I set the main cavity as RFCA element and the harmonic cavity as RFMODE element. It does control the voltage and phase to the desired value. But the resulting bunch length is far too small.

I expect the bunch length 40 ps with the nominal setting that V1=10 MV, phis1="180 3.86e6 10e6 / dasin -"
P4_PR_23g.lte
, V3=3.1 MV, phis3=0.0 (360 works in RFMODE).
For case1) the system is unstable.
For case2) it damps to 10ps (instead of 40 ps) even if V1 and V3 are 10MV (RFCA) and 3.1MV (RFMODE), respectively.

I need your help in both case1) and case2) to simulate two active rf system. For this I attached the bunch file(prepared by makeBunchTrains, elegant files, result files.

You can produce the results by:
for case1:
for case2:

In both cases, I am using 80-trains of bunches (10-bunches+2-buckets)*80=800-bunches out of 960-buckets with hrf=3840; each bunch has 3000 particles. And the rf-system is

! RF System - fundmental
! Harmonic number = 3840, Ncavity=24, Q=29000, beta=3.0, R/Q=3.4e6/29000

! RF System - 3rd harmonic
! Harmonic number = 3840*3, Ncavity=24, Q=17000, beta=5.3, R/Q=1.5e6/17000

I also attached the element-by-element lattice file so that you can compute the lattice characteristics.

Your help will be highly appreciated.

Best,
Yong-Chul

michael_borland
Posts: 1815
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

### Re: Beam loading simulation of two active cavity system by RFMODE

Yong-Chul,

I had to use feedback on the beam to stabilize it longitudinally. I'm not sure why, but you might try using a passive cavity for the harmonic to see if that is stable.(Initially, I thought the problem was that the harmonic cavity is on the Robinson-unstable side; switching to the other side helps, but not enough.)

Another problem was that the rf voltages and phases were not quite the right ones for optimum stretching. I also used pseudo-multibunch mode so I could run the tests more quickly. The attached file contains a complete working example. The README file gives the simulation sequence.

--Michael
Attachments
trackingExample.tar.gz

li.chao
Posts: 30
Joined: 18 Aug 2021, 08:59

### Re: Beam loading simulation of two active cavity system by RFMODE

Hi Michael,

I am trying to do the simulation with the script you send to Yong-Chul.

Could you explain a little bit about the the difference between simulation with
"pseudo-multi bunch mode"?

why this "pseudo-multi bunch mode" can represent the bunch-by-bunch tracking?

yours Chao

michael_borland
Posts: 1815
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

### Re: Beam loading simulation of two active cavity system by RFMODE

Chao,

The idea of pseudo-multi-bunch mode is that if you have a uniform fill (equal bunches at equal spacing), the properties of the bunches will be identical. In that case, we only need to track one real bunch, which is much faster. In the *RFMODE elements, however, we need to include the number and spacing of the bunches in order get the right beam-loading. This is done by specifying the number of bunches and spacing in the definition of *RFMODE elements.

--Michael

li.chao
Posts: 30
Joined: 18 Aug 2021, 08:59

### Re: Beam loading simulation of two active cavity system by RFMODE

Hi Michael

Yes, I understand the reason to develop the pseudo-multi-bunch mode. If I understand it correctly, in this pseudo-multi-bunch mode, elegant tracking one bunch M times in one turn instead of tracking M bunches one by one per turn, is it? Then in this case, the bunch-by-bunch beam induced voltage phasor can be re-constructed correctly.

I am trying to comparing the results from the pseudo-multi-bunch and "bunch-by-bunch" tracking results with 480 bunches. In my simulation, only the main cavity is considered. Then I scanned the beam current to check the longitudinal unstable threshold.

1. In the bunch-by-bunch tracking, I found that the longitudinal beam current is 240mA. As shown in the attached file Bunch-By-Bunch_Tracking.png, beam get unstable during 50K turns tracking. We consider this is due to the longitudinal coupled bunch unstable mode.

PS: The longitudinal data pAverage and KAverage in bunch-by-bunch tracking mode, with watch element setting as below,
"wp0: WATCH,FILENAME="%s.wp0", MODE="parameters",FLUSH_INTERVAL=100,startPID=1,endPID=40000"
the printed out data "pAverage, KAverage" are not correct in *.wp0 file. It seems like one more average process among 480 bunches

2. in the Pseudo_multi_bunch tracking, as shown in the Pseudo_multi_bunch_tracking.png. The beam got lost in longitudinal within 1000 turns when beam current goes up to 360mA. It seems like that the beam induced voltage is too large that gradually kicked the beam out of the bucket.

So can I make a conclusion that, the Pseudo_multi_bunch tracking mode can not be used to study the coupled bunch unstable mode.

Please make comment and correction on my understanding above.
Thanks very much.
yours Chao

michael_borland
Posts: 1815
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

### Re: Beam loading simulation of two active cavity system by RFMODE

Chao,

You are correct: pseudo-multi bunch mode cannot be used to model coupled bunch instabilities, with the exception of mode 0, where all bunches move together.

--Michael