...  ...  @@ 38,20 +38,28 @@ y [mm] is the displacement from the center of the beam bunch; + 


y’ [mrad] is the beam divergence;



* *longitudinal plane:* +



z [mm] is the displacement from the center of the beam bunch; +



latexmath:[$\Delta$]p/p [mrad] is the difference between the particle’s



latexmath:[\Delta]p/p [mrad] is the difference between the particle’s



longitudinal momentum and the reference momentum of the beam bunch.






For input and output, however, z and latexmath:[$\Delta$]p/p are



replaced by latexmath:[$\Delta\phi$] [degree] and latexmath:[$\Delta$]W



For input and output, however, z and latexmath:[\Delta]p/p are



replaced by latexmath:[\Delta\phi] [degree] and latexmath:[\Delta]W



[keV], respectively the displacement in phase and energy. The



relationships between these longitudinal coordinates are:






latexmath:[\[z = \frac{\beta\lambda}{360}\Delta\phi\]]



[latexmath]



++++



z = \frac{\beta\lambda}{360}\Delta\phi



++++






and



latexmath:[\[\frac{\Delta p}{p} = \frac{\gamma}{\gamma +1}\frac{\Delta W}{W}\]]



where latexmath:[$\beta$] and latexmath:[$\gamma$] are the relativist



parameters, latexmath:[$\lambda$] is the freespace wavelength of the RF






[latexmath]



++++



\frac{\Delta p}{p} = \frac{\gamma}{\gamma +1}\frac{\Delta W}{W}



++++






where latexmath:[\beta] and latexmath:[\gamma] are the relativist



parameters, latexmath:[\lambda] is the freespace wavelength of the RF



and W is the kinetic energy [MeV] at the beam center. This internal



conversion can be displayed using the _command W_ (see [Trace_man] page



42).

...  ...  @@ 63,29 +71,29 @@ TRACE 3D Input beam 


In TRACE 3D, the input beam is described by the following set of



parameters:






* *ER*: particle rest mass [MeV/];



* *ER*: particle rest mass [MeV/c^{2}];



* *Q*: charge state (+1 for protons);



* *W*: beam kinetic energy [MeV]



* *XI*: beam current [mA]



* *BEAMI*: array with initial Twiss parameters in the three phase planes



+



BEAMI =



latexmath:[$\alpha_x , \beta_x, \alpha_y, \beta_y, \alpha_{\phi}, \beta_{\phi} $] +



latexmath:[\alpha_x , \beta_x, \alpha_y, \beta_y, \alpha_{\phi}, \beta_{\phi} ] +



+



The alphas are dimensionless, latexmath:[$\beta_x$] and



latexmath:[$\beta_y$] are expressed in m/rad (or mm/mrad) and



latexmath:[$\beta_{\phi}$] in deg/keV;



The alphas are dimensionless, latexmath:[\beta_x] and



latexmath:[\beta_y] are expressed in m/rad (or mm/mrad) and



latexmath:[\beta_{\phi}] in deg/keV;



* *EMITI*: initial total and unnormalized emittances in xx’, yy’, and



latexmath:[$\Delta\phi$]latexmath:[$\Delta W$] planes.



latexmath:[\Delta\phi]latexmath:[\Delta W] planes.



+



EMITI = latexmath:[$\epsilon_x , \epsilon_y, \epsilon_{\phi} $] +



EMITI = latexmath:[\epsilon_x , \epsilon_y, \epsilon_{\phi} ] +



+



The transversal emittances are expressed in latexmath:[$\pi$]mmmrad



and in latexmath:[$\pi$]degkeV the longitudinal emittance.



The transversal emittances are expressed in latexmath:[\pi]mmmrad



and in latexmath:[\pi]degkeV the longitudinal emittance.






In this beam dynamics code, the total emittance in each phase plane is



five times the RMS emittance in that plane and the displayed beam



envelopes are latexmath:[$\sqrt{5}$]times their respective RMS values.



envelopes are latexmath:[\sqrt{5}]times their respective RMS values.






[[ssec:T3D_graphic]]



TRACE 3D Graphic Interface

...  ...  @@ 93,14 +101,8 @@ TRACE 3D Graphic Interface 





An example of TRACE 3D graphic interface is shown in Figure [trace].






image:figures/Benchmarks/Trace.png[TRACE 3D graphic interface where: (1)



input beam in transverse plane (above) and longitudinal plane (below);



(2) output beam in transverse plane (above) and longitudinal plane



(below); (3) summary of beam parameters such as input and output



emittances and desired value for matching function; (4) line lattice



with different elements and beam envelope. The color legend is: blue



line for horizontal plane, red line for vertical plane, green line for



longitudinal plane and yellow line for dispersion.]



.TRACE 3D graphic interface where: (1) input beam in transverse plane (above) and longitudinal plane (below); (2) output beam in transverse plane (above) and longitudinal plane (below); (3) summary of beam parameters such as input and output emittances and desired value for matching function; (4) line lattice with different elements and beam envelope. The color legend is: blue line for horizontal plane, red line for vertical plane, green line for longitudinal plane and yellow line for dispersion.



