Commit 9d09e53a authored by Thomas Planche's avatar Thomas Planche

cleaned up example files, added links to the tutorial.

parent df0afbf6
......@@ -9,12 +9,9 @@ zgoubi HRS tuto: DIPOLE
0 ! not sure what this one does
noEspread.beam ! name of the input file
'DRIFT'
36.32357
'DIPOLE'
0 !output flag: 0: no outpot, 2: output trajectory to zgoubi.plt, etc.
130 120. !AT[deg.], RM[cm]
......@@ -38,7 +35,6 @@ noEspread.beam ! name of the input file
'DRIFT'
36.32357
'DIPOLE'
0 !output flag: 0: no outpot, 2: output trajectory to zgoubi.plt, etc.
130 120. !AT[deg.], RM[cm]
......
zgoubi HRS tuto: DIPOLE
'OBJET'
543.687 !60 keV U1+
6 !5: generate 11 particles used to calculate transfer matrix ('MATRIX')
0.00001 0.001 0.00001 0.001 .0 .0 !step size in Y; T; Z; P; S; D
0.0 0. 0. 0. 0. 1.
'DRIFT'
36.32357
'DIPOLE'
0 !output flag: 0: no outpot, 2: output trajectory to zgoubi.plt, etc.
130 120. !AT[deg.], RM[cm]
65 4.5307259 0. 0. 0. !ACENT[deg.];B0[kG]; N; B; GX
7.0 0. !ENTRANCE FIELD BOUNDARY: fringe field extend[cm]; unused
4 0. 1.8 0. 0. 0. 0. 0. !unused; C0...C5; shift
45. 26.5 220.0 0.0 0.0 220.0 !W+[deg.]; edge angle[deg.]; R1[cm]; U1; U2; R2[cm]
7.0 0. !EXIT FIELD BOUNDARY: lambda; =-1 for Enge like
4 0. 1.8 0. 0. 0. 0. 0. !unused; C0...C5; shift
-45. -26.5 -220.0 0. 0. -220.0 0. !W-; edge angle; R1; U1; U2; R2
0. 0. !FACE 3: (Not used here)
0 0. 0. 0. 0. 0. 0. 0.
0. 0. 0. 0. 0. 0. 0.
2 4. !IRD(=2, 25 or 4)
0.5 !Integration step size[cm]
2 127.96721 -0.349067 127.96721 0.349067 !KPOS RE[cm]; TE[rad]; RS[cm]; TS[rad]
'DRIFT'
36.32357
'MATRIX'
2 0
'FIT'
6 !Number of physical parameters to be varied
3 5 0. 0.2 !element #3 (DIPOLE); vary parameter #5 (BO); coupling switch; relative range
3 64 0. 0.2 !element #3 (DIPOLE); vary parameter #64 (RE); coupling switch; relative range
3 36 -3.020 0.1 !element #3 (DIPOLE); parameter #36 (exit edge angle); inverse (minus sign) correlation with element#4 parameter#20 (entrance edge angle); relative range
3 24 3.021 0.1
3 37 -3.021 0.1
3 40 -3.021 0.1
5 1e-8 100 !Number of constraints; Convergence threshold; maximum number of iterations
1 1 1 5 0.0 1. 0 !transfer matrix; matrix element 1 1; FIT after element#5 ('MATRIX');Wanted value(=0.0); Weigth ; 0:no additional parameters
1 2 2 5 0.0 1. 0 !transfer matrix; matrix element 2 2; FIT after element#5 ('MATRIX');Wanted value(=0.0); Weigth ; 0:no additional parameters
3 1 2 5 0.0 10. 0 !IC; Particle #; coordinate#=2 for Y;element #; wanted value; weigth ; 0
3 1 3 5 0.0 10. 0 !IC; Particle #; coordinate#=3 for T;element #; wanted value; weigth ; 0
2 2 11 5 0.0 1. 0 !2:2nd order map element; transfer map element 2-11 (i.e. x'-x^2); Desired value; 0:no additional parameters
'END'
\ No newline at end of file
zgoubi HRS tuto: DIPOLE
'OBJET'
543.687 !BRHO of 60 keV 238U1+ in kG.cm
6 !6: generate 61 particles used to calculate 2nd order map ('MATRIX')
0.01 0.01 0.01 0.01 .1 .001 !step size in Y; T; Z; P; S; D
0.0 0. 0. 0. 0. 1.
'DRIFT'
36.32357
'DIPOLE'
0 !output flag: 0: no outpot, 2: output trajectory to zgoubi.plt, etc.
130 120. !AT[deg.], RM[cm]
65 4.5307259 0. 0. 0. !ACENT[deg.];B0[kG]; N; B; GX
7.0 0. !ENTRANCE FIELD BOUNDARY: fringe field extend[cm]; unused
4 0. 1.8 0. 0. 0. 0. 0. !unused; C0...C5; shift
45. 26.543694 227.0 0.0 0.0 227.0 !W+[deg.]; edge angle[deg.]; R1[cm]; U1; U2; R2[cm]
7.0 0. !EXIT FIELD BOUNDARY: lambda; =-1 for Enge like
4 0. 1.8 0. 0. 0. 0. 0. !unused; C0...C5; shift
-45. -26.543694 -227.0 0. 0. -227.0 0. !W-; edge angle; R1; U1; U2; R2
0. 0. !FACE 3: (Not used here)
0 0. 0. 0. 0. 0. 0. 0.
0. 0. 0. 0. 0. 0. 0.
2 4. !IRD(=2, 25 or 4)
0.5 !Integration step size[cm]
2 127.96748 -0.349067 127.96748 0.349067 !KPOS RE[cm]; TE[rad]; RS[cm]; TS[rad]
'DRIFT'
36.32357
! 'MATRIX'
! 2 0 !order of the map; 0:means calculate the matrix here
!
!
! 'FIT'
! 4 !Number of physical parameters to be varied
! 3 5 0. 0.01
! 3 64 3.66 0.01
! 2 1 0.0 0.05
! 3 21 -3.037 1.0
! 4 1e-10 100
! 3 1 2 4 0.0 10. 0
! 3 1 3 4 0.0 10. 0
! 1 2 2 5 0.0 3. 0
! 2 2 22 5 0.0 1. 0
!
!
! 'END'
'DRIFT'
36.32357
'DIPOLE'
0 !output flag: 0: no outpot, 2: output trajectory to zgoubi.plt, etc.
130 120. !AT[deg.], RM[cm]
65 4.5307259 0. 0. 0. !ACENT[deg.];B0[kG]; N; B; GX
7.0 0. !ENTRANCE FIELD BOUNDARY: fringe field extend[cm]; unused
4 0. 1.8 0. 0. 0. 0. 0. !unused; C0...C5; shift
45. 26.543694 227.0 0.0 0.0 227.0 !W+[deg.]; edge angle[deg.]; R1[cm]; U1; U2; R2[cm]
7.0 0. !EXIT FIELD BOUNDARY: lambda; =-1 for Enge like
4 0. 1.8 0. 0. 0. 0. 0. !unused; C0...C5; shift
-45. -26.543694 -227.0 0. 0. -227.0 0. !W-; edge angle; R1; U1; U2; R2
0. 0. !FACE 3: (Not used here)
0 0. 0. 0. 0. 0. 0. 0.
0. 0. 0. 0. 0. 0. 0.
2 4. !IRD(=2, 25 or 4)
0.5 !Integration step size[cm]
2 127.96748 -0.349067 127.96748 0.349067 !KPOS RE[cm]; TE[rad]; RS[cm]; TS[rad]
'DRIFT'
36.32357 ! drift length=80-120*tan(20/deg.)
'MATRIX'
2 0 !order of the map; 0:means calculate the matrix here
'FIT' 13
7 !Number of physical parameters to be varied
3 24 3.021 0.1
3 37 -3.021 0.1
3 40 -3.021 0.1
6 21 3.021 0.1
6 24 3.021 0.1
6 37 -3.021 0.1
6 40 -3.021 0.1
1 1e-15 100
2 1 22 8 0.0 1. 0 !2:2nd order map element; transfer map element 1-22 (i.e. x-x'^2); Desired value; 0:no additional parameters
'END'
\ No newline at end of file
No preview for this file type
......@@ -207,7 +207,7 @@
'OBJET'
543.687 !BRHO of 60 keV 238U1+ in kG.cm (answer of the first assigment ;-)
5 !5: generate 11 particles used to calculate transfer matrix ('MATRIX')
0.001 0.01 0.001 0.01 .1 .001 !'smalish' step size in Y; T; Z; P; S; D
0.001 0.01 0.001 0.01 .01 .01 !'smalish' step size in Y; T; Z; P; S; D
0.0 0. 0. 0. 0. 1. !reference particle's Y; T; Z; P; S; D; 'marker'. Note: Brho=BORO*D
\end{lstlisting}
and add the {\tt 'MATRIX'} keyword right before the {\tt 'END'} statement:
......@@ -242,8 +242,7 @@
Jim warned me that in this file the vertical emittance is 6\,$\mu$m (while the horizontal one is 3\,$\mu$m), and that the aspect ration between vertical size and vertical angle was wrong by a factor of 4: to fix the aspect ratio and bring the vertical emittance down to 3\,$\mu$m I use the scaling factors on line 5 of the {\tt 'OBJECT'} input.
{\it Assignment: write an input file to simulate the entire HRS from source slit to image slit. Track the 3\,000 particles in noEspread.beam and same their final coordinates to a file. Now change the mass of the particle by a factor 1/20\,000 (i.e. change its {\tt BRHO} by a factor 1/40\,000)\footnote{Take two particles with the same energy $qV=\frac{P^2}{2m}$, but with adifferent mass $s$. Logarithmic differentiation leads to: $0=\text{d}\ln\left(\frac{P^2}{2m}\right)\implies 2\frac{\text{d}B\rho}{B\rho}=\frac{\text{d}m}{m}$}, track gaian and save the final coordinates into another file. Plot the horizontal phase space coordinates from both files, you should get a plot like~\cref{fig:twomassesInit}:}
{\it Assignment: write an input file to simulate the entire HRS from source slit to image slit. Track the 3\,000 particles in noEspread.beam and same their final coordinates to a file. Now change the mass of the particle by a factor 1/20\,000 (i.e. change its {\tt BRHO} by a factor 1/40\,000)\footnote{Take two particles with the same energy $qV=\frac{P^2}{2m}$, but with adifferent mass $s$. Logarithmic differentiation leads to: $0=\text{d}\ln\left(\frac{P^2}{2m}\right)\implies 2\frac{\text{d}B\rho}{B\rho}=\frac{\text{d}m}{m}$}, track again and save the final coordinates into another file.\footnote{If you feel really lazing, you don't actually have to run {\tt zgoubi} twice and save the output in two different files: you can instead use the command {\tt 'REBELOTE'} to do everything in one shot, see \href{https://gitlab.triumf.ca/beamphys/hrs/tree/master/DIPOLE/plot-multiparticles}{link}.} Plot the horizontal phase space coordinates from both files, you should get a plot like~\cref{fig:twomassesInit}:}
\begin{figure}[htb]
\centering
\includegraphics*[width=1.0 \linewidth]{figure/twomasses}
......@@ -254,23 +253,23 @@
\section{Dipole edge curvature}
To correct the second order aberration we can try to add curvature to the edges of our dipoles.
A reasonable solution is:
A reasonable solution is with a pole curvature radius of 227\,cm:
\begin{lstlisting}
zgoubi HRS tuto: DIPOLE
'OBJET' 1
543.701 !BRHO 60 keV 238U1+ in kG.cm
3.01 !read from particles from a file
zgoubi HRS tuto: DIPOLE
'OBJET'
543.687 !BRHO 60 keV 238U1+ in kG.cm
3.01 !read from particles from
1 3000 1 !IP1; IP2; IPStep (Read particles numbered IT1 to IT2, step ITStep)
1 1 1 !not used here
1. 1. 2. 0.25 1. 1. 1. * !scaling factors on Y,T,Z,P,S,DP
0 0 0 0 0 0 0 ! not used here
0 ! not sure what this one does
noEspread.beam !file: http://beamphys.triumf.ca/~tplanche/text/designs/HRS/zgoubi/DIPOLE/noEspread.beam
'DRIFT' 2
36.32357
'DIPOLE' 3
noEspread.beam ! name of the input file
'DRIFT'
36.32357
'DIPOLE'
0 !output flag: 0: no outpot, 2: output trajectory to zgoubi.plt, etc.
130 120. !AT[deg.], RM[cm]
65 4.5315270 0. 0. 0. !ACENT[deg.];B0[kG]; N; B; GX
......@@ -286,14 +285,14 @@
2 4. !IRD(=2, 25 or 4)
0.3 !Integration step size[cm]
2 127.97493 -0.349067 127.97493 0.349067 !KPOS RE[cm]; TE[rad]; RS[cm]; TS[rad]
'DRIFT' 4
36.32357
'DRIFT' 5
'DRIFT'
36.32357
'DIPOLE' 6
'DRIFT'
36.32357
'DIPOLE'
0 !output flag: 0: no outpot, 2: output trajectory to zgoubi.plt, etc.
130 120. !AT[deg.], RM[cm]
65 4.5315270 0. 0. 0. !ACENT[deg.];B0[kG]; N; B; GX
......@@ -309,17 +308,22 @@
2 4. !IRD(=2, 25 or 4)
0.3 !Integration step size[cm]
2 127.97493 -0.349067 127.97493 0.349067 !KPOS RE[cm]; TE[rad]; RS[cm]; TS[rad]
'DRIFT' 7
'DRIFT'
36.32357
'FAISCNL' 8
'FAISCNL'
output-particles.fai
'REBELOTE'
1 0.1 0 1
1
1 1 543.701
'END'
\end{lstlisting}
Figure~\ref{fig:twomassesCurv} is obtained by plotting the output file output-particles.fai for two masses different by 1 part in 2$10^4$ (i.e.\ $B\rho$ different by 1 part in 4$10^4$).
Figure~\ref{fig:twomassesCurv} is obtained by plotting the output file output-particles.fai for two masses different by 1 part in 2$\cdot10^4$ (i.e.\ $B\rho$ different by 1 part in 4$\cdot10^4$), see~\href{https://gitlab.triumf.ca/beamphys/hrs/tree/master/DIPOLE/edge-curvature}{link}.
\begin{figure}[htb]
\centering
\includegraphics*[width=1.0 \linewidth]{figure/twomasses-edgeCurvature}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment