Commit f5297376 authored by Thomas Planche's avatar Thomas Planche

Before starting to write the second part of the tutorial for Francois

parent fd5a41bf
Pipeline #6628 canceled with stages
......@@ -16,10 +16,10 @@ zgoubi HRS tuto: DIPOLE
65 4.5343276 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 242. 0.0 0.0 242. !W+[deg.]; edge angle[deg.]; R1[cm]; U1; U2; R2[cm]
45. 26.543694 200. 0.0 0.0 200. !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 -242. 0. 0. -242. 0. !W-; edge angle; R1; U1; U2; R2
-45. -26.543694 -200. 0. 0. -200. 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.
......@@ -30,6 +30,34 @@ zgoubi HRS tuto: DIPOLE
'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
......@@ -39,10 +67,10 @@ zgoubi HRS tuto: DIPOLE
65 4.5343276 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 242. 0.0 0.0 242. !W+[deg.]; edge angle[deg.]; R1[cm]; U1; U2; R2[cm]
45. 26.543694 200. 0.0 0.0 200. !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 -242. 0. 0. -242. 0. !W-; edge angle; R1; U1; U2; R2
-45. -26.543694 -200. 0. 0. -200. 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.
......
THREED TYPE=SURFACE VECTOR=NO XORIGIN=0 YORIGIN=800 ZORIGIN=100 ROTX=-180 ROTY=0 ROTZ=-180 XASPECT=1 YASPECT=1 ZASPECT=1 SIZE=1000 FACETANGLE=10 PERSPECTIVE=NO LINECOLOUR=YES OPTION=SETVIEW
//global WCS
SET XLOCAL=0 YLOCAL=0 ZLOCAL=0 TLOCAL=0,PLOCAL=0,SLOCAL=0 LOOK=ANYWHERE ABORT=YES
$const #mm2cm 0.1
$const #T2kG 10.
$const #pi ATAN(1)*4
$const #R 1200 |//[mm] reference radius of the HRS
$const #FFE 600 |//[mm] fringe field extend (after the effective edge of the magnet, for the reference radius)
$const #Dr 15 |//[mm] step size in R
$const #Dth 0.5 |//[deg] step size in theta
$const #rmap #R+#FFE/COS(#pi/4.)
$const #rmin #rmap-390.
$const #rmax #rmap+300.
$open 1 TOSCAMOD22.dat overwrite
$format 1 fixed 16 6
$format 2 character 16
//Write the header zgoubi wants:
// R0,DR,DTTA,DZ
$assign 1 1 1 1
$write 1 #rmin*#mm2cm #Dr*#mm2cm #Dth 0.0
$assign 2 2 2 2 2 2
$write 1 'Y[cm]' 'Z[cm]' 'X[cm]' 'BY[kG]' 'BZ[kG]' 'BX[kG]'
//Write the field map:
$assign 1 1 1 1 1 1
/++ $do #r 900 1500 20
$do #r #rmin #rmax #Dr
$do #th 0 90 #Dth
$const #x #r*SIND(-#th+45.0)
$const #y #r*COSD(-#th+45.0)-#FFE/COS(#pi/4.)
$const #z 0
POINT XP=#x YP=#y ZP=0 COMP=bz
$write 1 #y*#mm2cm #z*#mm2cm #x*#mm2cm 0.0 BZ*#T2kG 0.0
$end do
$const #testR #r
$const #testTh #th
$end do
$close 1
/home/tplanche/text/designs/HRS/opera/dipole_notFinalModel/geneMap.comi
\ No newline at end of file
......@@ -41,13 +41,13 @@ plot "ref_entrance.fai" u (-$10/100.):($14/100.) w l lt 2 lc 1 title "reference
"a-60mrad_mid.fai" u (findFirst($14),($14-first)/100.+RE):($10/100.+RE+dl) w l lt 1 lc 1 notitle,\
"a-60mrad_mag2.plt" using ($10/100.*cos($22-pi/4.)+RE+mcl):(-$10/100.*sin($22-pi/4.)+dl) with l lt 1 lc 1 notitle,\
"a-60mrad_exit.fai" u ($10/100.+2*RE+mcl):(findFirst($14),-($14-first)/100.+dl) w l lt 1 lc 1 notitle,\
"mdm100+_entrance.fai" u (-$10/100.):($14/100.) w l lt 1 lc 3 title "particle mass +1%",\
"mdm100+_mag1.plt" using ($10/100.*sin($22-pi/4.)+RE):($10/100.*cos($22-pi/4.)+dl) with l lt 1 lc 3 notitle,\
"mdm100+_mid.fai" u (findFirst($14),($14-first)/100.+RE):($10/100.+RE+dl) w l lt 1 lc 3 notitle,\
"mdm100+_mag2.plt" using ($10/100.*cos($22-pi/4.)+RE+mcl):(-$10/100.*sin($22-pi/4.)+dl) with l lt 1 lc 3 notitle,\
"mdm100+_exit.fai" u ($10/100.+2*RE+mcl):(findFirst($14),-($14-first)/100.+dl) w l lt 1 lc 3 notitle,\
"mdm100-_entrance.fai" u (-$10/100.):($14/100.) w l lt 1 lc 3 notitle,\
"mdm100-_mag1.plt" using ($10/100.*sin($22-pi/4.)+RE):($10/100.*cos($22-pi/4.)+dl) with l lt 1 lc 3 notitle,\
"mdm100-_mid.fai" u (findFirst($14),($14-first)/100.+RE):($10/100.+RE+dl) w l lt 1 lc 3 notitle,\
"mdm100-_mag2.plt" using ($10/100.*cos($22-pi/4.)+RE+mcl):(-$10/100.*sin($22-pi/4.)+dl) with l lt 1 lc 3 notitle,\
"mdm100-_exit.fai" u ($10/100.+2*RE+mcl):(findFirst($14),-($14-first)/100.+dl) w l lt 1 lc 3 notitle,\
# "mdm100+_entrance.fai" u (-$10/100.):($14/100.) w l lt 1 lc 3 title "particle mass +1%",\
# "mdm100+_mag1.plt" using ($10/100.*sin($22-pi/4.)+RE):($10/100.*cos($22-pi/4.)+dl) with l lt 1 lc 3 notitle,\
# "mdm100+_mid.fai" u (findFirst($14),($14-first)/100.+RE):($10/100.+RE+dl) w l lt 1 lc 3 notitle,\
# "mdm100+_mag2.plt" using ($10/100.*cos($22-pi/4.)+RE+mcl):(-$10/100.*sin($22-pi/4.)+dl) with l lt 1 lc 3 notitle,\
# "mdm100+_exit.fai" u ($10/100.+2*RE+mcl):(findFirst($14),-($14-first)/100.+dl) w l lt 1 lc 3 notitle,\
# "mdm100-_entrance.fai" u (-$10/100.):($14/100.) w l lt 1 lc 3 notitle,\
# "mdm100-_mag1.plt" using ($10/100.*sin($22-pi/4.)+RE):($10/100.*cos($22-pi/4.)+dl) with l lt 1 lc 3 notitle,\
# "mdm100-_mid.fai" u (findFirst($14),($14-first)/100.+RE):($10/100.+RE+dl) w l lt 1 lc 3 notitle,\
# "mdm100-_mag2.plt" using ($10/100.*cos($22-pi/4.)+RE+mcl):(-$10/100.*sin($22-pi/4.)+dl) with l lt 1 lc 3 notitle,\
# "mdm100-_exit.fai" u ($10/100.+2*RE+mcl):(findFirst($14),-($14-first)/100.+dl) w l lt 1 lc 3 notitle,\
......@@ -13,6 +13,11 @@
'CHANGREF'
YS -120.0 ZR 20. !shift the optical axis by 120 cm (the reference radius of the dipole); then rotate around the vertical axis by 20 deg (20=AT-W)
'FAISCNL'
checkY.fai
'END'
'DIPOLE'
0 !output flag: 0: no outpot, 2: output trajectory to zgoubi.plt, etc.
65 120. !AT, RM
......
This diff is collapsed.
......@@ -2,16 +2,16 @@ set term postscript eps color enhanced "Times-Roman" 18 lw 2
set output "layout.eps"
set xlabel '[m]'
set ylabel '[m]'
set grid
titletext="HRS layout (using TOSCA map)"
labeltext="(c) `whoami`, "
today="`date +%Y/%b/%d`"
set label labeltext.today at screen .01, screen .02
set title titletext
#set grid
#titletext="HRS layout (using TOSCA map)"
#labeltext="(c) `whoami`, "
#today="`date +%Y/%b/%d`"
#set label labeltext.today at screen .01, screen .02
#set title titletext
set key cent cent
cm2mm=10.0
set yrange [0:2.5]
set yrange [-0.1:2.3]
findFirst(x) = ($0 > 0 ? first : first = x) #just a hack to get the first value of a column.
......@@ -24,8 +24,9 @@ RE=180.13967/100 #fitted RE (=RS) value in 'TOSCA'
#set table "outFromGnuplot.dat"
plot "mag1_center.plt" using ($10/100.*sin($22-pi/4.)+RE):($10/100.*cos($22-pi/4.)+dl) with p pt 1 lc 0 ps 1 title "magnet center",\
"ref_entrance.fai" u (-$10/100.):($14/100.) w l lt 2 lc 1 title "reference trajectory",\
#plot "mag1_center.plt" using ($10/100.*sin($22-pi/4.)+RE):($10/100.*cos($22-pi/4.)+dl) with p pt 1 lc 0 ps 1 title "magnet center",\
plot "ref_entrance.fai" u (-$10/100.):($14/100.) w l lt 2 lc 1 title "reference trajectory",\
"ref_mag1.plt" using ($10/100.*sin($22-pi/4.)+RE):($10/100.*cos($22-pi/4.)+dl) with l lt 2 lc 1 notitle,\
"ref_mid.fai" u (findFirst($14),($14-first)/100.+RE):($10/100.+RE+dl) w l lt 2 lc 1 notitle,\
"ref_mag2.plt" using ($10/100.*cos($22-pi/4.)+RE+mcl):(-$10/100.*sin($22-pi/4.)+dl) with l lt 2 lc 1 notitle,\
......
/home/tplanche/text/designs/HRS/zgoubi/report/DIPOLE/traj.eps
\ No newline at end of file
No preview for this file type
......@@ -41,7 +41,7 @@
\tableofcontents
\section{Basic Layout}\label{sec:layout}
The optical system we will consider in this note is designed to separate rare isotopes with mass/charge differences of only one part in 20\,000 in beams with transverse emittances of at least 3\,$\mu$m\footnote{Un-normalized emittance. Note that to achieve such resolution an energy spread of the order of 1\,eV or less is required.}~\cite{TRI-DN-16-09}.
The optical system we will consider in this tutorial is designed to separate rare isotopes with mass/charge differences of only one part in 20\,000 in beams with transverse emittances of at least 3\,$\mu$m\footnote{Un-normalized emittance. Note that to achieve such resolution an energy spread of the order of 1\,eV or less is required.}~\cite{TRI-DN-16-09}.
It is composed of:
\begin{itemize}
\item a source slit;
......@@ -130,7 +130,7 @@
'END'
\end{lstlisting}
Note that the tracking starts 20\,deg. before the effective edge of the magnet to leave room for the fringe field\footnote{About fringe fields: in most cases it is unimportant to know the precise shape of the field field. For dipoles (in the horizontal plane), quadrupoles~\cite{baartman1997intrinsic}, solenoides~\cite{baartman2006rms}, etc. the lowest order aberration does not depend at all on the detail of the fringe field. The next order aberration depends only on the fringe field extend. It is only when you look at quite-high-order aberrations that the shape of the field fall off starts to matter.
Note that the tracking starts 20\,deg. before the effective edge of the magnet to leave room for the fringe field\footnote{About fringe fields: in most cases it is unimportant to know the precise shape of the field field. For dipoles (and quadrupoles~\cite{baartman1997intrinsic}) the lowest order aberration (second order for dipoles, third order for quads) is practically independent of the details of the fringe field. The next order aberration depends only on the fringe field extend. For more details read Ref.~\cite{baartman2001end}. It is only when you look at quite-high-order aberrations that the shape of the field fall off starts to matter.
For our dipole I chose a fringe field as simple as possible: fringe field extend~=~magnet gap (7\,cm) and a shape defined by a single Enge coefficient: {\tt C1}=1.8 (all the others are set to 0).} to fall off to (practically) zero, which leads to {\tt AT}=90/2+20=65\,degree.
{\it Assignment: copy-paste these lines right bellow the {\tt 'OBJECT'} definition (\cref{list:OBJET}). Guess the values of {\tt B0, RE}, and {\tt TE} such that the particle arrives at the magnet center:
......@@ -185,7 +185,7 @@
Let's replace our previous {\tt 'OBJECT'} definition by.
\begin{lstlisting}[label=list:OBJECT4]
'OBJET'
544.12 !BRHO
544.1192 !BRHO
5 !5: generate 11 particles used to calculate transfer matrix ('MATRIX')
0.1 0.1 0.1 0.1 .1 .001 !'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
......@@ -207,7 +207,36 @@
The fit should converge to an value for the edge angle close to 26.56\,deg.\footnote{26.56\,deg. is the number that the linear optics code {\tt TRANSOPTR} finds}.
\section{Multiparticle simulation}
I got from my good friend Jim (who simulated the HRS using {\tt COSY-INFINITY}) a file containing the coordinates of 3\,000 randomly generated particles. You can download the file from here: \href{http://beamphys.triumf.ca/~tplanche/text/designs/HRS/zgoubi/DIPOLE/noEspread.beam}{link}. Each line of this file contains is (using {\tt zgoubi}'s notation): {\tt Y,T,Z,P,S,DP}. This format is what {\tt 'OBJECT'} can read when {\tt KOBJ}=3.01:
\begin{lstlisting}[label=list:FITedge]
'OBJET'
544.1192 !60 keV U1+
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 ! name of the input file
\end{lstlisting}
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/10\,000), 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}:}
\begin{figure}[htb]
\centering
\includegraphics*[width=0.8 \linewidth]{figure/twomasses}
\caption{Two isobars with a relative mass difference of 1/20\,000 through the HRS, before correcting non-linear aberration.}\label{fig:twomassesInit}
\end{figure}
What you see in~\cref{fig:twomassesInit} is that the two masses completely overlap. This is (mostly) the effect of second order (sextupole) aberration. To achieve the designed resolution, we must correct the aberration.
\section{Dipole edge curvature}
To correct the second order aberration let's try to add curvature to the edges of our dipoles. Once again, we would like to adjust the edge curvature using a {\tt 'FIT'}, but what should the objective of that fit be?
......
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