image:figures/Benchmarks/Trace.png[]






[[sec:TRAN]]



TRANSPORT

...  ...  @@ 127,17 +129,17 @@ standard units and internal coordinates in TRANSPORT are: 


* *horizontal plane:* +



x [cm] is the displacement of the arbitrary ray with respect to the



assumed central trajectory; +



latexmath:[$\theta$] [mrad] is the angle the ray makes with respect to



latexmath:[\theta] [mrad] is the angle the ray makes with respect to



the assumed central trajectory;



* *vertical plane:* +



y [cm] is the displacement of the arbitrary ray with respect to the



assumed central trajectory; +



latexmath:[$\phi$] [mrad] is the angle the ray makes with respect to the



latexmath:[\phi] [mrad] is the angle the ray makes with respect to the



assumed central trajectory;



* *longitudinal plane:* +



l [cm] is the path length difference between the arbitrary ray and the



central trajectory; +



latexmath:[$\delta$] [%] is the fractional momentum deviation of the ray



latexmath:[\delta] [%] is the fractional momentum deviation of the ray



from the assumed central trajectory.






Even if TRANSPORT supports this standard set of units [cm, mrad and %];

...  ...  @@ 152,19 +154,25 @@ The input beam is described in *card 1* in terms of the semiaxes of a 


sixdimensional erect ellipsoid beam. In terms of diagonal sigmamatrix



elements, the input beam in TRANSPORT is expressed by 7 parameters:






* latexmath:[$\sqrt{\sigma_{ii}}$] [cm] represents onehalf of the



* latexmath:[\sqrt{\sigma_{ii}}] [cm] represents onehalf of the



horizontal (i=1), vertical (i=3) and longitudinal extent (i=5);



* latexmath:[$\sqrt{\sigma_{ii}}$] [mrad] represents onehalf of the



* latexmath:[\sqrt{\sigma_{ii}}] [mrad] represents onehalf of the



horizontal (i=2), vertical (i=4) beam divergence;



* latexmath:[$\sqrt{\sigma_{66}}$] [%] represents onehalf of the



* latexmath:[\sqrt{\sigma_{66}}] [%] represents onehalf of the



momentum spread;



* p(0) is the momentum of the central trajectory [GeV/c].






If the input beam is tilted (Twiss alphas not zero), *card 12* must be



used, inserting the 15 correlations latexmath:[$r_{ij}$] parameters



used, inserting the 15 correlations latexmath:[r_{ij}] parameters



among the 6 beam components. The correlation parameters are defined as



following:



latexmath:[\[r_{ij}=\frac{\sigma_{ij}}{\sqrt{\sigma_{ii}gma_{jj}}}\]] As






[latexmath]



++++



r_{ij}=\frac{\sigma_{ij}}{\sqrt{\sigma_{ii}gma_{jj}}}



++++






As



explained before, with the *card 15*, it is possible to transform the



TRANSPORT standard units in TRACElike units. In this way, the TRACE 3D



sigmamatrix for the input beam, printed out by _command Z_, can be

...  ...  @@ 188,11 +196,8 @@ shell written in C++ and is providing GUI type tools, which makes it 


easier to design new beam lines. A screen shot of a modern GUI Transport



interface [Transport_GUI] is shown in Figure [TRANSPORT].






image:figures/Benchmarks/TRANSPORT.png[GUI TRANSPORT graphic interface



[Tran_ex]. The continuous lines describe the beam envelope in the



vertical plane (above) and horizontal plane (below). The dashed line



displays the dispersion. The elements in the beam line are drawn as blue



and red rectangles]



.GUI TRANSPORT graphic interface [Tran_ex]. The continuous lines describe the beam envelope in the vertical plane (above) and horizontal plane (below). The dashed line displays the dispersion. The elements in the beam line are drawn as blue and red rectangles



image:figures/Benchmarks/TRANSPORT.png[]






[[sec:T3D_TRAN]]



Comparison TRACE 3D and TRANSPORT

...  ...  @@ 239,14 +244,14 @@ EMITI = 0.730, 0.730, 7.56 


Thanks to the TRACE 3D graphic interface, the input beam can immediately



be visualized in the three phase plane as shown in Figure [Input_TRACE].






image:figures/Benchmarks/Input_Trace.png[TRACE 3D input beam in the



transversal plane (above) and in the longitudinal plane (below)]



.TRACE 3D input beam in the transversal plane (above) and in the longitudinal plane (below)



image:figures/Benchmarks/Input_Trace.png[]






The corresponding sigmamatrix with the relative units is displayed by



command Z:






image:figures/Benchmarks/TRACE_z_input.png[TRACE 3D sigmamatrix for the



input beam]



.TRACE 3D sigmamatrix for the beam



image:figures/Benchmarks/TRACE_z_input.png[]






Before entering the TRACE 3D sigmamatrix coefficients in TRANSPORT, a



changing in the units is required using the *card 15* in the following

...  ...  @@ 278,14 +283,13 @@ SBEND in TRACE 3D 





The bending magnet definition in TRACE 3D requires:






.Bending magnet description in TRACE 3D and values used in the



