300 likes | 410 Views
PTC Variables and (some) Maps. Piotr Skowroński. Variables. There are 2 sets of variables depending on TIME flag TIME=false TIME=true To switch the time flag use the following in MADX script ptc_setswitch , time=true;. General Hamiltonian.
E N D
PTCVariables and (some) Maps Piotr Skowroński MADX Meeting
Variables MADX Meeting There are 2 sets of variables depending on TIME flag TIME=false TIME=true To switch the time flag use the following in MADX script ptc_setswitch, time=true;
General Hamiltonian MADX Meeting Integration of straight elements (rectangular bend, quad) uses Cartesian coordinates. It is not done along arc.
SYMPLECTIC INTEGRATOR MADX Meeting 3 Integration algorithms • method 2: the naïve 2nd order method, 1 kick per integration step • method 4: the Ruth-Neri-Yoshida 4th order method, 3 kicks / step • method 6: the Yoshida 6th order method, 7 kicks / step • Controlled with: ptc_create_layout, method=XX; PTC has a hook so user defined algorithm can be hooked in • Each element can be integrated with different algorithm Magnets are split into smaller slices • Number of slices (integration steps) is controlled with ptc_twiss, nst=NN; ptc_normal, nst=NN; Automatic “resplit” sets method (and adjusts also nst), • method 2 for drifts (1 step) • method 6 for quads and strong bends • Method 4 for weak bends
Integration models MADX Meeting In practice, this integration is applying special maps at different positions Transport between the kicks can be done • As in drift: model 1 = DRIFT-KICK-DRIFT • Via matrix: model 2 = MATRIX-KICK-MATRIX • Like in SixTrack: model 3 = KICK-SIXTRACK-KICK Controlled with: ptc_create_layout, model=NN;
Hamiltonians • Different Hamiltonians • Expanded • Exact • Each has different flavors • different “splittings” • different reference frames • Depending on the user requirements • Precision • Price of computation time, of course • Which flavor is preferred • Controlled with: ptc_create_layout, exact=T/F; MADX Meeting
PTC Settings MADX Meeting Want to be safe, always use ptc_create_layout, exact=true, model=2, method=6, resplit, xbend; • It will • Take exact hamiltonians, • Use matrix in between kicks • Use 6th order Yoshida method • Automatically adjusts methods and number of steps for each element Default is ptc_create_layout, exact=false, model=1, method=2;
Quadrupole MADX Meeting
SBEND & default RBEND MADX Meeting Curved reference frame
RBEND, ptcrbend=true; MADX Meeting Straight reference frame
STREX Model=1 Model=2 MADX Meeting Quad in model=1 & RBEND, ptcrbend=true; Hamiltonian: Docu: CERN-SL-2012-044, Section K.4.12 Implemented in Sh_def_kind.h: INTEP_STREX (example method 2) • Case DKD (model1): DRIFT(L/2); KICKEX(L); DRIFT(L/2); • Case MKM (model2): SPAR(L/2); KICKEX(L); SPAR(L/2);
STREX MADX Meeting Kick: KICKEX BYW=bNMUL BXW=aNMUL DO J=NMUL-1,1,-1 BYWT=x*BYW-y*BXW+bJ BXW=y*BYW+x*BXW+aJ BYW=BYWT ENDDO px=px-l*BYW py=py+l*BXW if(model1) px=px+l*b1
STREX MADX Meeting Drift (model=1): DRIFT TIME=false TIME=true
STREX MADX Meeting Matrix (model=2): SPAR TIME=false time=true
TEAPOT Model=1 Model=2 MADX Meeting RBEND, SBEND in all models Hamiltonian: Docu: CERN-SL-2012-044, Section K.4.9 Implemented in Sh_def_kind.h: INTEP_TEAPOT Field strengths needs to renormalized to always provide the requested bending angle
TEAPOT px=px-l*BY py=py+l*BX MADX Meeting Kick: SKICK m=NMULIPOLES-1 do a=m,1,-1 do j=m-a,1,-1 i=i+1 BTX= (BTX+BF_X(i))*Y BTY= (BTY+BF_Y(i))*Y enddo i=i+1 BTX= (BTX+EL%BF_X(i)) BTY= (BTY+EL%BF_Y(i)) BX= (BX+BTX)*X BY= (BY+BTY)*X enddo BTX=0; BTY=0 do j=m,1,-1 i=i+1 BTX= (BTX+EL%BF_X(i))*Y BTY= (BTY+EL%BF_Y(i))*Y enddo i=i+1 BX= BX+BTX+BF_X(i) BY= BY+BTY+BF_Y(i)
TEAPOT MADX Meeting Drift (model=1): SPROT TIME=false
TEAPOT MADX Meeting Matrix (model=2): SSEC TIME=false
TKTF PUSHTKT7(L/2);KICKPATH(L/2);KICKTKT7(L);KICKPATH(L/2);PUSHTKT7(L/2) MADX Meeting Quad in model=2 Hamiltonian: Docu: CERN-SL-2012-044, Section K.4.7 Implemented in Sh_def_kind.h: INTEP_TKTF
TKTF MADX Meeting Matrix: PUSHTKT7(matrix defined in GETMAT7)
TKTF MADX Meeting KICKPATH TIME=false TIME=true
TKTF MADX Meeting Kick: KICKTKT7 BYW=bNMUL BXW=aNMUL DO J=NMUL-1,1,-1 BYWT = x*BYW - y*BXW + bJ BXW = y*BYW + x*BXW + aJ BYWc = BYWT ENDDO px = px - l*(BYW - b1_0 - b2*x) py = py + l*(BXW - b2*y)
Quad and Multipole Fringe In hard edge quad model Sx, Cx,…, are the sin-like and cos-like solutions MADX Meeting Hard edge fringe fields effects exact in (1 + s) and consistent with maxwell's equations for rectilinear magnets • Forest et.al, NIM in Physics Research A269 (1988) 474-482 It uses Lee-Whiting Formula • G.E. Lee-Whiting, Nucl. Instr. and Meth. 83 (1970) 232 Implemented in Sh_def_kind.f90 multipole_fringep
Summary MADX Meeting DKD2 handles only the expanded Hamiltonian elements. The exact integration are handled by types STREX, TEAPOT, KTK, and TKTF. STREX handles straight elements of all types. TEAPOT handles bends of “cyclotronic” symmetry, i.e., mostly invariant along the ideal trajectory TKTF and KTK handle straight elements without any ideal bending using a different split from STREX, namely the kick-matrix splits. CAV4 is cavity Hamiltonians can be found in CERN-SL-2012-044 Section K.4 The code is in Sh_def_kind.f90, usually called INTEP_X, where X is STREX, KTK, CAV4, etc.
Quad and Multipole FringeLee-Whitting coefficients MADX Meeting
Quad and Multipole FringeLee-Whitting coefficients MADX Meeting
Quad and Multipole Fringe MADX Meeting Hard edge fringe fields effects exact in (1 + s) and consistent with maxwell's equations for rectilinear magnets • Forest et.al, NIM in Physics Research A269 (1988) 474-482 It uses Lee-Whiting Formula • G.E. Lee-Whiting, Nucl. Instr. and Meth. 83 (1970) 232
Quad and Multipole Fringe MADX Meeting Hard edge fringe fields effects exact in (1 + s) and consistent with maxwell's equations for rectilinear magnets • Forest et.al, NIM in Physics Research A269 (1988) 474-482 It uses Lee-Whiting Formula • G.E. Lee-Whiting, Nucl. Instr. and Meth. 83 (1970) 232
Quad and Multipole Fringe MADX Meeting Implemented in Sh_def_kind.f90 multipole_fringep DEL=1/(1+delta) A=1-FX_X*DEL B= -FY_X*DEL D=1-FY_Y*DEL C= -FX_Y*DEL x=x-FX*DEL X2=(D*px-B*py)/(A*D-B*C) py=(A*py-C*px)/(A*D-B*C) px=X2 y=y-FY*DEL if(k%TIME) then ct=ct-(1/beta0+pt)*(px*FX+py*FY)*DEL**3 else s=s-(px*FX+py*FY)*DEL**2 endif