Dear Michael,
Recently, I am trying to learn Elegant simulation model for the bunch-by-bunch feedback with TFDRIVER element in transverse planes.
I read the source code, and there is one thing I did not get it, hopefully, you can help me clarify it.
Th codes are between line 427 and 444 in the tfeedback.cc file, which I posted in below as well.
For the single bunch case, the particle coordinate is updated according to part0[j] += kick/(1+part0[5]);
whereas for the multi-bunches case, particle coordinates are updated by
part0[ipBucket[iBucket]][j] += kick*rfFactor/(1+part0[ipBucket[iBucket]][5]);
The "rfFactor" is missing for the single bunch case, I would like to know, why?
yours sincerely Chao
*///////////////////////////////////////////////
if (!tfbd->longitudinal) {
j = tfbd->pickup->iPlane+1;
if (nBuckets==1) {
for (i=0; i<np0; i++) {
if (tfbd->frequency>0)
rfFactor = cos(PIx2*tfbd->frequency*(time0-tAve)+phase);
part0[j] += kick/(1+part0[5]);
}
} else {
if (npBucket) {
for (i=0; i<npBucket[iBucket]; i++) {
if (tfbd->frequency>0)
rfFactor = cos(PIx2*tfbd->frequency*(time0[ipBucket[iBucket]]-tAve)+phase);
part0[ipBucket[iBucket]][j] += kick*rfFactor/(1+part0[ipBucket[iBucket]][5]);
}
}
}
} else { /* longitudinal */
*///////////////////////////////////////////////
TFDRIVER
Moderators: cyao, michael_borland
Re: TFDRIVER
Dear Michael,
There is one more thing I need your help of this TFDRIVER element.
By reading the manual, I am confused about the setting of FIR filter with the arbitrary delay and UPDATE_INTERVAL value not equal 1.
For simplicity, assume the input filter TFBPICKUP with settings as A0=1, UPDATE_INTERVAL=1.
At the TFDRIVER, if I want to have 5 turns delay, and the update_interval=10. Mathematically, I can express what I want as
y[0] = a_0 * C_{5} + a_1 * C_{15} + a_2 * C_{25} + ...
Here y[0] is kick strength at the current turn, C_{N} is the bunch position in Nth previous turns.
In this case, should I set the TFDRIVER element as
DRIVERZDRF: TFBDRIVER,UPDATE_INTERVAL=10, DELAY=5, A0=a_0, A1=a_1...,
Is it correct?
Whereas in the manual, it is written that y[0]=\Sum_i a_i C_i, where a_0 is always related to current turn information C_0.
I hope I have explained my confusion clearly. Could you please explain more on that?
Many thanks.
yours Chao
There is one more thing I need your help of this TFDRIVER element.
By reading the manual, I am confused about the setting of FIR filter with the arbitrary delay and UPDATE_INTERVAL value not equal 1.
For simplicity, assume the input filter TFBPICKUP with settings as A0=1, UPDATE_INTERVAL=1.
At the TFDRIVER, if I want to have 5 turns delay, and the update_interval=10. Mathematically, I can express what I want as
y[0] = a_0 * C_{5} + a_1 * C_{15} + a_2 * C_{25} + ...
Here y[0] is kick strength at the current turn, C_{N} is the bunch position in Nth previous turns.
In this case, should I set the TFDRIVER element as
DRIVERZDRF: TFBDRIVER,UPDATE_INTERVAL=10, DELAY=5, A0=a_0, A1=a_1...,
Is it correct?
Whereas in the manual, it is written that y[0]=\Sum_i a_i C_i, where a_0 is always related to current turn information C_0.
I hope I have explained my confusion clearly. Could you please explain more on that?
Many thanks.
yours Chao
Last bumped by li.chao on 12 Jul 2024, 14:19.