simulation



.Bending magnet description in TRACE 3D and values used in the simulation



[cols="<,<,<",options="header",]



=======================================================================



Parameter Value Description



NT 8 Type code for bending



latexmath:[$\alpha$] [deg] 30 angle of bend in horizontal plane



latexmath:[$\rho$] [mm] 250 radius of curvature of central trajectory



latexmath:[\alpha] [deg] 30 angle of bend in horizontal plane



latexmath:[\rho] [mm] 250 radius of curvature of central trajectory



n 0 fieldindex gradient



vf 0 flag for vertical bending



=======================================================================

...  ...  @@ 301,22 +305,19 @@ entrance edge angle: 


=======================================================================



Parameter Value Description



NT 9 Type code for edge



latexmath:[$\beta$] [deg] 10 poleface rotation



latexmath:[$\rho$] [mm] 250 radius of curvature of central trajectory



latexmath:[\beta] [deg] 10 poleface rotation



latexmath:[\rho] [mm] 250 radius of curvature of central trajectory



g [mm] 20 total gap of magnet



latexmath:[$K_1$] 0.36945 fringefield factor



latexmath:[$K_2$] 0.36945 fringefield factor



latexmath:[K_1] 0.36945 fringefield factor



latexmath:[K_2] 0.36945 fringefield factor



=======================================================================






A same configuration has been used for exit edge angle using



latexmath:[$\beta = {5}{^{\circ}}$]. The beam envelopes in the three



latexmath:[\beta = {5}{^{\circ}}]. The beam envelopes in the three



phase planes for this simulation are shown in Figure [Trace_env].






image:figures/Benchmarks/Trace_SBEND_edge.png[Beam envelopes in TRACE 3D



for a SBEND with entrance and exit edge angles. The blue line describes



the beam envelope in the horizontal plane, the red line in the vertical



plane, the green line in the longitudinal plane. The yellow line



displays the dispersion]



.Beam envelopes in TRACE 3D for a SBEND with entrance and exit edge angles. The blue line describes the beam envelope in the horizontal plane, the red line in the vertical plane, the green line in the longitudinal plane. The yellow line displays the dispersion



image:figures/Benchmarks/Trace_SBEND_edge.png[]






[[sbendintransport]]



SBEND in TRANSPORT

...  ...  @@ 324,14 +325,13 @@ SBEND in TRANSPORT 





The bending magnet definition in TRANSPORT requires:






.Bending magnet description in TRANSPORT and values used in the



simulation



.Bending magnet description in TRANSPORT and values used in the simulation



[cols="<,<,<",options="header",]



=====================================================



Parameter Value Description



Card 4 Type code for bending



L [m] 30 Effective length of the central trajectory



latexmath:[$B_0$] [kG] 250 Central field strength



latexmath:[B_0] [kG] 250 Central field strength



n 0 fieldindex gradient



=====================================================




...  ...  @@ 340,27 +340,24 @@ parameters. In TRANSPORT, however, the fringe field is not automatically 


included with the edge angle, but it is described by a own card as



reported in the Table [Edge_Trans].






.Edge angle and fringe field description in TRANSPORT and values used in



the simulation



.Edge angle and fringe field description in TRANSPORT and values used in the simulation



[cols="<,<,<",options="header",]



=================================================



Parameter Value Description



Card 2 Type code for edge



latexmath:[$\beta$] [deg] 10 poleface rotation



latexmath:[\beta] [deg] 10 poleface rotation



Card 16 Type code for fringe field



g [mm] 10 halfgap of magnet



latexmath:[$K_1$] 0.36945 fringefield factor



latexmath:[$K_2$] 0.36945 fringefield factor



latexmath:[K_1] 0.36945 fringefield factor



latexmath:[K_2] 0.36945 fringefield factor



=================================================






Running the Graphic TRANSPORT version, the beam envelopes in the



transverse phase planes for this simulation are shown in



Figure [Tran_env].






image:figures/Benchmarks/TRANS_SBEND_edge.png[Beam envelopes in



TRANSPORT for a SBEND with entrance and exit edge angles. The continuous



lines describe the beam envelope in the vertical plane (above) and



horizontal plane (below). The dashed line displays the dispersion.]



.Beam envelopes in TRANSPORT for a SBEND with entrance and exit edge angles. The continuous lines describe the beam envelope in the vertical plane (above) and horizontal plane (below). The dashed line displays the dispersion.



image:figures/Benchmarks/TRANS_SBEND_edge.png[]






[[beamsizeandemittancecomparison]]



Beam size and emittance comparison

...  ...  @@ 370,12 +367,11 @@ In the next table, the results of the comparison between TRACE 3D and 


TRANSPORT in terms of the transversal beam sizes at the end of each



element in the line are summarized.






.Transversal beam size at the end of each element in the line printed



out by TRACE 3D and TRANSPORT



.Transversal beam size at the end of each element in the line printed out by TRACE 3D and TRANSPORT



[cols="<,<,<,<,<,<",]



=======================================================================



Position z (m) latexmath:[$\sigma_x$] (mm) latexmath:[$\sigma_y$]



