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 " , 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:
elegant p4time.ele macro=Ib=0.1,root=rfhm_N3k_Ramp10k_PRELOAD_360_3.1MV_960,Npass=20000,Nparticle=3000,Nslot=6000,Vrf1=10e6,Vrf3=3.1e6
for case2:
elegant p4time3.ele macro=Ib=0.1,root=rfhm3_N3k_Ramp10k_PRELOAD_360_3.1MV_960,Npass=20000,Nparticle=3000,Nslot=6000,Vrf1=10e6,Vrf3=3.1e6
In both cases, I am using 80trains of bunches (10bunches+2buckets)*80=800bunches out of 960buckets with hrf=3840; each bunch has 3000 particles. And the rfsystem 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 elementbyelement lattice file so that you can compute the lattice characteristics.
Your help will be highly appreciated.
Best,
YongChul
Beam loading simulation of two active cavity system by RFMODE
Moderators: cyao, michael_borland

 Posts: 1772
 Joined: 19 May 2008, 09:33
 Location: Argonne National Laboratory
 Contact:
Re: Beam loading simulation of two active cavity system by RFMODE
YongChul,
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 Robinsonunstable 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 pseudomultibunch 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
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 Robinsonunstable 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 pseudomultibunch 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
 (12.01 KiB) Downloaded 107 times
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 YongChul.
Could you explain a little bit about the the difference between simulation with
"pseudomulti bunch mode"?
why this "pseudomulti bunch mode" can represent the bunchbybunch tracking?
yours Chao
I am trying to do the simulation with the script you send to YongChul.
Could you explain a little bit about the the difference between simulation with
"pseudomulti bunch mode"?
why this "pseudomulti bunch mode" can represent the bunchbybunch tracking?
yours Chao

 Posts: 1772
 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 pseudomultibunch 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 beamloading. This is done by specifying the number of bunches and spacing in the definition of *RFMODE elements.
Michael
The idea of pseudomultibunch 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 beamloading. 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
Hi Michael
Yes, I understand the reason to develop the pseudomultibunch mode. If I understand it correctly, in this pseudomultibunch 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 bunchbybunch beam induced voltage phasor can be reconstructed correctly.
I am trying to comparing the results from the pseudomultibunch and "bunchbybunch" 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 bunchbybunch tracking, I found that the longitudinal beam current is 240mA. As shown in the attached file BunchByBunch_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 bunchbybunch 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
Yes, I understand the reason to develop the pseudomultibunch mode. If I understand it correctly, in this pseudomultibunch 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 bunchbybunch beam induced voltage phasor can be reconstructed correctly.
I am trying to comparing the results from the pseudomultibunch and "bunchbybunch" 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 bunchbybunch tracking, I found that the longitudinal beam current is 240mA. As shown in the attached file BunchByBunch_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 bunchbybunch 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

 Posts: 1772
 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: pseudomulti bunch mode cannot be used to model coupled bunch instabilities, with the exception of mode 0, where all bunches move together.
Michael
You are correct: pseudomulti 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
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 pseudomulti 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=1e12, 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
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 pseudomulti 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=1e12, 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
 Attachments

 TempToElegnat_Forum.7z
 (3.96 MiB) Downloaded 63 times