Notes on TRACK Distributions J.F Ostiguy/ APC ostiguy@fnal.gov Ostiguy - Notes on TRACK Distributions
Motivation ● For the purpose of comparison between codes, we often need to either translate an existing particle distribution to TRACK or to generate a custom one. ● Partran predicts a decaying asymmetric centroid oscillation at the beginning of SSR0, even when the beam is matched. ● JP reported large amplitude (9 deg) z centroid oscillations with a distribution translated from TRACK to Partran format. ● We need to make sure that the distributions are generated correctly so as to perform valid comparisons. Ostiguy - Notes on TRACK Distributions
TRACK Distribution Format (This is all the documentation !) if (iwrite_dis.eq.1) then open(1, file='read_dis.dat', status='unknown', access='SEQUENTIAL',form='UNFORMATTED') write(1) Wtmp,nqtot write(1) (npat(ird),ird=1,nqtot) write(1) (qq (ird),ird=1,nqtot) Note: the loop is over nqtot(i) + 1 particles do iq = 1,nqtot do i = 0,npat(iq) write(1) x(i,iq) , xx(i,iq) , y(i,iq) , yy (i,iq), & csi(i,iq)/harm0, bb (i,iq) , spin(i,iq) enddo enddo close(1) endif c Wtmp kinetic energy in keV/u c nqtot no of species present c npat(i) no particles of species i c x(i,iq) cm c xx(i,iq) rad c y(i,iq) cm c yy(i,iq) cm c csi(i,iq) rad c bb(i,iq) relative velocity ( beta in version < 1.38; beta*gamma v >= 1.38 ) c spin(i,iq) 1.0d0 if particle is within acceptance, -1.0d0 otherwise Ostiguy - Notes on TRACK Distributions
“Synchronous” and “Central” Particle ● I contacted B. Mustapha at Argonne. According to him: ● the synchronous (reference particle) is generated internally and is not part of the tracked distribution. ● The first particle in the file is the so-called “central” particle. This particle should have its state coordinates set to 0.0, except for the momentum. This first particle, dubbed “central” particle is not the synchronous (reference) particle. Ostiguy - Notes on TRACK Distributions
An Additional Check ● A water-bag distribution was created using TRACK internal distribution generation facility and saved immediately, i.e without propagating it through any element. ● The saved distribution file (read_dis.out) is meant to be readable by the code as an input distribution. The file contains the states of N+1 particles, even though npat(1)=N was originally specified in track.dat. An additional particle, the first particle appearing in the distribution file does indeed have its state coordinates all set to 0.0, except for the normalized momentum which is set to a value corresponding to the kinetic energy appearing in the distribution file header. Ostiguy - Notes on TRACK Distributions
Notes on TRACK usage ● Track v39 can use either binary or ascii distributions. ● For binary distribution: each write statement produces a fortran RECORD ● For ascii each write statement produces an ascii string terminated by a newline delineator. ● Undocumented : In track.dat : iread_dis=1, iwrite_dis=1 for binary iread_dis=2, iwrite_dis=2 for ascii ● For a distribution containing N particles, an additional (“central”) particle should be added as the first particle) ● The state coordinates of the central particle should be all 0.0, except for beta*gamma, which should be consistent with the value of W in the header. ● The synchronous particle initial state is generated internally, from the kinetic energy specified in the header, expressed in keV/u. Ostiguy - Notes on TRACK Distributions
Input Kinetic Energy In TRACK, energy is specified is keV/u. Although the difference between the numerical values in keV and keV/u is small, the distinction can become rather important, for reasons that will become clear in what follows. u = unified atomic mass unit Definition: 1 u = mu = 1/12 m( 12 C) 1 u = 931.494 028(23) MeV/c**2 For H- ion: proton mass = 938.272 013 MeV/c**2 = 1.00727 u electron mass = 0.511 MeV/c**2 = 5.49 e-4 u Total = 1.00837u An H- ion with E_K= 2.5 MeV has an initial energy of 2.5 MeV /1.00837u = 2.4792 MeV/u Ostiguy - Notes on TRACK Distributions
Header From the Problematic ASCII Distribution used by JP The distribution used by JP was translated directly from Partran. The contents of the TRACK header is not generated by Partran. 2.516999999926007100e+03 1 1000000 1.000000e+00 -1.298103947192430500e-01 -7.299060816876590300e-04 -1.457228325307369200e-01 -6.416626274585723900e-03 -1.332739852351644 300e-01 +7.314632075502276700e-02 ….. I do not know where the values in the header came from … generated by a program … or added by hand ? The kinetic value is wrong. It looks like it was perhaps (mistakenly) obtained from k. energy * [proton mass in u] 2.5 * 1.00727 = 2.518 ??? Ostiguy - Notes on TRACK Distributions
Effect of Using the Wrong Energy in Header ● Correct value 2.4792 ● 2.518, represents an error of ~1.57 % A 2.5 MeV, gamma ~ 1 so this is a 1.5% relative difference between the centroid and reference particle velocities. A 2.5 MeV H- advances by (1/beta*c)*f *360 ~ 5000 degrees / m The error in <phi>-phi_s will be ~ dβ/β * 5000 = 75 deg / m In our lattice, distance to 1 st cavity is ~ 20 cm => ~15 deg error Ostiguy - Notes on TRACK Distributions
A Test with TRACK … 100 particles, using old baseline lattice frontend Note asymmetric oscillation, consistent with PARTRAN With distribution translated With the same distribution translated from PARTRAN, from PARTRAN, Using W=2.4792 (correct) But using W=2.518 (wrong) in header Ostiguy - Notes on TRACK Distributions
TRACK, Wrong Energy in Distribution Header ( Close Up) First Cavity Ostiguy - Notes on TRACK Distributions
TRACK vs PARTRAN … near 1 st Cavity (Correct Distribution) First Cavity. Zc < 0.1 deg Ostiguy - Notes on TRACK Distributions
What Happens If the “Central” Particle is Not Properly Set ? With a distribution translated With distribution translated from PARTRAN, from PARTRAN, Using W=2.4792 (correct) Using W=2.4792 (correct) Central particle is random. The “central” particle seems to be used as a quick way to approximately track the position of the centroid. I suspect it be used to save time when computing sc kicks (effect with should be tested). In absence of SC, it seems to have no effect. Ostiguy - Notes on TRACK Distributions
TRACK vs PARTRAN TRACK Centroid oscillation PARTRAN. Centroid oscillation amplitude is ~ 2 deg amplitude is ~ 2 deg This centroid oscillation is not a statistical effect. It is believed to be due to finite rf curvature over the bunch length. Ostiguy - Notes on TRACK Distributions
TRACK vs PARTRAN with SC ON ( I = 10ma) The predicted amplitude with SC on is larger with PARTRAN (factor ~ 2) … This should be investigated futher. Ostiguy - Notes on TRACK Distributions
CONCLUSION ● When the distribution is generated internally by TRACK, setting WIN=2.5 MeV instead of the correct value, (2.7492 in this case) has little noticible effect, because both the distribution centroid and synchronous particle remain consistent. ● When the distribution is generated externally (e.g. with PARTRAN) it is imperative for the value of the kinetic energy that appears in the header to be consistent with that of the distribution average, otherwise the reference particle, the rf cavity input phases etc … will be in error. ● PARTRAN and TRACK are in excellent agreement with SC off. There is a remaining discrepancy with SC ON that should be investigated further. Ostiguy - Notes on TRACK Distributions
Recommend
More recommend