(mm) latexmath:[$\sigma_x$] (mm) latexmath:[$\sigma_y$] (mm)



Position z (m) latexmath:[\sigma_x] (mm) latexmath:[\sigma_y]



(mm) latexmath:[\sigma_x] (mm) latexmath:[\sigma_y] (mm)






Input 0.000 1.709 1.709 1.709 1.709




...  ...  @@ 393,23 +389,22 @@ out by TRACE 3D and TRANSPORT 


The perfect agreement between these two codes arises immediately looking



at Figure [T3D_Tra_env].






image:figures/Benchmarks/T3D_Tra_SBEND_edge_env.png[Transversal beam



size comparison between TRACE 3D and TRANSPORT]



.Transversal beam size comparison between TRACE 3D and TRANSPORT



image:figures/Benchmarks/T3D_Tra_SBEND_edge_env.png[]






The same comparison has been performed in terms of horizontal and



longitudinal emittance, both expressed in latexmath:[$\pi$]mmmrad.



longitudinal emittance, both expressed in latexmath:[\pi]mmmrad.



While the vertical emittance remains constant and equal to the initial



value (latexmath:[$\epsilon_y = $] 0.730 latexmath:[$\pi$]mmmrad) ,



value (latexmath:[\epsilon_y = ] 0.730 latexmath:[\pi]mmmrad) ,



the horizontal and longitudinal emittances are expected growing after



the bending magnet. The results are reported in Table [Emittance] and in



Figure [T3D_Tra_emi].






.Horizontal and longitudinal emittance comparison between TRACE 3D and



TRANSPORT, both expressed in latexmath:[$\pi$]mmmrad



.Horizontal and longitudinal emittance comparison between TRACE 3D and TRANSPORT, both expressed in latexmath:[\pi]mmmrad



[cols="<,<,<,<,<,<",]



=======================================================================



Position z (m) latexmath:[$\epsilon_x$] latexmath:[$\epsilon_z$]



latexmath:[$\epsilon_x$] latexmath:[$\epsilon_z$]



Position z (m) latexmath:[\epsilon_x] latexmath:[\epsilon_z]



latexmath:[\epsilon_x] latexmath:[\epsilon_z]






Input 0 0.730 0.08 0.730 0.08




...  ...  @@ 424,8 +419,8 @@ TRANSPORT, both expressed in latexmath:[$\pi$]mmmrad 


Drift 2 0.631 0.973 0.65 0.973 0.65



=======================================================================






image:figures/Benchmarks/T3D_Tra_SBEND_edge_emi.png[Emittance comparison



between TRACE and TRANSPORT]



.Emittance comparison between TRACE and TRANSPORT



image:figures/Benchmarks/T3D_Tra_SBEND_edge_emi.png[]






[[ssec:T3DtoTRAN]]



From TRACE 3D to TRANSPORT

...  ...  @@ 446,12 +441,12 @@ From TRACE 3D to TRANSPORT 


*Vertical gap* 9 16.5



Gap Total [mm] Halfgap [cm]



*Fringe field card* 9 16.7 / 16.8



latexmath:[$K_1$] Default: 0.45 Default: 0.5



latexmath:[$K_2$] Default: 2.8 Default: 0



latexmath:[K_1] Default: 0.45 Default: 0.5



latexmath:[K_2] Default: 2.8 Default: 0



*Bend direction* Bend angle sign Coord. rotation



Horiz. right Angle latexmath:[$>$] 0 Angle latexmath:[$>$] 0



Horiz. left Angle latexmath:[$<$] 0 Card 20



Vertical bend Card 8, vf latexmath:[$>$] 0 Card 20



Horiz. right Angle latexmath:[>] 0 Angle latexmath:[>] 0



Horiz. left Angle latexmath:[<] 0 Card 20



Vertical bend Card 8, vf latexmath:[>] 0 Card 20



==============================================================






[[sec:OPAL]]

...  ...  @@ 464,14 +459,13 @@ TRANSPORT. The three codes support different units and require diverse 


parameters for the input beam. A summary of their main features is



reported in Table [Features].






.Main features of the three beam dynamics codes: TRACE 3D, TRANSPORT and



__OPAL__



.Main features of the three beam dynamics codes: TRACE 3D, TRANSPORT and __OPAL__



[cols="<,<,<,<",options="header",]



====================================================================



Code TRACE 3D TRANSPORT _OPAL_



*Type* Envelope Envelope Time integration



*Input* Twiss, Emittance Sigma, Momentum Sigma, Energy



*Units* mmmrad, degkeV cmrad, cm% mlatexmath:[$\beta\gamma$]



*Units* mmmrad, degkeV cmrad, cm% mlatexmath:[\beta\gamma]



====================================================================






[[ssec:OPAL_units]]

...  ...  @@ 484,14 +478,14 @@ three phase planes: 


* *horizontal plane:* +



X [m] horizontal position of a particle relative to the axis of the



element; +



PX [latexmath:[$\beta_x\gamma$]] horizontal canonical momentum;



PX [latexmath:[\beta_x\gamma]] horizontal canonical momentum;



* *vertical plane:* +



