Page 1 of 1

Posted: 26 Aug 2021, 12:05
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

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

Posted: 26 Aug 2021, 21:01
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

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

Posted: 11 Feb 2022, 11:45
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

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

Posted: 11 Feb 2022, 13:25
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

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

Posted: 12 Feb 2022, 11:47
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

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

Posted: 14 Feb 2022, 16:16
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

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

Posted: 16 Feb 2022, 12:43
Dear Michael,

Recently I am doing the simulations to study the beam loading. However, stucked on some questions, hopefully you can help to cover some of them.

The attached files are what I am using for test running to study beam loading effect.
In my simulation, I treat the main cavity as rfca element and harmonic cavity as RFMode element with the pseudo-multi bunch mode.
The unifrom filling pattern is applied.

The first thing I confirmed is that, the cavity feedback has to be turned on at HC. If not, HC phase and amplitude will shift to a "wrong" place, which does not meet the design requirement.
---------------------------------------------------------------------------------------------------------------------------
My first group of questions is related to the cavity feedback:
1. why I have to turn on the HC cavity feedback? I assume the MC(RFCA) + HC(RFMODE) without cavity feedback should work, is it?
Or did I make mistake on the settings in the input files ?

2. I am using APS cavity feedback data, AmpFeedbackfilters.sdds and PhaseFeedbackfilters.sdds. I found that in each file, there are two pages. I assume each page defined one filter. Thus in total there are two Amp filters and two Phase filters defined. When these two files are feed into HC cavity feedback settings. All of the filters are applied in the simulations? I assume two should be enough, is it?

3. Based on the fitter coefficient, how can I get the amplitude and phase response of the close loop gain as show in the reference.
https://accelconf.web.cern.ch/IPAC2015/ ... pma006.pdf.
Assume the filter function in frequency domain F(f), cavity as CAV(f). Can I get the open loop gain and closed loop gain by relation
OpenLoopG[f] := F[f] Cav[f];
CloseLoopG[f] := Cav[f] /(1 - F[f] Cav[f]) ?

------------------------------------------------------------------------------------------------------------------------------

In the following simulation, the harmonic cavity feedback is tuned on.
I scanned the beam current, and tried to find out how much current can be stored in this setting, which is supposed to be decided by the \mu=0 coupled bunch mode of the HC.

The attached figure are the compares between 260mA and 280mA case. When beam current below 260 mA. Every thing is find till 50K turns. Beam center oscillate with 15 pico second, bunch is lengthened roughly to the required value. The HC voltage and phase are also well maintained. Whereas, when the current goes to 280mA. The cavity voltage start to oscillate, and so is the cavity phase.
Then the pelegnat stopped and give information as
"971 of 19975 particles outside of binning region in RFMODE HARMMODEFB11 #1. Consider increasing number of bins"
Whereas, in my simulation, bin_size=1e-12, n_bins=2000, it already covers one whole RF bucket.

For me, it seem like the threshold,260mA, obtained above, is due to HC cavity feedback but not the \mu=0 coupled bunch mode, is it?
If I want to know the \mu=0 coupled bunch current threshold of the HC, How to make the system run above 280m?

Sorry for so may questions. I hope I describe them clearly and thanks for your patient answers.
yours sincerely Chao