Subject | : SAD Update V1.0.10.3.2a TrackParticles with wake. |
Article No | : 720 |
Date | : 2009/07/12(Sun) 11:37:07 |
Contributor | : K. Oide |
Dear Users,
1. Particle tracking by TrackParticles now accepts wakes at CAVI elements. The wake functions, transverse and/or longitudinal are specified by the WAKE command as before. Parameters NBUNCH and PBUNCH work as expected as well as the flags TWAKE and LWAKE. Please see the example: below. If one needs to change intensity bunch by bunch, change the number of particles of the bunches, but the total charge is always given by NBUNCH * PBUNCH. As this involves a new code, it needs a period of trial.
(* Beam Parameters *) SIGZ=0.001; DP=0.01; NBUNCH=2; PBUNCH= 2E10; sb=SpeedOfLight/2855.9822616e6; NP=9*200; TWAKE LWAKE
SeedRandom[17];
Element["PHI","CA1*"]=-94*Degree;
(* Misalignment of Cavities *) dxc=2e-3; dyc=2e-3; cav=LINE["POSITION","CA*"]; (LINE["DX",#]=dxc*GaussRandom[])&/@cav (LINE["DY",#]=dyc*GaussRandom[])&/@cav
(* Input Beam with offsets dx0 & dy0 *) dx0= 2E-3; dy0= 2E-3; {ax0,bx0,ay0,by0}=Twiss[{"AX","BX","AY","BY"},"^^^"]; {ex0,ex1,ey0,ey1}=GaussRandom[4,NP]*Sqrt[{EMITX,EMITX,EMITY,EMITY}];
(* First Binch *) z1={Sqrt[bx0]*ex0+dx0, -ax0/Sqrt[bx0]*ex0+ex1/Sqrt[bx0], Sqrt[by0]*ey0+dy0, -ay0/Sqrt[by0]*ey0+ey1/Sqrt[by0], SIGZ*GaussRandom[NP], DP*GaussRandom[NP], Table[1,{NP}]}; (* Second Binch *) z2={Sqrt[bx0]*ex0+dx0, -ax0/Sqrt[bx0]*ex0+ex1/Sqrt[bx0], Sqrt[by0]*ey0+dy0, -ay0/Sqrt[by0]*ey0+ey1/Sqrt[by0], SIGZ*GaussRandom[NP]-sb, DP*GaussRandom[NP], Table[1,{NP}]}; (* Combine *) z=MapThread[Join,{z1,z2}];
z={1,z};
(*Tracking to the end *) zout=TrackParticles[z];
(* Graphics *) gx=ListPlot[Thread[zout[[2,{5,1}]]],GridLines->True,DisplayFunction->Identity, FrameLabel->{"z","x"}]; gy=ListPlot[Thread[zout[[2,{5,3}]]],GridLines->True,DisplayFunction->Identity, FrameLabel->{"z","y"}]; gz=ListPlot[Thread[zout[[2,{5,6}]]],GridLines->True,DisplayFunction->Identity, FrameLabel->{"z","`fd"}];
Show[{ Graphics[Rectangle[{-0.1,0.6},{0.4,1.1},gx]], Graphics[Rectangle[{0.5,0.6},{1,1.1},gy]], Graphics[Rectangle[{-0.1,-0.1},{0.4,0.4},gz]]}];Update[];
|