Y [m] vertical position of a particle relative to the axis of the



element; +



PY [latexmath:[$\beta_y\gamma$]] horizontal canonical momentum;



PY [latexmath:[\beta_y\gamma]] horizontal canonical momentum;



* *longitudinal plane:* +



Z [m] longitudinal position of a particle in floorcoordinates; +



PZ [latexmath:[$\beta_z\gamma$]] longitudinal canonical momentum;



PZ [latexmath:[\beta_z\gamma]] longitudinal canonical momentum;






[[ssec:OPAL_input]]



_OPALt_ Input beam

...  ...  @@ 502,10 +496,10 @@ transferring the TRANSPORT (or TRACE 3D) input beam in terms of 


sigmamatrix coefficients, it necessary to:






* adjust the units: from mm to m;



* correct for the factor latexmath:[$\sqrt{5}$]: from total to RMS



* correct for the factor latexmath:[\sqrt{5}]: from total to RMS



distribution;



* multiply for the relativistic factor



latexmath:[$\beta\gamma ={0.1224}$] for 7MeV protons;



latexmath:[\beta\gamma ={0.1224}] for 7 MeV protons;






In case of the modified sigmamatrix in Figure [TRACE_z_Input], the



corresponding _OPAL_ parameters for the `GAUSS` distributions are:

...  ...  @@ 538,7 +532,7 @@ Comparison TRACE 3D and _OPALt_ 


In this section, the comparison between TRACE 3D and _OPALt_ is



discussed starting from `SBEND` definition in _OPALt_. The transport



line described in Section [T3D_TRAN] has been simulated in _OPAL_ using



10.000 particles and latexmath:[$10^{11}$] s time step. The bending



10.000 particles and latexmath:[10^{11}] s time step. The bending



magnet features of Table [Bend_Trace,Edge_Trace] have been transformed



in _OPAL_ language as:




...  ...  @@ 561,10 +555,9 @@ K1=0.0, 


E1=0, E2=0,



....



+



image:figures/Benchmarks/SBEND_noEdge_Env.png[TRACE 13D and _OPAL_



comparison: SBEND without edge angles,title="fig:"]



image:figures/Benchmarks/SBEND_noEdge_Emi.png[TRACE 13D and _OPAL_



comparison: SBEND without edge angles,title="fig:"]



.TRACE 3D and _OPAL_ comparison: SBEND without edge angles,



image:figures/Benchmarks/SBEND_noEdge_Env.png[width=370]



image:figures/Benchmarks/SBEND_noEdge_Emi.png[width=370]



+



A good overall agreement has been found between the two codes in term of



beam size and emittance. The different behavior inside the bending

...  ...  @@ 578,10 +571,9 @@ K1=0.0, 


E1=10*Pi/180.0, E2=5* Pi/180.0,



....



+



image:figures/Benchmarks/SBEND_Edges_Env.png[TRACE 3D and _OPAL_



comparison: SBEND with edge angles,title="fig:"]



image:figures/Benchmarks/SBEND_Edges_Emi.png[TRACE 3D and _OPAL_



comparison: SBEND with edge angles,title="fig:"]



.TRACE 3D and _OPAL_ comparison: SBEND with edge angles



image:figures/Benchmarks/SBEND_Edges_Env.png[width=370]



image:figures/Benchmarks/SBEND_Edges_Emi.png[width=370]



+



Even in this case, a good overall agreement has been found between the



two codes in term of beam size and emittance.

...  ...  @@ 589,20 +581,27 @@ two codes in term of beam size and emittance. 


+



The field index parameter K1 is defined as:



+



latexmath:[\[K1 = \frac{1}{B\rho}\frac{\partial B_y}{\partial x},\]]



[latexmath]



++++



K1 = \frac{1}{B\rho}\frac{\partial B_y}{\partial x},



++++



+



Section [RBend]. Instead, in TRACE 3D the field index parameter n is:



+



latexmath:[\[n = \frac{\rho}{B_y}\frac{\partial B_y}{\partial x}.\]]



[latexmath]



++++



n = \frac{\rho}{B_y}\frac{\partial B_y}{\partial x}.



++++



+



In order to have a significant focusing effect on both transverse



planes, the transport line has been simulated in TRACE 3D using



latexmath:[$n = 1.5$]. Since, a different definition exists between



latexmath:[n = 1.5]. Since, a different definition exists between



_OPAL_ and TRACE 3D on the field index, the nparameter translation in



_OPAL_ language has been done with the following tests:



** TEST 1: K1 latexmath:[$=$] n/latexmath:[$\rho^2$]



** TEST 2: K1 latexmath:[$=$] n



** TEST 3: K1 latexmath:[$=$] n/latexmath:[$\rho$]



+



** TEST 1: K1 latexmath:[=] n/latexmath:[\rho^2]



** TEST 2: K1 latexmath:[=] n



** TEST 3: K1 latexmath:[=] n/latexmath:[\rho]



+



Only the TEST 2 reports a reasonable behavior on the beam size and



emittance, as shown in Figure [SBEND_FI] using:

...  ...  @@ 613,10 +612,9 @@ K1=1.5 


