Page 1 of 1

About R56 in Elegant and LiTrack

Posted: 27 Mar 2024, 03:54
by Zhenbiao
Hi,

The structure of our superconducting linear accelerator is Inj+LH+L1+BC1+L2+BC2+L3. Inj is an injector; LH is a laser heater; L1, L2 and L3 are acceleration sections; BC1 and BC2 are compression sections. I optimized the longitudinal operating points of the linear accelerator using Litrack, including the cavity voltage and phase for each acceleration section, as well as the R56 for the compression sections.

My question is how to set different r56 values for different compression sections in Elegant. Are the definitions of r56 the same in Elegant and Litrack?

Many thanks for any suggestion,
Zhenbiao.

Re: About R56 in Elegant and LiTrack

Posted: 29 Mar 2024, 17:31
by michael_borland
Zhenbiao,

I've never used LiTrack, but I think the sign convention for R56 is the opposite of elegant's.

Usually in elegant we define the bunch compressors explicitly using bending magnets. However, it is possible to use the EMATRIX element to simulate a matrix defined by the matrix elements.

An example is attached.

--Michael

Re: About R56 in Elegant and LiTrack

Posted: 18 Apr 2024, 03:03
by Zhenbiao
Hi Michael:

I used 4 CSRCSBEN elements to define a bunch compressor, and varying the angel of the CSRCSBEN elements to match R56. I obtained different current profiles when turning on and off the CSR effect. When the CSR effect is turned off, I obtained the desired current profile. When the CSR effect is turned on, there is a spike in the current profile at the tail end. Is this caused by the CSR effect or an error in my code? If it's caused by the CSR effect, how can I eliminate the spike at the tail end and make the current profile more uniform?

Code: Select all

!====== BC1 ================
 !--- QUAD
% 0.10 sto LqBC1
 Q01BC1 : QUAD,L="LqBC1 2 /",K1=-1.230713E+00
 Q02BC1 : QUAD,L="LqBC1 2 /",K1= 2.267047E+00
 QC11BC1: QUAD,L="LqBC1 2 /",K1=0
 QS13BC1: QUAD,L="LqBC1 2 /",K1=0
 QC12BC1: QUAD,L="LqBC1 2 /",K1=0
 !--- BEND
%8.82123228E-02 sto AngBC1
% 0.2 sto LBBC1                        ! bend length
% 3.8 sto LBB1BC1                      ! 1st to 2nd bend length
% 1.8 sto LBB2BC1                      ! 2st to 3nd bend length
 BCX11 : CSRCSBEN,L="LBBC1 AngBC1 * AngBC1 sin /", &
  ANGLE="AngBC1", &
  EDGE1_EFFECTS=1,E1=0.000000000E+00, &
  EDGE2_EFFECTS=1,E2="AngBC1", &
  HGAP= 2.164000000E-02,FINT=3.893000000E-01, &
  SG_HALFWIDTH=2,SG_ORDER=1,STEADY_STATE=0,BINS=200, &
  N_KICKS=20,INTEGRATION_ORDER=4,ISR=1,CSR=1
 BCX12 : CSRCSBEN,L="LBBC1 AngBC1 * AngBC1 sin /", &
  ANGLE="0 AngBC1 -", &
  EDGE1_EFFECTS=1,E1="0 AngBC1 -", &
  EDGE2_EFFECTS=1,E2=0.0, &
  HGAP= 2.164000000E-02,FINT=3.893000000E-01, &
  SG_HALFWIDTH=2,SG_ORDER=1,STEADY_STATE=0,BINS=200, &
  N_KICKS=20,INTEGRATION_ORDER=4,ISR=1,CSR=1
 BCX13 : CSRCSBEN,L="LBBC1 AngBC1 * AngBC1 sin /", &
  ANGLE="0 AngBC1 -", &
  EDGE1_EFFECTS=1,E1=0.0, &
  EDGE2_EFFECTS=1,E2="0 AngBC1 -", &
  HGAP= 2.164000000E-02,FINT=3.893000000E-01, &
  SG_HALFWIDTH=2,SG_ORDER=1,STEADY_STATE=0,BINS=200, &
  N_KICKS=20,INTEGRATION_ORDER=4,ISR=1,CSR=1
 BCX14 : CSRCSBEN,L= "LBBC1 AngBC1 * AngBC1 sin /", &
  ANGLE="AngBC1", &
  EDGE1_EFFECTS=1,E1="AngBC1", &
  EDGE2_EFFECTS=1,E2=0.0, &
  HGAP= 2.164000000E-02,FINT=3.893000000E-01, &
  SG_HALFWIDTH=2,SG_ORDER=1,STEADY_STATE=0,BINS=200, &
  N_KICKS=20,INTEGRATION_ORDER=4,ISR=1,CSR=1
 !--- DRIFT
 D01BC1  : DRIF,L=0.9
 D02BC1  : DRIF,L=0.4
 DBB1BC1 : CSRDRIF,L="LBB1BC1 AngBC1 cos /",USE_STUPAKOV=1,N_KICKS= 30,CSR=1
 DBB2BC1 : CSRDRIF,L="LBB2BC1",USE_STUPAKOV=1,N_KICKS= 15,CSR=1
 DBB3BC1 : CSRDRIF,L="LBB1BC1 AngBC1 cos /",USE_STUPAKOV=1,N_KICKS= 30,CSR=1
 D03BC1  : CSRDRIF,L=2.0,USE_STUPAKOV=1,N_KICKS= 16,CSR=1
 !--- MARKER
 BEGBC1 : MARK 
 ENDBC1 : MARK
 MK01BC1: MARK 
 MK02BC1: MARK
 MK03BC1: MARK 
 MK04BC1: MARK
 !--- beamline
 BL_BC1 : LINE=(BEGBC1,&
        Q01BC1,Q01BC1,D01BC1,Q02BC1,Q02BC1,D02BC1,&
        MK01BC1,BCX11,DBB1BC1,BCX12,DBB2BC1,&
        MK02BC1,BCX13,DBB3BC1,MK03BC1,BCX14,MK04BC1,&
        D03BC1,ENDBC1)
Best Regards!
Zhenbiao Sun