Short Manual on how to Setup and Use Space Charge Calculation (SC) in TRACK --------------------------------------------------------------------------- Zero : We recommed to use at least 10000 particles for a reasonable SC calculation. First : Set the beam current to the appropriate value. The corresponding parameter is "current" in "mA" in the input file "track.dat" (namelist: TRAN). "current=0." means no SC. For multi-component beam, every component should have its own "current" value. Second: Set the 2D or 3D SC calculation. For DC beams use the 2D SC routine by setting the flag "iflag_2D=1" in "track.dat" (namelist: INDEX). For bunched beams use the 3D SC routine by setting "iflag_2D=0". In the case the beam starts as DC and gets bunched in a buncher for example, set "iflag_2D=1" in "track.dat" and right before the buncher line in the "sclinac.dat file insert "1 prmtr iflag_2D=0" to switch the SC calculation from 2D to 3D as the beam being bunched. Third : Set the number of SC grid nodes. The default grid is: Nxgrd=32, Nygrd=32 and Nzgrd=64. The maximum allowed numbers are: Nxgrd=128, Nygrd=128 and Nzgrd=256. To change it from the start use the variables "Nxgrd= 64, Nygrd=64, Nzgrd=64" for example in the "track.dat" file (namelist: TRAN). To change it during the calculation insert the "1 prmtr gridSC=64 64 64" for example in the "sclinac.dat" file. Note that if inserted before any real element this will have the same effect as if it was set in "track.dat" file. Note that if a larger number of nodes gives the same results as a smaller number of nodes you better keep the smaller grid for speed of calculation. Forth : Set the boundaries/sizes of the SC grid if needed. The default boundary in X and Y is the current element apetrure, in Z it is the period at the current frequency. In Some/Most cases these boundaries are too big compared to the actual beam sizes. Since we are using a fixed number of SC grid nodes we could have a much smaller number of nodes in the beam region resulting in a crude SC calculation. So to avoid this problem and have a better accuracy for the SC calculation we added the possibility of adjusting the boundaries of the SC grid around the beam. This is done using the actual RMS beam sizes. Two parameters "xylhSC" and "zlhSC" could be used in the "sclinac.dat" file to limit the SC grid to "xylhSC*Xrms" in X, "xylhSC*Yrms" in Y and "zlhSC*Z-rms" in Z (phase). The default value for "xylhSC" and "zlhSC" is 1000, but if the real limits are smaller they will be used instead to not exceed the element aperture or the beam period. For example: "1 prmtr xylhSC=10." --> Xlim = Ylim = 10*sqrt(Xrms**2+Yrms**2) "1 prmtr zlhSC=10." --> Zlim = 10*Zrms We use sqrt(Xrms**2+Yrms**2) for X and Y to keep the SC grid axially symmetric. The values of "xylhSC" and "zlhSC" should be adjusted based on the warnings on the screen and in the "sc_warn.out" file and on how the results are affected. That's all I think