E1=0, E2=0,



....



+



image:figures/Benchmarks/FI_SBEND_FMDef_Env_T2.png[TRACE 3D and _OPAL_



comparison: SBEND with field index and default field map,title="fig:"]



image:figures/Benchmarks/FI_SBEND_FMDef_Emi_T2.png[TRACE 3D and _OPAL_



comparison: SBEND with field index and default field map,title="fig:"]



.TRACE 3D and _OPAL_ comparison: SBEND with field index and default field map



image:figures/Benchmarks/FI_SBEND_FMDef_Env_T2.png[width=370]



image:figures/Benchmarks/FI_SBEND_FMDef_Emi_T2.png[width=370]



+



Concerning the emittances and vertical beam size, a perfect agreement



has been found, instead a defocusing effect appears in the horizontal

...  ...  @@ 626,10 +624,9 @@ shown in Figure [SBEND_FI_test], is achieved using a test field map in 


which the fringe field extension has been changed in the thin lens



approximation.



+



image:figures/Benchmarks/FI_SBEND_FMTest_Env_T2.png[TRACE 3D and _OPAL_



comparison: SBEND with field index and test field map,title="fig:"]



image:figures/Benchmarks/FI_SBEND_FMTest_Emit_T2.png[TRACE 3D and _OPAL_



comparison: SBEND with field index and test field map,title="fig:"]



.TRACE 3D and _OPAL_ comparison: SBEND with field index and test field map



image:figures/Benchmarks/FI_SBEND_FMTest_Env_T2.png[width=370]



image:figures/Benchmarks/FI_SBEND_FMTest_Emit_T2.png[width=370]






[[ssec:T3DtoOPAL]]



From TRACE 3D to _OPALt_

...  ...  @@ 651,12 +648,12 @@ From TRACE 3D to _OPALt_ 


*Vertical gap* 9 `SBEND` or `RBEND`



Gap Total [mm] Total [m]



*Fringe field card* 9 FIELD MAP



latexmath:[$K_1$] Default: 0.45 



latexmath:[$K_2$] Default: 2.8 



latexmath:[K_1] Default: 0.45 



latexmath:[K_2] Default: 2.8 



*Bend direction* Bend angle sign Coord. rotation



Horiz. right Angle latexmath:[$>$] 0 Angle latexmath:[$>$] 0



Horiz. left Angle latexmath:[$<$] 0 Angle latexmath:[$<$] 0



Vertical bend Card 8, vf latexmath:[$>$] 0 Coord. rotation



Horiz. right Angle latexmath:[>] 0 Angle latexmath:[>] 0



Horiz. left Angle latexmath:[<] 0 Angle latexmath:[<] 0



Vertical bend Card 8, vf latexmath:[>] 0 Coord. rotation



==============================================================






[[sec:conclusion]]

...  ...  @@ 703,7 +700,7 @@ dipole definition using the default map: 


Please refer to Section [1DProfile1] for the definition of the field map



and the default map `1DPROFILE1DEFAULT`. It defines a fringe field that



extends to 10 cm away from a dipole edge in both directions and it has



both latexmath:[$B_y$] and latexmath:[$B_z$] components. This makes the



both latexmath:[B_y] and latexmath:[B_z] components. This makes the



comparison between _OPAL_ and other codes which uses a hard edge dipole



by default,cumbersome because one needs to carefully integrate thought



the fringe field region in _OPAL_ in order to come up with the

...  ...  @@ 727,21 +724,20 @@ The proposed default map for a hard edge dipole can be: 





On the first line, the two zeros following `1DProfile1` are the orders



of the Enge coefficient for the entrance and exit edge of the dipole.



latexmath:[$2 cm$] is the default dipole gap width. The second line



latexmath:[2 cm] is the default dipole gap width. The second line



defines the fringe field region of the entrance edge of the dipole which



extends from latexmath:[$0.00000001 cm$] to



latexmath:[$0.00000001 cm$]. The third line defines the same fringe



field region for the exit edge of the dipole. The latexmath:[$3$]s on



extends from latexmath:[0.00000001 cm] to



latexmath:[0.00000001 cm]. The third line defines the same fringe



field region for the exit edge of the dipole. The latexmath:[3]s on



both line don’t mean anything, they are just placeholders. On the fourth



and fifth line, the zeroth order Enge coefficients for both edges are



given. Since they are large negative numbers, the field in the fringe



field region has no latexmath:[$B_z$] component and its



latexmath:[$B_y$] component is just like the field in the middle of the



field region has no latexmath:[B_z] component and its



latexmath:[B_y] component is just like the field in the middle of the



dipole.






image:figures/Benchmarks/reportcomparedefault.png[Compare emittances



and beam sizes obtained by using the hard edge map (_OPAL_), the default



map (_OPAL_), and the ELEGANT]



.Compare emittances and beam sizes obtained by using the hard edge map (_OPAL_), the default map (_OPAL_), and the ELEGANT



image:figures/Benchmarks/reportcomparedefault.png[]






Figure [plotcomparedefault] compares the emittances and beam sizes



obtained by using the hard edge map, the default map and the ELEGANT.

...  ...  @@ 762,11 +758,11 @@ outside the fringe field regions. In Figure [plotemitdt], one can 


observe a discontinuity in the horizontal emittance when the hard edge



map is used in the calculation. This discontinuity comes from the fact



that _OPAL_ emittance is calculated at an instant time. Once the beam or



part of the beam gets into the dipole, its latexmath:[$P_x$] gets a kick



part of the beam gets into the dipole, its latexmath:[P_x] gets a kick



which will result in a sudden emittance change.






image:figures/Benchmarks/reportemitdt.png[Horizontal and vertical



normalized emittances for different integration time steps]



.Horizontal and vertical normalized emittances for different integration time steps



image:figures/Benchmarks/reportemitdt.png[]






Figure [plotfringesize,plotfringesizezoom] examine the effects of



the fringe field range and the integration time step on the simulation

...  ...  @@ 775,11 +771,11 @@ Figure [plotfringesize]. We can conclude that the size of the 


integration time step has more influence on the accuracy of the



simulation.






image:figures/Benchmarks/reportfringesize.png[Normalized horizontal



emittance for different fringe field ranges and integration time steps]



.Normalized horizontal emittance for different fringe field ranges and integration time steps



image:figures/Benchmarks/reportfringesize.png[]






image:figures/Benchmarks/reportfringesizezoom.png[Zoom in on the



final emittance in Figure [plotfringesizezoom]]



.Zoom in on the final emittance in Figure [plotfringesizezoom]



image:figures/Benchmarks/reportfringesizezoom.png[]






[[dcsrcomparisonwithelegant]]



1D CSR comparison with ELEGANT

...  ...  @@ 815,17 +811,22 @@ The _OPAL_ dipoles all have fringe fields. When comparisons are done 


between _OPAL_ and ELEGANT [elegant] for example, one needs to



appropriately set the FINT attribute of the bending magnet in ELEGANT in



order to represent the field correctly. Although ELEGANT tracks in the



(latexmath:[$x, x', y, y', s, \delta$]) phase space, where



latexmath:[$\delta = \frac{\Delta p}{p_0}$] and latexmath:[$p_0$] is the



(latexmath:[x, x', y, y', s, \delta]) phase space, where



latexmath:[\delta = \frac{\Delta p}{p_0}] and latexmath:[p_0] is the



momentum of the reference particle, the watch point output beam



distributions from the ELEGANT are list in



(latexmath:[$x, x', y, y', t, \beta\gamma$]). If one wants to compare



(latexmath:[x, x', y, y', t, \beta\gamma]). If one wants to compare



ELEGANT watch point output distribution to _OPAL_, unit conversion needs



to be performed, i.e. latexmath:[\[\begin{aligned}



P_x &=& x'\beta\gamma, \\ P_y &=& y'\beta\gamma, \\ s &=& (\bar tt)\beta c .\end{aligned}\]]



to be performed, i.e.






[latexmath]



++++



\begin{aligned}



P_x &=& x'\beta\gamma, \\ P_y &=& y'\beta\gamma, \\ s &=& (\bar tt)\beta c .\end{aligned}



++++






To benchmark the CSR effect, we set up a simple beamline with 0.1m drift



latexmath:[$+$] 30 degree sbend latexmath:[$+$] 0.4m drift. When the CSR



latexmath:[+] 30 degree sbend latexmath:[+] 0.4m drift. When the CSR



effect is turn off, Figure [plotemitcsroff] shows that the normalized



emittances calculated using both _OPAL_ and ELEGANT agree. The emittance



values from _OPAL_ are obtained from the _.stat_ file, while for

...  ...  @@ 833,48 +834,48 @@ ELEGANT, the transverse emittances are obtained from the sigma output 


file (enx, and eny), the longitudinal emittance is calculated using the



watch point beam distribution output.






image:figures/Benchmarks/emitcsroff.png[Comparison of the trace space



using ELEGANT and __OPAL__]



.Comparison of the trace space using ELEGANT and __OPAL__



image:figures/Benchmarks/emitcsroff.png[]






When CSR calculations are enabled for both the bending magnet and the



following drift, Figure [plotdppcsron] shows the average



latexmath:[$\delta$] or latexmath:[$\frac{\Delta p}{p}$] change along



latexmath:[\delta] or latexmath:[\frac{\Delta p}{p}] change along



the beam line, and Figure [plotemitcsron] compares the normalized



transverse and longitudinal emittances obtained by these two codes. The



average latexmath:[$\frac{\Delta p}{p}$] can be found in the centroid



average latexmath:[\frac{\Delta p}{p}] can be found in the centroid



output file (Cdelta) from ELEGANT, while in _OPAL_, one can calculate it



using



latexmath:[$\frac{\Delta p}{p} = \frac{1}{\beta^2}\frac{\Delta \overline{E}}{\overline{E}+mc^2}$],



where latexmath:[$\Delta \overline{E}$] is the average kinetic energy



latexmath:[\frac{\Delta p}{p} = \frac{1}{\beta^2}\frac{\Delta \overline{E}}{\overline{E}+mc^2}],



where latexmath:[\Delta \overline{E}] is the average kinetic energy



from the _.stat_ output file.






image:figures/Benchmarks/dppcsron.png[latexmath:[$\frac{\Delta p}{p}$]



in Elegant and __OPAL__]



.latexmath:[\frac{\Delta p}{p}] in Elegant and __OPAL__



image:figures/Benchmarks/dppcsron.png[]






In the drift space following the bending magnet, the CSR effects are



calculated using Stupakov’s algorithm with the same setting in both



codes. The average fractional momentum change



latexmath:[$\frac{\Delta p}{p}$] and the longitudinal emittance show



latexmath:[\frac{\Delta p}{p}] and the longitudinal emittance show



good agreements between these codes. However, they produce different



horizontal emittances as indicated in Figure [plotemitcsron].






image:figures/Benchmarks/emitcsron.png[Transverse emittances in



ELEGANT and __OPAL__]



.Transverse emittances in ELEGANT and __OPAL__



image:figures/Benchmarks/emitcsron.png[]






One important effect to notice is that in the drift space following the



bending magnet, the normalized emittance



latexmath:[$\epsilon_x(x, P_x)$] output by _OPAL_ keeps increasing while



the tracelike emittance latexmath:[$\epsilon_x(x, x')$] calculated by



latexmath:[\epsilon_x(x, P_x)] output by _OPAL_ keeps increasing while



the tracelike emittance latexmath:[\epsilon_x(x, x')] calculated by



ELEGANT does not. This can be explained by the fact that with a



relatively large energy spread (about latexmath:[$3\%$] at the end of



relatively large energy spread (about latexmath:[3\%] at the end of



the dipole due to CSR), *an correlation* between transverse position and



energy can build up in a drift thereby induce emittance growth. However,



this effect can only be observed in the normalized emittance calculated



with



latexmath:[$\epsilon_x(x, P_x) = \sqrt{\langle x^2 \rangle \langle P_x^2\rangle  \langle xP_x \rangle^2}$]



where latexmath:[$P_x = \beta\gamma x'$], not the tracelike emittance



latexmath:[\epsilon_x(x, P_x) = \sqrt{\langle x^2 \rangle \langle P_x^2\rangle  \langle xP_x \rangle^2}]



where latexmath:[P_x = \beta\gamma x'], not the tracelike emittance



which is calculated as



latexmath:[$\epsilon_x(x, x') = \beta\gamma\sqrt{\langle x^2 \rangle \langle x'^2 \rangle  \langle xx' \rangle^2}$]



latexmath:[\epsilon_x(x, x') = \beta\gamma\sqrt{\langle x^2 \rangle \langle x'^2 \rangle  \langle xx' \rangle^2}]



[prstab2003]. In Figure [plotemitcsron], a tracelike horizontal



emittance is also calcualted for the _OPAL_ output beam distributions.



Like the ELEGANT result, this tracelike emittance doesn’t grow in the

...  ...  @@ 888,12 +889,12 @@ _OPAL_ & `Impactt` 


This benchmark compares rms quantities such as beam size and emittance



of _OPAL_ and `Impactt` [qiang2005, qiang20061, qiang20062]. A *cold*



10mA H+ bunch is expanding in a 1m drift space. A Gaussian distribution,



with a cut at 4 latexmath:[$\sigma$] is used. The charge is computed by



with a cut at 4 latexmath:[\sigma] is used. The charge is computed by



assuming a 1MHz structure i.e.



latexmath:[$Q_{\text{tot}}=\frac{I}{\nu_{\text{rf}}}$]. For the



simulation we use a grid with latexmath:[$16^{3}$] grid point and open



latexmath:[Q_{\text{tot}}=\frac{I}{\nu_{\text{rf}}}]. For the



simulation we use a grid with latexmath:[16^{3}] grid point and open



boundary condition. The number of macro particles is



latexmath:[$N_{\text{p}} = 10^{5}$].



latexmath:[N_{\text{p}} = 10^{5}].






[[opalinput]]



_OPAL_ Input

...  ...  @@ 1010,10 +1011,9 @@ A good agreement is shown in the 


Figure [plotopalimpact1,plotopalimpact2]. This proves to some extend



the compatibility of the space charge solvers of _OPAL_ and `Impactt`.






image:figures/Benchmarks/opalimpact1MHzx.png[Transverse beam sizes



and emittances in `Impactt` and __OPAL__,title="fig:"]



image:figures/Benchmarks/opalimpact1MHzy.png[Transverse beam sizes



and emittances in `Impactt` and __OPAL__,title="fig:"]



.Transverse beam sizes and emittances in `Impactt` and __OPAL__



image:figures/Benchmarks/opalimpact1MHzx.png[width=370]



image:figures/Benchmarks/opalimpact1MHzy.png[width=370]






image:figures/Benchmarks/opalimpact1MHzz.png[Longitudinal beam size



and emittance in `Impactt` and __OPAL__] 


.Longitudinal beam size and emittance in `Impactt` and __OPAL__



image:figures/Benchmarks/opalimpact1MHzz.png[] 