A brief introduction of SAD with a design example K. Oide 18-19 - - PowerPoint PPT Presentation

a brief introduction of sad
SMART_READER_LITE
LIVE PREVIEW

A brief introduction of SAD with a design example K. Oide 18-19 - - PowerPoint PPT Presentation

Yukinori Kobayashi (KEK) Tsukasa Miyajima (KEK) Kazuhito Ohmi (KEK) Katsunobu Oide (CERN/KEK) David C. Sagan (Cornell U.) Local Organization Committee Noboru Yamamoto (KEK) Yoshihiro Funakoshi Kaoru Yokoya (KEK) Kazuro Furukawa Frank


slide-1
SLIDE 1

Workshop SAD2019

3-go-kan Seminar Hall, KEK, Japan 18-19 September 2019

Yukinori Kobayashi (KEK) Tsukasa Miyajima (KEK) Kazuhito Ohmi (KEK) Katsunobu Oide (CERN/KEK) David C. Sagan (Cornell U.) Noboru Yamamoto (KEK) Kaoru Yokoya (KEK) Frank Zimmermann (CERN) Local Organization Committee Yoshihiro Funakoshi Kazuro Furukawa Kentaro Harada Hiroyuki Harada (JAEA) Naoko Iida Susumu Kamada Haruyo Koiso Toshihiro Mimashi Akio Morita Takashi Obina Yukiyoshi Ohnishi (Chair) Kazuhito Ohmi Katsunobu Oide Yoichi Sato Hiroshi Sugimoto Demin Zhou

A brief introduction of SAD

with a design example

  • K. Oide

18-19 Sept. 2019 SAD Workshop 2019 @ KEK

A SAD source: https://github.com/KatsOide/SAD A command manual with some description of beam dynamics: https://hep-project-sad.web.cern.ch/SADHelp/SADHelp.html SAD home page @ KEK: http://acc-physics.kek.jp/SAD/index.html

Many thanks to N. Akasaka, K. Hirata, S. Kamada, M. Kikuchi, H. Koiso, S. Kuroda, A. Morita, K. Ohmi, Y. Ohnishi, S. Yamada, N. Yamamoto, K. Yokoya, D. Zhou, F. Zimmermann, and all contributors and users of SAD.

1

slide-2
SLIDE 2

What SAD can do?

  • Design of accelerator beams
  • Optics calculation & matching
  • 5D and 6D optics
  • ring & linac
  • geometry matching
  • off-momentum matching
  • finite-amplitude matching
  • Emittance calculation of an electron ring with synchrotron radiation, intrabeam

scattering, space charge

  • 6D full symplectic tracking of macro particles with synchrotron radiation, strong-

weak beam-beam, space charge, radiative Bhabha,…

  • Polarization calculation (under development)
  • Parallel computing by fork processes and shared memory
  • Mathematica-like scripting language
  • Graphics using Tcl/Tk widgets
  • Accelerator control & data taking via EPICS interface
  • and more …

2

slide-3
SLIDE 3

An example: main booster ring for FCC-ee with 4 IP

IR IR IR IR RF RF RF RF

IRSTR: 1568 m R F : 1 6 m ARC: 13.137 km

ρ =

Arc: 13.137 km

ρ =

SUPPA

  • SUPPA

S U P P B

  • S

U P P B

1/4 Ring (QRING)

  • Let us design a 1/4 of the main

booster for FCC-ee @ 182.5 GeV with a single SAD deck for:

  • ptics matching
  • emittance adjustment
  • chromaticity correction with 2

family, non-interleaved sextupoles

  • check dynamic aperture

3

slide-4
SLIDE 4

Starting SAD

  • SAD can be installed on many unix-like systems including linux, macOS, FreeBSD,

cygwin, etc.

  • On LXPLUS and HPC, SAD is invoked by

/eos/experiment/fcc/ee/accelerator/SAD/oldsad/bin/gs filename

  • X is needed for graphics
  • SAD starts in “MAIN” mode:

theresa:~/SAD/oldsad>gsd /scratch/oide..87208~example_booster.sad~ (gsd is a local script to invoke SAD as above) *** Welcome to SAD Ver.1.1.6.9.4k64 built at 2019-09-11 16:53:46 +0200 *** *** Today: 01:53:10 Sunday 09/15/2019 *** OFF LOG ECHO;READ 77 ; 1 ! ! This is a tutorial for SAD to construct an electron ring ! for the FCC-ee main booster with the 4 IP configuration. ! ! In each line, after ! is ignored, except within "". ! ! SAD starts in the "MAIN" mode which is used to define elements and beam lines. ! However, they can be (re)defined in the "FFS" mode later.

…….

This example files is available at (SAD_ROOTPATH)/script/example_booster.sad .

4

slide-5
SLIDE 5

MAIN mode for component definitions

  • SAD starts in “MAIN” mode, which defines optics elements and beam lines. They can be (re)defined in

the “FFS” mode later.

  • Syntax:

(element type) name = (keyword = value-expression [unit] … ) … ;

  • Element types: DRIFT, BEND, QUAD, SEXT, OCT, DECA, DODECA, MULT, SOL, CAVI,

BEAMBEAM, MARK, etc., and LINE.

  • Math expressions with real variables and some functions are usable for value.

! Define drift spaces ! Multiple drifts can be defined by a single DRIFT until ";". ! DRIFT LX03 = (L = 0.3) LSX = (L = 2.8 + 0.3*2) LSA = (L = 25) LSB = (L=25) ! SAD uses the SI unit, radian, and eV. LM = (L=30) LRF = (L=15) ! expressions with real variables and some basic math functions can be used. LLA = (L=8) LLB = (L=8) ; ! ! Define dipoles with temporary values. ! Actual values will be determined later. ! BEND B1 = (L=25 ANGLE=0.002 E1 = 0.5 E2 = 0.5) ! L is the arc length. ; ! E1 and E2 are the edge angles at the entrance and exit, divided by ANGLE. ! E1 = E2 = 0.5 means a rectangular dipole.

…….

5

slide-6
SLIDE 6

MAIN mode (quads and sexts)

! ! Define quads with initial strengths ! Strengths will be determined by matching beam lines later. ! QUAD QF = (L=3 K1=0.05) QD = (L=3 K1 = -0.05) ! K1 = B'L/(Brho) , hor. focusing is positive. QSA1 = (L=3 K1=-0.05) ! quads for dispersion suppressors A QSA2 = (L=3 K1= 0.05) QSA3 = (L=3 K1=-0.05) QSA4 = (L=3 K1= 0.05) QSA5 = (L=3 K1=-0.05) QSB1 = (L=3 K1=-0.05) ! quads for dispersion suppressors B QSB2 = (L=3 K1= 0.05) QSB3 = (L=3 K1=-0.05) QSB4 = (L=3 K1= 0.05) QSB5 = (L=3 K1=-0.05) QMF = (L=3 K1= 0.05) ! quads for IR straight sections QMD = (L=3 K1=-0.05) QRF = (L=3 K1= 0.05) ! quads for RF section QRD = (L=3 K1=-0.05) ; ! Define sexts ! The strengths "K2" = B’'L/(Brho) will be determined by chromaticity correction later. ! SEXT SF = (L=2.8) SD = (L=2.8) ;

6

slide-7
SLIDE 7

MAIN mode (RF and MARKER)

; ! Define RF cavity ! The voltage will be defined later to adjust the bunch length. ! "FREQ" is the rf frequency, but no need to be a harmonic of the revolution frequency. ! If an exact harmonic is necessary, use "HARM" instead. ! CAVI CAV = (FREQ = 400 MHZ) ; ! Define markers, which are necessary at the beginning of a beam line. ! Markers are also used to keep and transfer Twiss parameters to

  • ther beam lines in matching.

! MARK F1 = (BX = 10 BY = 10) ! betax = betay = 10 m as the initial values. FR = (BX = 10 BY = 10) FM = (BX = 10 BY = 10)

7

slide-8
SLIDE 8

MAIN mode (some elementary beam lines)

! Now define beam lines: ! ! short sections for sexts: LINE SLF = (LX03 SF LX03) SLD = (LX03 SD LX03) ! Arc "5*FODO" with non-interleaved sextupole pairs: FODOARC = (F1 QF SLF B1 LX03 QD LSX B1 LX03 QF LSX B1 LX03 QD LSX B1 LX03 QF SLF B1 LX03 QD SLD B1 LX03 QF LSX B1 LX03 QD LSX B1 LX03 QF LSX B1 LX03 QD SLD B1 LX03) SUPPA = (-F1 ! A negative sign means the reverse orientation; alpha, etap, zetap, R2, R3, dpx, dpy are reversed LSA QSA1 LX03 B1 LX03 QSA2 LLA QSA3 LLA QSA4 LLA QSA5 -FM) ! Suppressor from IR to arc SUPPB = ( F1 QF LSB QSB1 LX03 B1 LX03 QSB2 LLB QSB3 LLB QSB4 LLB QSB5 FR) ! Suppressor from arc to RF FODOIR = (FM LM QMF LM QMD ) FODORF = (FR LRF CAV LRF QRF LRF CAV LRF QRD ) IRSTR = (SUPPA 16*FODOIR LM QMF LM -SUPPA F1) ! A negative sign means the reverse ordering ! -(A B C) = (-C -B -A) RFSTR = (SUPPB 16*FODORF LRF CAV LRF QRF LRF CAV LRF -SUPPB) 8

slide-9
SLIDE 9

FFS mode for optics and more…

FFS; ! Entering "FFS" mode for all calculations, scripting, etc. *** SADScript Initialization: /Users/oide/SAD/oldsad/Packages/init.n *** *** Run time Environment: /Users/oide/SAD/oldsad/Packages/init.local.n *** RFSW RADCOD RAD FLUC INTRA POL COD DAPER EMIOU K64 FOURI SMEAR F F F T F F T F F T F T ! ! Define a function to output the CPU time. CPU[]:=Print["CPU time so far =",TimeUsed[]," sec"]; CPU[]; CPU time so far =.02376299910247326 sec dr:=FFS["DRAW BX BY & EX EY {QS}*;"]; ! define a command to draw optics. MOMENTUM=182.5e9; ! design momentum CONVERGENCE=1e-20; ! the goal convergence for matching rhoarc=13137; ! average bending radius of the arc (given). lrf=1600; ! length of full RF section (given). lir=1568; ! length of full IR (given). sigz0=2.5e-3; ! equilibrium bunch length MINCOUP=0.01; ! minimum emittance ratio NPARA=8; ! number of parallel processes * The cpu time is by MacBook Pro 2018, 6 core, 2.6 GHz

9

slide-10
SLIDE 10

FFS syntax

( expression | command [arg1,…] ) [;]

  • Expression is an any expression to be evaluated in SAD Script.
  • Commands are FFS commands such as CALC, GO, FIT, FREE, FIX,

etc.

  • FFS commands are context-oriented to take args as far as they are meaningful

until the end of line. Then ; is necessary to terminate the command intentionally before the end of line.

  • The result of expression is printed out to the terminal unless followed by ;.
  • A word in the input stream is first evaluated as an expression. If it does not

have a defined value, it is interpreted as a command.

10

slide-11
SLIDE 11

Optics functions

  • Functions below are used for FIT, Twiss, DRAW, OpticsPlot, etc.
  • Functions AZ, BZ, NZ, ZX, ZPX, ZY, ZPY are calculated/matched only with CALC6D.
  • (“R”+function name) refers the reference value defined by the REF command.
  • (“D”+function name) refers the difference between the reference (relative difference for βs).

αx, αy, αz

βx, βy, βz

functions meaning remarks AX, AY, AZ BX, BY, BZ NX, NY, NZ phase advances (1 for 1 revolution) for FIT in radian for Twiss EX, EPX, EY, EPY momentum dispersions in the x-y decoupled space ZX, ZPX, ZY, ZPY z-dispersions. PEX, PEPX,…, PZX, PZPX,… dispersions in physical space R1, R2, R3, R4, DETR x-y coupling parameters units are 1, m, 1/m, 1, 1 DX, DPX, DY, DPY, DZ, DDP 6D orbit 11

slide-12
SLIDE 12

FFS flags

  • There are a number of flags to control behaviors of FFS calculations and behaviors:
  • To turn on a flag, just write its name. To turn off, prepend NO to its name.
  • Some flags have antonyms which are equivalent to attach NO.

Flag Antonym Action default RING TRPT consider the beam line as a part of a ring, i.e., the design momentum is constant. RING CELL INS Orbit and optics should satisfy the periodic condition INS RFSW Turn on RF in CAVI, MULT, and TCAV RFSW RAD Turn on synchrotron radiation in tracking NORAD FLUC Turn on quantum excitation in tracking when RAD is on. FLUC RADCOD Calculate orbit considering synch. rad. energy loss NORADCOD RADTAPER Apply automatic tapering on all magnets NORADTAPER CALC4D CALC6D Optics calculation is based on 4(5)D: no synchrotron motion. CALC4D and more… 12

slide-13
SLIDE 13

Matching of FODO cell in arc

USE FODOARC; ! Choose the beam line cell; ! impose periodic conditions for orbit and optics fit; nx 1.25 ny 1.25; ! fit tunes at the end of line free Q*; ! See wildcards in manual GO; ! start matching Iterations Residual Method Reduction Variables 2 3.4798E-03 (NEWTON) 1.000 2 3 1.5203E-08 (NEWTON) 1.000 2 4 2.8858E-19 (NEWTON) 1.000 2

  • Matched. ( 4.8121E-29) DP = 0.01000 DP0 = 0.00000 ExponentOfResidual = 2.0

OffMomentumWeight = 1.000 $$$ f AX ####### # -2.396159 $$$ f BX ####### # 103.37440 $$$ f NX 1.25 1 1.250000 $$$ f AY ####### # .524487 $$$ f BY ####### # 19.551974 $$$ f NY 1.25 1 1.250000 $$$ f LENG ####### # 317.00000 dr; ! draw optics on X. CPU[]; CPU time so far =.6254770159721375 sec susp; ! suspend reading the input stream and wait for interactive input from console. In[10]:= ! Resumes by then RESUME(RES) command. ! susp is ignored if the flag SUS is unset (NOSUS).

13

slide-14
SLIDE 14

Matching of FODO cell in arc

USE FODOARC; ! Choose the beam line cell; ! impose periodic conditions for orbit and optics fit; nx 1.25 ny 1.25; ! fit tunes at the end of line free Q*; ! See wildcards in manual GO; ! start matching Iterations Residual Method Reduction Variables 2 3.4798E-03 (NEWTON) 1.000 2 3 1.5203E-08 (NEWTON) 1.000 2 4 2.8858E-19 (NEWTON) 1.000 2

  • Matched. ( 4.8121E-29) DP = 0.01000 DP0 = 0.00000 ExponentOfResidual = 2.0

OffMomentumWeight = 1.000 $$$ f AX ####### # -2.396159 $$$ f BX ####### # 103.37440 $$$ f NX 1.25 1 1.250000 $$$ f AY ####### # .524487 $$$ f BY ####### # 19.551974 $$$ f NY 1.25 1 1.250000 $$$ f LENG ####### # 317.00000 dr; ! draw optics on X. CPU[]; CPU time so far =.6254770159721375 sec susp; ! suspend reading the input stream and wait for interactive input from console. In[10]:= ! Resumes by then RESUME(RES) command. ! susp is ignored if the flag SUS is unset (NOSUS).

13

slide-15
SLIDE 15

Geometry of beam line in SAD

The SAD manual saids:

geometric-functions

Available geometric-functions are: GX geometrical coordinate xi GY geometrical coordinate eta GZ geometrical coordinate zeta CHI1 geometrical rotation angle ch1_1 CHI2 geometrical rotation angle ch1_2 CHI3 geometrical rotation angle ch1_3 The geometrical coordinate {xi, eta, zeta} is set by the ORG command, and its default

  • rigin is at the entrance of the beam line, and the default directions are xi in s-

direction, eta in -(x-direction), and zeta in -(y-direction) at the entrance. The set {xi, , zeta} forms a right-hand system. The rotation angles are defined so as to give the local {x,y,s} is written {x, y, s}_local = rotate[s, chi3] rotate[x, chi2] rotate[y, -chi1]{x, y, s}_origin, where rotate[a, b] reads "rotate around the new-a vector by b right-handedly”

14

x0 s0 y0 GX0 GY0 GZ0

slide-16
SLIDE 16

Determine number of FODOs in the arc for the design emittance

In[10]:= res ! Resumes by then RESUME(RES) command. ! susp is ignored if the flag SUS is unset (NOSUS). loffset=LINE["S","$$$"]-Plus@@LINE["L","B1.*"]; ! length of components other than B1 dipoles. ! "$$$" refers the end of beam line. ! Define a function to calculate the FODO emittance as a function of number of cells in the arc. ! * definition of function is similar to Mathematica's. ! f[arg]:=body ! arg may contain patterns such as x_ , ! FODOEmit[nfodo_]:=With[{ba=Pi/4/(nfodo*10+2)}, ! 10 dipoles per FODO, +2 for dipoles in the suppressor. Element["ANGLE","B1"]=ba; ! setting the bending angle of B1 Element["L","B1"]=(rhoarc*(ba*10)-loffset)/10; ! setting L of B1 according to rhoarc. FFS["fit; nx 1.25 ny 1.25;free Q*;GO;"]; ! 90 degree FODO * 5. Emittances[[1]]/.Emittance[]]; ! return horizontal emittance. em=Table[{nfodo,FODOEmit[nfodo]/1e-9},{nfodo,30,40}]; ! Table of {# of FODO, emitx}. ListPlot[em, PlotJoined->True, FrameLabel->{"N`dFODO","`fe`n`dx`n (nm)"}]; ! an old KaleidaGraph-like syntax for subscripts and Greek letters. Update[]; ! The drawing on X is updated. CPU[]; CPU time so far =.734233021736145 sec susp; In[67]:=

15

slide-17
SLIDE 17

Determine number of FODOs in the arc for the design emittance

In[10]:= res ! Resumes by then RESUME(RES) command. ! susp is ignored if the flag SUS is unset (NOSUS). loffset=LINE["S","$$$"]-Plus@@LINE["L","B1.*"]; ! length of components other than B1 dipoles. ! "$$$" refers the end of beam line. ! Define a function to calculate the FODO emittance as a function of number of cells in the arc. ! * definition of function is similar to Mathematica's. ! f[arg]:=body ! arg may contain patterns such as x_ , ! FODOEmit[nfodo_]:=With[{ba=Pi/4/(nfodo*10+2)}, ! 10 dipoles per FODO, +2 for dipoles in the suppressor. Element["ANGLE","B1"]=ba; ! setting the bending angle of B1 Element["L","B1"]=(rhoarc*(ba*10)-loffset)/10; ! setting L of B1 according to rhoarc. FFS["fit; nx 1.25 ny 1.25;free Q*;GO;"]; ! 90 degree FODO * 5. Emittances[[1]]/.Emittance[]]; ! return horizontal emittance. em=Table[{nfodo,FODOEmit[nfodo]/1e-9},{nfodo,30,40}]; ! Table of {# of FODO, emitx}. ListPlot[em, PlotJoined->True, FrameLabel->{"N`dFODO","`fe`n`dx`n (nm)"}]; ! an old KaleidaGraph-like syntax for subscripts and Greek letters. Update[]; ! The drawing on X is updated. CPU[]; CPU time so far =.734233021736145 sec susp; In[67]:=

design = 1.45 nm

εx

15

slide-18
SLIDE 18

Determine number of FODOs (cont’d)

! A more elegant way to choose nfodo: emr=Sort[Reverse /@ em]; ! /@ is an operator for MAP, as Mathematica. spnf=Spline[emr]; ! define a cubic spline function returns the nfodo as a function of emittance. nfodo=spnf[1.45] Out[68]:= 37.51309170388507 nfodo=Round[nfodo]; Plot[spnf[x],{x,1.3,2.7},FrameLabel->{"`fe`n`dx`n (nm)","N`dFODO"}]; Update[]; CPU[]; CPU time so far =.7168480157852173 sec susp;

16

slide-19
SLIDE 19

Determine number of FODOs (cont’d)

! A more elegant way to choose nfodo: emr=Sort[Reverse /@ em]; ! /@ is an operator for MAP, as Mathematica. spnf=Spline[emr]; ! define a cubic spline function returns the nfodo as a function of emittance. nfodo=spnf[1.45] Out[68]:= 37.51309170388507 nfodo=Round[nfodo]; Plot[spnf[x],{x,1.3,2.7},FrameLabel->{"`fe`n`dx`n (nm)","N`dFODO"}]; Update[]; CPU[]; CPU time so far =.7168480157852173 sec susp;

design = 1.45 nm

εx

16

slide-20
SLIDE 20

Constructing the arc

In[70]:= res !Thus we have chosen nfodo = 38 for emitx \approx 1.45 nm; FODOEmit[nfodo]; save all; ! save variables before moving to other beam lines. ARC = BeamLine[nfodo * ExtractBeamLine[FODOARC]]; ! Construct the arc. use ARC; ins; ! non-periodic condition for the orbit and optics. calc; ! calculate the optics.

  • Matched. ( 0.000 ) DP = 0.01000 DP0 = 0.00000 ExponentOfResidual = 2.0

OffMomentumWeight = 1.000 $$$ f AX ####### # -2.393117 $$$ f BX ####### # 87.356302 $$$ f NX ####### # 47.500000 $$$ f AY ####### # .544201 $$$ f BY ####### # 16.831725 $$$ f NY ####### # 47.500000 $$$ f LENG ####### # 10263.755 dr; CPU[]; CPU time so far =1.5069289207458496 sec susp;

17

slide-21
SLIDE 21

Constructing the arc

In[70]:= res !Thus we have chosen nfodo = 38 for emitx \approx 1.45 nm; FODOEmit[nfodo]; save all; ! save variables before moving to other beam lines. ARC = BeamLine[nfodo * ExtractBeamLine[FODOARC]]; ! Construct the arc. use ARC; ins; ! non-periodic condition for the orbit and optics. calc; ! calculate the optics.

  • Matched. ( 0.000 ) DP = 0.01000 DP0 = 0.00000 ExponentOfResidual = 2.0

OffMomentumWeight = 1.000 $$$ f AX ####### # -2.393117 $$$ f BX ####### # 87.356302 $$$ f NX ####### # 47.500000 $$$ f AY ####### # .544201 $$$ f BY ####### # 16.831725 $$$ f NY ####### # 47.500000 $$$ f LENG ####### # 10263.755 dr; CPU[]; CPU time so far =1.5069289207458496 sec susp;

17

slide-22
SLIDE 22

Dispersion suppressor (IRSTR)

use IRSTR; ins; fit FM EX 0 EPX 0; ! Suppress dispersion at the MARK FM. fit QMF QMF.2 ax 0 ay 0 bx 1 by 1 nx 0.25 ny 0.25; !periodic condition for the FODO in the straight. ! between QMF and QMF.2 alphas and betas are equal, the phase advances are 90 degs. fit b1+1 b1.2 leng lir; ! set the length between two dipoles at the suppressors. fit ^^^ $$$ bxm 200 bym 200; ! suppress the maximum betas below 200 meters. free LSA LLA LM QSA* QM*; ! variables LLA min 7; ! restrict LLA > 7 m. go; Iterations Residual Method Reduction Variables 3 1247. (NEWTON) 6.2500E-02 9 4 634.4 (NEWTON) 0.2500 9 6 145.7 (NEWTON) 0.4739 9 8 134.9 (NEWTON) 6.2500E-02 9 9 68.49 (NEWTON) 0.2500 9 10 24.96 (NEWTON) 1.000 9 12 11.15 (NEWTON) 0.2539 9 13 6.279 (NEWTON) 1.000 9 14 0.5260 (NEWTON) 1.000 9 15 2.9690E-02 (NEWTON) 1.000 9 17 2.5984E-02 (NEWTON) 6.2500E-02 10 18 1.6647E-02 (NEWTON) 0.2500 10 20 1.4381E-02 (NEWTON) 6.2500E-02 10 21 7.9516E-03 (NEWTON) 0.2500 10 23 6.0461E-03 (NEWTON) 0.1603 10 25 3.6685E-03 (NEWTON) 0.2996 10 27 1.9911E-03 (NEWTON) 0.4235 10 28 1.6920E-04 (NEWTON) 1.000 10 29 7.8366E-08 (NEWTON) 1.000 10 30 5.5307E-16 (NEWTON) 1.000 10

  • Matched. ( 4.9233E-27) DP = 0.01000 DP0 = 0.00000 ExponentOfResidual = 2.0

OffMomentumWeight = 1.000 LX03.2/B1.2 LENG 1568 1 1568.0000 FM.1 EX 0 1 -1.40E-17 FM.1 EPX 0 1 -1.30E-18 QMF.1/QMF.2 AX 0 1 1.821E-14 QMF.1/QMF.2 BX 1 1 1.000000 QMF.1/QMF.2 NX .25 1 .250000 QMF.1/QMF.2 AY 0 1 -4.39E-15 QMF.1/QMF.2 BY 1 1 1.000000 QMF.1/QMF.2 NY .25 1 .250000 $$$ AX ####### # -2.393117 $$$ BXM 200 1 87.356302 $$$ NX ####### # 5.057180 $$$ AY ####### # .544201 $$$ BYM 200 1 16.831725 $$$ NY ####### # 5.404733 $$$ LENG ####### # 1670.8744 save all; dr; CPU[]; CPU time so far =1.9600639343261719 sec susp;

18

slide-23
SLIDE 23

Dispersion suppressor (IRSTR)

use IRSTR; ins; fit FM EX 0 EPX 0; ! Suppress dispersion at the MARK FM. fit QMF QMF.2 ax 0 ay 0 bx 1 by 1 nx 0.25 ny 0.25; !periodic condition for the FODO in the straight. ! between QMF and QMF.2 alphas and betas are equal, the phase advances are 90 degs. fit b1+1 b1.2 leng lir; ! set the length between two dipoles at the suppressors. fit ^^^ $$$ bxm 200 bym 200; ! suppress the maximum betas below 200 meters. free LSA LLA LM QSA* QM*; ! variables LLA min 7; ! restrict LLA > 7 m. go; Iterations Residual Method Reduction Variables 3 1247. (NEWTON) 6.2500E-02 9 4 634.4 (NEWTON) 0.2500 9 6 145.7 (NEWTON) 0.4739 9 8 134.9 (NEWTON) 6.2500E-02 9 9 68.49 (NEWTON) 0.2500 9 10 24.96 (NEWTON) 1.000 9 12 11.15 (NEWTON) 0.2539 9 13 6.279 (NEWTON) 1.000 9 14 0.5260 (NEWTON) 1.000 9 15 2.9690E-02 (NEWTON) 1.000 9 17 2.5984E-02 (NEWTON) 6.2500E-02 10 18 1.6647E-02 (NEWTON) 0.2500 10 20 1.4381E-02 (NEWTON) 6.2500E-02 10 21 7.9516E-03 (NEWTON) 0.2500 10 23 6.0461E-03 (NEWTON) 0.1603 10 25 3.6685E-03 (NEWTON) 0.2996 10 27 1.9911E-03 (NEWTON) 0.4235 10 28 1.6920E-04 (NEWTON) 1.000 10 29 7.8366E-08 (NEWTON) 1.000 10 30 5.5307E-16 (NEWTON) 1.000 10

  • Matched. ( 4.9233E-27) DP = 0.01000 DP0 = 0.00000 ExponentOfResidual = 2.0

OffMomentumWeight = 1.000 LX03.2/B1.2 LENG 1568 1 1568.0000 FM.1 EX 0 1 -1.40E-17 FM.1 EPX 0 1 -1.30E-18 QMF.1/QMF.2 AX 0 1 1.821E-14 QMF.1/QMF.2 BX 1 1 1.000000 QMF.1/QMF.2 NX .25 1 .250000 QMF.1/QMF.2 AY 0 1 -4.39E-15 QMF.1/QMF.2 BY 1 1 1.000000 QMF.1/QMF.2 NY .25 1 .250000 $$$ AX ####### # -2.393117 $$$ BXM 200 1 87.356302 $$$ NX ####### # 5.057180 $$$ AY ####### # .544201 $$$ BYM 200 1 16.831725 $$$ NY ####### # 5.404733 $$$ LENG ####### # 1670.8744 save all; dr; CPU[]; CPU time so far =1.9600639343261719 sec susp;

FM

18

slide-24
SLIDE 24

Dispersion suppressor (RFSTR)

! Mathcing the straight section for the RF. Similar to IRSTR. use RFSTR; ins; fit FR EX 0 EPX 0; fit QRF QRF.2 ax 0 ay 0 bx 1 by 1 nx 0.25 ny 0.25; fit b1+1 b1.2 leng lrf; fit ^^^ $$$ bxm 200 bym 200; free LSB LLB LRF QSB* QR*; LLB min 7; go; Iterations Residual Method Reduction Variables 3 853.7 (NEWTON) 6.2500E-02 9 4 467.1 (NEWTON) 0.2500 9 8 423.4 (NEWTON) 8.3365E-02 9 9 295.1 (NEWTON) 0.3335 9 10 129.5 (NEWTON) 1.000 9 12 49.59 (NEWTON) 7.9829E-02 9 13 21.79 (NEWTON) 0.3193 9 15 18.35 (NEWTON) 6.9989E-02 9 16 11.55 (NEWTON) 0.2800 9 17 8.441 (NEWTON) 1.000 10 19 7.000 (NEWTON) 7.1966E-02 9 20 3.355 (NEWTON) 0.2879 9 22 1.513 (NEWTON) 0.3698 9 23 0.2654 (NEWTON) 1.000 10 24 6.1099E-02 (NEWTON) 1.000 10 25 3.5329E-03 (NEWTON) 1.000 10 26 2.9092E-06 (NEWTON) 1.000 10 27 3.4641E-13 (NEWTON) 1.000 10

  • Matched. ( 2.8320E-25) DP = 0.01000 DP0 = 0.00000 ExponentOfResidual = 2.0

OffMomentumWeight = 1.000 LX03.2/B1.2 LENG 1600 1 1600.0000 FR.1 EX 0 1 4.398E-17 FR.1 EPX 0 1 1.953E-18 QRF.1/QRF.2 AX 0 1 2.589E-13 QRF.1/QRF.2 BX 1 1 1.000000 QRF.1/QRF.2 NX .25 1 .250000 QRF.1/QRF.2 AY 0 1 3.247E-13 QRF.1/QRF.2 BY 1 1 1.000000 QRF.1/QRF.2 NY .25 1 .250000 $$$ AX ####### # 2.393117 $$$ BXM 200 1 87.356302 $$$ NX ####### # 5.079165 $$$ AY ####### # -.544201 $$$ BYM 200 1 16.831725 $$$ NY ####### # 5.421611 $$$ LENG ####### # 1712.5643 dr; save all; CPU[]; CPU time so far =2.4023208618164062 sec susp;

19

slide-25
SLIDE 25

Dispersion suppressor (RFSTR)

! Mathcing the straight section for the RF. Similar to IRSTR. use RFSTR; ins; fit FR EX 0 EPX 0; fit QRF QRF.2 ax 0 ay 0 bx 1 by 1 nx 0.25 ny 0.25; fit b1+1 b1.2 leng lrf; fit ^^^ $$$ bxm 200 bym 200; free LSB LLB LRF QSB* QR*; LLB min 7; go; Iterations Residual Method Reduction Variables 3 853.7 (NEWTON) 6.2500E-02 9 4 467.1 (NEWTON) 0.2500 9 8 423.4 (NEWTON) 8.3365E-02 9 9 295.1 (NEWTON) 0.3335 9 10 129.5 (NEWTON) 1.000 9 12 49.59 (NEWTON) 7.9829E-02 9 13 21.79 (NEWTON) 0.3193 9 15 18.35 (NEWTON) 6.9989E-02 9 16 11.55 (NEWTON) 0.2800 9 17 8.441 (NEWTON) 1.000 10 19 7.000 (NEWTON) 7.1966E-02 9 20 3.355 (NEWTON) 0.2879 9 22 1.513 (NEWTON) 0.3698 9 23 0.2654 (NEWTON) 1.000 10 24 6.1099E-02 (NEWTON) 1.000 10 25 3.5329E-03 (NEWTON) 1.000 10 26 2.9092E-06 (NEWTON) 1.000 10 27 3.4641E-13 (NEWTON) 1.000 10

  • Matched. ( 2.8320E-25) DP = 0.01000 DP0 = 0.00000 ExponentOfResidual = 2.0

OffMomentumWeight = 1.000 LX03.2/B1.2 LENG 1600 1 1600.0000 FR.1 EX 0 1 4.398E-17 FR.1 EPX 0 1 1.953E-18 QRF.1/QRF.2 AX 0 1 2.589E-13 QRF.1/QRF.2 BX 1 1 1.000000 QRF.1/QRF.2 NX .25 1 .250000 QRF.1/QRF.2 AY 0 1 3.247E-13 QRF.1/QRF.2 BY 1 1 1.000000 QRF.1/QRF.2 NY .25 1 .250000 $$$ AX ####### # 2.393117 $$$ BXM 200 1 87.356302 $$$ NX ####### # 5.079165 $$$ AY ####### # -.544201 $$$ BYM 200 1 16.831725 $$$ NY ####### # 5.421611 $$$ LENG ####### # 1712.5643 dr; save all; CPU[]; CPU time so far =2.4023208618164062 sec susp;

FR

19

slide-26
SLIDE 26

Constructing the 1/4 ring (QRING)

! Construct the quarter ring. QRING=BeamLine[ExtractBeamLine[IRSTR], ARC,ExtractBeamLine[RFSTR],-ARC]; use QRING; cell; cal;

  • Matched. ( 0.000 ) DP = 0.01000 DP0 = 0.00000 ExponentOfResidual = 2.0

OffMomentumWeight = 1.000 $$$ f AX ####### # 2.393117 $$$ f BX ####### # 87.356302 $$$ f NX ####### # 105.13634 $$$ f AY ####### # -.544201 $$$ f BY ####### # 16.831725 $$$ f NY ####### # 105.82634 $$$ f LENG ####### # 23910.950 {nx0,ny0}=Round[Twiss[{"NX","NY"},"$$$"]/2/Pi]+{0.19,0.24}; ! Give the ring tune. fit FR; ax @ bx @ ay @ by @; ! set the alphas and betas at FR to the saved values. fit; nx nx0 ny ny0; ! Set the ring tune. fit QMF QMF.2; ax 0 ay 0 bx 1 by 1; ! keep the periodic condition of RF FODO. fix *; free qm* qsa{2345}; ! variables are quads in the dispersion free part in the IR. go; Iterations Residual Method Reduction Variables 2 1.6626E-03 (NEWTON) 1.000 6 3 6.1635E-07 (NEWTON) 1.000 6 4 2.0771E-13 (NEWTON) 1.000 6

  • Matched. ( 5.0183E-22) DP = 0.01000 DP0 = 0.00000 ExponentOfResidual = 2.0

OffMomentumWeight = 1.000 QMF.1/QMF.f AX 0 1 2.145E-13 QMF.1/QMF.f BX 1 1 1.000000 QMF.1/QMF.f AY 0 1 -8.47E-14 QMF.1/QMF.f BY 1 1 1.000000 FR.1 AX -.49101 1 -.491012 FR.1 BX 27.40541 1 27.405411 FR.1 AY 2.40146 1 2.401459 FR.1 BY 149.4268 1 149.42683 $$$ AX ####### # 2.393117 $$$ BX ####### # 87.356302 $$$ NX 105.19 1 105.19000 $$$ AY ####### # -.544201 $$$ BY ####### # 16.831725 $$$ NY 106.24 1 106.24000 $$$ LENG ####### # 23910.950 dr; CPU[]; CPU time so far =2.9479730129241943 sec susp;

20

slide-27
SLIDE 27

Constructing the 1/4 ring (QRING)

! Construct the quarter ring. QRING=BeamLine[ExtractBeamLine[IRSTR], ARC,ExtractBeamLine[RFSTR],-ARC]; use QRING; cell; cal;

  • Matched. ( 0.000 ) DP = 0.01000 DP0 = 0.00000 ExponentOfResidual = 2.0

OffMomentumWeight = 1.000 $$$ f AX ####### # 2.393117 $$$ f BX ####### # 87.356302 $$$ f NX ####### # 105.13634 $$$ f AY ####### # -.544201 $$$ f BY ####### # 16.831725 $$$ f NY ####### # 105.82634 $$$ f LENG ####### # 23910.950 {nx0,ny0}=Round[Twiss[{"NX","NY"},"$$$"]/2/Pi]+{0.19,0.24}; ! Give the ring tune. fit FR; ax @ bx @ ay @ by @; ! set the alphas and betas at FR to the saved values. fit; nx nx0 ny ny0; ! Set the ring tune. fit QMF QMF.2; ax 0 ay 0 bx 1 by 1; ! keep the periodic condition of RF FODO. fix *; free qm* qsa{2345}; ! variables are quads in the dispersion free part in the IR. go; Iterations Residual Method Reduction Variables 2 1.6626E-03 (NEWTON) 1.000 6 3 6.1635E-07 (NEWTON) 1.000 6 4 2.0771E-13 (NEWTON) 1.000 6

  • Matched. ( 5.0183E-22) DP = 0.01000 DP0 = 0.00000 ExponentOfResidual = 2.0

OffMomentumWeight = 1.000 QMF.1/QMF.f AX 0 1 2.145E-13 QMF.1/QMF.f BX 1 1 1.000000 QMF.1/QMF.f AY 0 1 -8.47E-14 QMF.1/QMF.f BY 1 1 1.000000 FR.1 AX -.49101 1 -.491012 FR.1 BX 27.40541 1 27.405411 FR.1 AY 2.40146 1 2.401459 FR.1 BY 149.4268 1 149.42683 $$$ AX ####### # 2.393117 $$$ BX ####### # 87.356302 $$$ NX 105.19 1 105.19000 $$$ AY ####### # -.544201 $$$ BY ####### # 16.831725 $$$ NY 106.24 1 106.24000 $$$ LENG ####### # 23910.950 dr; CPU[]; CPU time so far =2.9479730129241943 sec susp;

IRSTR RFSTR 20

slide-28
SLIDE 28

Determine the RF voltage

! determine the RF voltage by adjusting the bunch length rfsw; ! turn on RF u0=EnergyLossU0/.Emittance[]; ! Energy loss per 1/4 ring by SR nrf=Length[LINE["POSITION","CAV.*"]]; ! number of CAVs LINE["VOLT","CAV"]=u0*1.1/nrf; ! set the voltage 10% higher that u0 rej total; ! reject entire matching conditions. FitFunction:=(BunchLength/.Emittance[])/sigz0-1; ! A function to match 0 in the matching. fix *; free cav; ! VOLT of CAV is the only variable. go; Iterations Residual Method Reduction Variables 2 4.6570E-04 (NEWTON) 1.000 1 3 9.6792E-07 (NEWTON) 1.000 1 4 3.7252E-12 (NEWTON) 1.000 1 5 5.1954E-20 (NEWTON) 1.000 1

  • Matched. ( 2.1640E-27) DP = 0.01000 DP0 = 0.00000 ExponentOfResidual = 2.0

OffMomentumWeight = 1.000 $$$ AX ####### # 2.393117 $$$ BX ####### # 87.356302 $$$ NX ####### # 105.19000 $$$ AY ####### # -.544201 $$$ BY ####### # 16.831725 $$$ NY ####### # 106.24000 $$$ LENG ####### # 23910.950 $$$ FUN1 0.0 1 -4.65E-14 emit; ! calculate the resulting emittance. CPU[]; CPU time so far =3.4472999572753906 sec susp;

21

slide-29
SLIDE 29

Determine the RF voltage

! determine the RF voltage by adjusting the bunch length rfsw; ! turn on RF u0=EnergyLossU0/.Emittance[]; ! Energy loss per 1/4 ring by SR nrf=Length[LINE["POSITION","CAV.*"]]; ! number of CAVs LINE["VOLT","CAV"]=u0*1.1/nrf; ! set the voltage 10% higher that u0 rej total; ! reject entire matching conditions. FitFunction:=(BunchLength/.Emittance[])/sigz0-1; ! A function to match 0 in the matching. fix *; free cav; ! VOLT of CAV is the only variable. go; Iterations Residual Method Reduction Variables 2 4.6570E-04 (NEWTON) 1.000 1 3 9.6792E-07 (NEWTON) 1.000 1 4 3.7252E-12 (NEWTON) 1.000 1 5 5.1954E-20 (NEWTON) 1.000 1

  • Matched. ( 2.1640E-27) DP = 0.01000 DP0 = 0.00000 ExponentOfResidual = 2.0

OffMomentumWeight = 1.000 $$$ AX ####### # 2.393117 $$$ BX ####### # 87.356302 $$$ NX ####### # 105.19000 $$$ AY ####### # -.544201 $$$ BY ####### # 16.831725 $$$ NY ####### # 106.24000 $$$ LENG ####### # 23910.950 $$$ FUN1 0.0 1 -4.65E-14 emit; ! calculate the resulting emittance. CPU[]; CPU time so far =3.4472999572753906 sec susp;

Closed orbit: x px/p0 y py/p0 z dp/p0 Entrance : -1.1E-16 4.70E-18 .000000 .000000 .000000 .000000 Exit : 9.78E-17 -1.1E-18 .000000 .000000 -1.1E-18 .000000 Extended Twiss Parameters: AX: 2.393117 BX: 87.35630 ZX: -1.2E-14 EX: .146602 PSIX: -4.5E-18 ZPX: 2.47E-16 EPX: .000000 R1: .000000 R2: .000000 AY: -.544201 BY: 16.83172 ZY: .000000 EY: .000000 R3: .000000 R4: .000000 PSIY: .000000 ZPY: .000000 EPY: .000000 AZ: -9.00E-6 BZ: 1.588722 PSIZ: 1.16E-17 Units: B(X,Y,Z), E(X,Y), R2: m | PSI(X,Y,Z): radian | ZP(X,Y), R3: 1/m Design momentum P0 = 182.50000 GeV Revolution freq. f0 = 12537.872 Hz Energy loss per turn U0 = 2483.5387 MV Effective voltage Vc = 2858.8474 MV Equilibrium position dz = 125.55946 mm Momentum compact. alpha = 6.8908E-6 Orbit dilation dl = .0000000 mm Effective harmonic # h = 31903.338 Bucket height dV/P0 = .0452546 Synchrotron frequency = 206.57898 Hz Imag.tune: 0.0000000 0.0000000 -0.0000000 Real tune: 0.1900000 0.2400000 -0.0164764 Damping per one revolution: X : -6.781248E-03 Y : -6.781173E-03 Z : -1.342534E-02 Damping time (sec): X : 1.176160E-02 Y : 1.176173E-02 Z : 5.940882E-03 Tune shift due to radiation: X : 4.972387E-05 Y : 5.030054E-05 Z : 1.259088E-06 Damping partition number: X : 1.0051 Y : 1.0051 Z : 1.9898 Emittance X = 1.39626E-9 m Emittance Y = .00000000 m Emittance Z = 3.93399E-6 m Energy spread = .00157359 Bunch Length = 2.50000000 mm Beam tilt = .00000000 rad Beam size xi = .41855992 mm Beam size eta = .00000000 mm Nominal spin tune = 414.162328 Polarization time = .0000000 min

21

slide-30
SLIDE 30

Chromaticity correction

! Chromaticity correction by 2 family sexts. rej total; FitFunction=.; ! Clear FitFunction. DP=0.01; ! Width of off-momentum matching. fit ; nx nx0 4 ny ny0 4; ! set the goals at -DP, -DP/2, +DP/2, DP. vary k2 s*; ! set K2 as the default variable of S*. fix * free s*; ! Variables are K2 of S* (in this case SF and SD). S* minmax 10; ! Set the range of K2, -10 <= K2 <= 10. go; Iterations Residual Method Reduction Variables 2 4.3071E-02 (NEWTON) 1.000 2 *****qcod---> Closed orbit not found Residual = 4.3038E-02 DP = 0.01000 DP0 = 0.00000 ExponentOfResidual = 2.0 OffMomentumWeight = 1.000 DP -.010000 -.005000 .000000 .005000 .010000

  • Res. .024159 .001638 .000000 7.6378E-4 .016477

$$$ f AX ####### # 2.477698 2.459011 2.393117 2.363464 2.515413 $$$ f BX ####### # 93.172983 90.589618 87.356302 86.842796 93.685701 $$$ f NX 105.19 4 105.25585 105.20587 105.19000 105.20361 105.24409 $$$ f AY ####### # -.528679 -.512670 -.544201 -.533359 -.308512 $$$ f BY ####### # 17.753163 16.539051 16.831725 18.088073 19.632951 $$$ f NY 106.24 4 106.32889 106.26404 106.24000 106.25420 106.31362 $$$ f LENG ####### # 23910.950 save all; fitp 1; ! set the fit point to 1 (ie., only on the center). ! ! Define a function to obtain tune as a unction of momentum offset.

  • ffmtune[x_]:={

DP0=x; ! Set the momentum offset. FFS["CALC;"]; ! Calculate optics: FFS is a function to execute FFS commands in a script. FractionalPart[Twiss["NX","$$$"]/2/Pi], ! Twiss["NX",_] returns in radian. FractionalPart[Twiss["NY","$$$"]/2/Pi]}; ! d=Table[Flatten[{x*100,offmtune[x]}],{x,-0.01,0.01,0.001}]; ! Table of {dp, nx(dp), ny (dp)}. DP0=0; Show[ ! Draw two plots in a same frame. ListPlot[d[[,{1,3}]], DisplayFunction->Identity, ! this is to avoid unnecessary intermediate output of a plot. PointColor->"tomato",Legend->"`fn`n`dy"], ListPlot[d[[,{1,2}]], DisplayFunction->Identity, PointColor->"dark slate blue",Legend->"`fn`n`dx"], FrameLabel->{"`fD`np/p`d0`n (%)","`fn`n`dx`n, `fn`n`dy`n"}]; Update[]; ! The draw on X is only updated by Update[].

22

slide-31
SLIDE 31

Chromaticity correction

! Chromaticity correction by 2 family sexts. rej total; FitFunction=.; ! Clear FitFunction. DP=0.01; ! Width of off-momentum matching. fit ; nx nx0 4 ny ny0 4; ! set the goals at -DP, -DP/2, +DP/2, DP. vary k2 s*; ! set K2 as the default variable of S*. fix * free s*; ! Variables are K2 of S* (in this case SF and SD). S* minmax 10; ! Set the range of K2, -10 <= K2 <= 10. go; Iterations Residual Method Reduction Variables 2 4.3071E-02 (NEWTON) 1.000 2 *****qcod---> Closed orbit not found Residual = 4.3038E-02 DP = 0.01000 DP0 = 0.00000 ExponentOfResidual = 2.0 OffMomentumWeight = 1.000 DP -.010000 -.005000 .000000 .005000 .010000

  • Res. .024159 .001638 .000000 7.6378E-4 .016477

$$$ f AX ####### # 2.477698 2.459011 2.393117 2.363464 2.515413 $$$ f BX ####### # 93.172983 90.589618 87.356302 86.842796 93.685701 $$$ f NX 105.19 4 105.25585 105.20587 105.19000 105.20361 105.24409 $$$ f AY ####### # -.528679 -.512670 -.544201 -.533359 -.308512 $$$ f BY ####### # 17.753163 16.539051 16.831725 18.088073 19.632951 $$$ f NY 106.24 4 106.32889 106.26404 106.24000 106.25420 106.31362 $$$ f LENG ####### # 23910.950 save all; fitp 1; ! set the fit point to 1 (ie., only on the center). ! ! Define a function to obtain tune as a unction of momentum offset.

  • ffmtune[x_]:={

DP0=x; ! Set the momentum offset. FFS["CALC;"]; ! Calculate optics: FFS is a function to execute FFS commands in a script. FractionalPart[Twiss["NX","$$$"]/2/Pi], ! Twiss["NX",_] returns in radian. FractionalPart[Twiss["NY","$$$"]/2/Pi]}; ! d=Table[Flatten[{x*100,offmtune[x]}],{x,-0.01,0.01,0.001}]; ! Table of {dp, nx(dp), ny (dp)}. DP0=0; Show[ ! Draw two plots in a same frame. ListPlot[d[[,{1,3}]], DisplayFunction->Identity, ! this is to avoid unnecessary intermediate output of a plot. PointColor->"tomato",Legend->"`fn`n`dy"], ListPlot[d[[,{1,2}]], DisplayFunction->Identity, PointColor->"dark slate blue",Legend->"`fn`n`dx"], FrameLabel->{"`fD`np/p`d0`n (%)","`fn`n`dx`n, `fn`n`dy`n"}]; Update[]; ! The draw on X is only updated by Update[].

22

slide-32
SLIDE 32

Type out results of matching

t type; ! print out all elements. ; DRIFT LSA =(L =27.827324531000873 ) LX03 =(L =.3 ) LLA =(L =8.406987135471086 ) LM =(L =40.99876697609335 ) LSX =(L =3.4 ) LSB =(L =29.67230115012391 ) LLB =(L =7.013334811352679 ) LRF =(L =21.092941046057103 ) ; BEND B1 =(L =20.30988395956092 ANGLE =.002056016134548294 E1 =.5 E2 =.5 ) ; QUAD QSA1 =(L =3 K1 =-.08264893928929773 ) QSA2 =(L =3 K1 =.08079624695663988 ) QSA3 =(L =3 K1 =-.08177699990926882 ) QSA4 =(L =3 K1 =.02095441182812618 ) QSA5 =(L =3 K1 =-.021437300799329224 ) QMF =(L =3 K1 =.03350951419732815 ) QMD =(L =3 K1 =-.03505490711475412 ) QF =(L =3 K1 =.054419748203187276 ) QD =(L =3 K1 =-.054419534645932965 ) QSB1 =(L =3 K1 =-.07371474392831429 ) QSB2 =(L =3 K1 =.07210972477242429 ) QSB3 =(L =3 K1 =-.019708715597954226 ) QSB4 =(L =3 K1 =-.04996670314280976 ) QSB5 =(L =3 K1 =-.001028911614007234 ) QRF =(L =3 K1 =.032015762533100754 ) QRD =(L =3 K1 =-.03201576253310072 ) ; MULT SF =(L =2.8 K2 =1.3178791328831356 ) SD =(L =2.8 K2 =-2.3972879194522356 ) ; CAVI CAV =(VOLT =84083747.95218842 FREQ =4e+08 ) ; MARK F1 =(AX =-2.515413148039183 BX =93.68570076863331 AY =.3085121486615651 BY =19.632950955371694 EX =.1481981525420287 EPX =.00427818386335201 DX =.001472744892382706 DPX =4.2163572987006186e-05 BZ =1 DP =.01 SIGMAZ =.002499999999999884 EMITX =1.3962618596826148e-09 EMITY =1e-12 ) FM =(AX =.5991598077943981 BX =26.41254381927983 PSIX =2.5779887899252514 AY =-2.300825162030852 BY =123.47497148278254 PSIY =3.6304826195532995 EX =-.002559218762956161 EPX =.00012002526247260396 DX =-1.1564210592356231e-05 DPX =6.048104616155994e-07 DZ =-1.804162225482094e-07 DDP =.01 BZ =1 DP =.01 EMITX =1.3962618596826148e-09 EMITY =1e-12 ) FR =(AX =-.3324773597155047 BX =26.287450736091063 PSIX =333.24231571643577 AY =2.4751313294665804 BY =139.04851415966172 PSIY =338.84746908314304 EX =.0001265574844509312 EPX =1.0623821129893204e-05 DX =-6.366270352747352e-06 DPX =-2.584157482590642e-07 DZ =-.0008274726403451104 DDP =.01 BZ =1 DP =.01 EMITX =1.3962618596826148e-09 EMITY =1e-12 ) ; CPU[]; CPU time so far =4.58736515045166 sec susp;

23

slide-33
SLIDE 33

An example of orbit correction

! Define a Class OrbitCorrection OrbitCorrection=Class[{},{},{seed=3,cor="S*",mon="Q*",al="Q*", ! Instance variables with some initial values circ,pc,pm,pa,gcut=4,nx0,ny0,mx,my,tol=1e-2,em}, Constructor[]:=( ! Constructor to be called when an instance is defined circ=LINE["S","$$$"]-LINE["S","^^^"]; ! ring circumference {pc,pm,pa}=LINE["POSITION",{cor,mon,al}]; ! positions of correctors, bpms, and misaligned componentss. LINE["DX",pa]*=0; ! clear misalignments and correctors. LINE["DX",pa]*=0; LINE["K0",pc]*=0; LINE["SK0",pc]*=0; FFS["CALC4D;NORADCOD;CELL;CALC"]; ! calculate the design optics & emittance em=Emittance[]; {nx0,ny0}=Twiss[{"NX","NY"},"$$$"]; ! design tune With[{nx0,ny0,alpha=MomentumCompaction/.em}, mx=Outer[(Sqrt[Twiss["BX",#2]]* Cos[Abs[Twiss["NX",#]-Twiss["NX",#2]]-nx0/2])&,pm,pc]* Sqrt[Twiss["BX",pm]]/2/Sin[nx0/2]- ! horizontal response matrix Outer[Times,Twiss["EX",pm],Twiss["EX",pc]]/alpha/circ; ! dispersion term AppendTo[mx,Twiss["EX",pc]]; ! circumference correction my=-Outer[(Sqrt[Twiss["BY",#2]]* ! vertical response matrix Cos[Abs[Twiss["NY",#]-Twiss["NY",#2]]-ny0/2])&,pm,pc]* Sqrt[Twiss["BY",pm]]/2/Sin[ny0/2]]); Misalign[{dx_,dy_}]:=( SeedRandom[seed]; GCUT=gcut; LINE["DX",pa]=dx*GaussRandom[Length[pa]]; ! set misalignments LINE["DY",pa]=dy*GaussRandom[Length[pa]]; FFS["CALC NOEXP;REF;"]); ! NOEXP is necessary for independent misalignments ! optics is stored as the Reference optics Correct[]:=Module[{{dx,dy}=Twiss[{"DX","DY"},pm],kx,ky}, kx=LinearSolve[mx,Append[dx,Twiss["DZ","$$$"]-Twiss["DZ","^^^"]], Tolerance->tol]; ! horizontal correction with circumference adjustment ky=LinearSolve[my,dy,Tolerance->tol]; !vertical correction LINE["K0",pc]=kx; LINE["SK0",pc]=ky; FFS["CALC6D;CALC NOEXP;"]; ! optics after correction ]; Plot[]:=(OpticsPlot[{{"RDX","DX"},{"RDY","DY"}},Lattice->False,Names->""]; Update[]); ];

  • c=OrbitCorrection[]; ! Define an instance of OrbitCorrection
  • c@Misalign[{1e-5,1e-5}]; ! call an instance function oc@Misalign
  • c@Correct[]; ! call an instance function oc@Correct
  • c@Plot[]; ! call an instance function oc@Plot

CPU[]; CPU time so far =6.177183151245117 sec susp;

24

slide-34
SLIDE 34

An example of orbit correction

! Define a Class OrbitCorrection OrbitCorrection=Class[{},{},{seed=3,cor="S*",mon="Q*",al="Q*", ! Instance variables with some initial values circ,pc,pm,pa,gcut=4,nx0,ny0,mx,my,tol=1e-2,em}, Constructor[]:=( ! Constructor to be called when an instance is defined circ=LINE["S","$$$"]-LINE["S","^^^"]; ! ring circumference {pc,pm,pa}=LINE["POSITION",{cor,mon,al}]; ! positions of correctors, bpms, and misaligned componentss. LINE["DX",pa]*=0; ! clear misalignments and correctors. LINE["DX",pa]*=0; LINE["K0",pc]*=0; LINE["SK0",pc]*=0; FFS["CALC4D;NORADCOD;CELL;CALC"]; ! calculate the design optics & emittance em=Emittance[]; {nx0,ny0}=Twiss[{"NX","NY"},"$$$"]; ! design tune With[{nx0,ny0,alpha=MomentumCompaction/.em}, mx=Outer[(Sqrt[Twiss["BX",#2]]* Cos[Abs[Twiss["NX",#]-Twiss["NX",#2]]-nx0/2])&,pm,pc]* Sqrt[Twiss["BX",pm]]/2/Sin[nx0/2]- ! horizontal response matrix Outer[Times,Twiss["EX",pm],Twiss["EX",pc]]/alpha/circ; ! dispersion term AppendTo[mx,Twiss["EX",pc]]; ! circumference correction my=-Outer[(Sqrt[Twiss["BY",#2]]* ! vertical response matrix Cos[Abs[Twiss["NY",#]-Twiss["NY",#2]]-ny0/2])&,pm,pc]* Sqrt[Twiss["BY",pm]]/2/Sin[ny0/2]]); Misalign[{dx_,dy_}]:=( SeedRandom[seed]; GCUT=gcut; LINE["DX",pa]=dx*GaussRandom[Length[pa]]; ! set misalignments LINE["DY",pa]=dy*GaussRandom[Length[pa]]; FFS["CALC NOEXP;REF;"]); ! NOEXP is necessary for independent misalignments ! optics is stored as the Reference optics Correct[]:=Module[{{dx,dy}=Twiss[{"DX","DY"},pm],kx,ky}, kx=LinearSolve[mx,Append[dx,Twiss["DZ","$$$"]-Twiss["DZ","^^^"]], Tolerance->tol]; ! horizontal correction with circumference adjustment ky=LinearSolve[my,dy,Tolerance->tol]; !vertical correction LINE["K0",pc]=kx; LINE["SK0",pc]=ky; FFS["CALC6D;CALC NOEXP;"]; ! optics after correction ]; Plot[]:=(OpticsPlot[{{"RDX","DX"},{"RDY","DY"}},Lattice->False,Names->""]; Update[]); ];

  • c=OrbitCorrection[]; ! Define an instance of OrbitCorrection
  • c@Misalign[{1e-5,1e-5}]; ! call an instance function oc@Misalign
  • c@Correct[]; ! call an instance function oc@Correct
  • c@Plot[]; ! call an instance function oc@Plot

CPU[]; CPU time so far =6.177183151245117 sec susp;

24

slide-35
SLIDE 35

Class

C = Class[ {c1, …}, ! Parent classes {V1[ = value], …}, ! Class variables (common to all instances) {v1[ = value], …}, ! Instance variables [Constructor[ [arg…, opt…,] ] := body; ] ! Constructor; called when an instance is

  • defined. The initial values of instance variables can be set by opt as v1 -> value.

fun[ [arg…] ]:= body; ! instance function fun[ [arg…] ]^:= body; ! instance function with upvalue ! functions can be defined within With[]. … ]; c=C[]; ! define of an instance c of Class C c=.; ! delete an instance c c@v ! refer a variable c@fun ! refer a function

SAD’s Class, first designed by N. Akasaka, provides an easy tool for an object-oriented environment with:

  • independent name space
  • dynamical generation & deletion of instances
  • inheritance

Class is suitable to write a portable library avoiding name conflicts.

25

slide-36
SLIDE 36

Dynamic aperture with errors, corrections, “tapering”

! ! Dynamic aperture ! RAD; ! Turn on radiation in all elements. NOFLUC; ! Turn off quantum effects. RADCOD; ! calculate orbit considering radiation loss RADTAPER; ! automatic tapering of all magnets according to local energy of the closed orbit. emit; Closed orbit: x px/p0 y py/p0 z dp/p0 Entrance : -4.08E-5 1.087E-6 5.047E-6 1.447E-6 2.101E-5 .000000 Exit : -4.18E-5 1.134E-6 5.003E-6 1.444E-6 2.104E-5 -3.57E-7 Extended Twiss Parameters: AX: 2.452196 BX: 90.05014 ZX: -3.53E-4 EX: .149266 PSIX: 4.686E-9 ZPX: 8.144E-6 EPX: -.003352 R1: .001485 R2: 1.129611 AY: -.530327 BY: 16.71380 ZY: 8.087E-5 EY: -.003352 R3: -.003983 R4: -.080978 PSIY: 1.004E-8 ZPY: 5.716E-7 EPY: -3.42E-4 AZ: -1.95E-4 BZ: 1.589094 PSIZ: -5.0E-17 Units: B(X,Y,Z), E(X,Y), R2: m | PSI(X,Y,Z): radian | ZP(X,Y), R3: 1/m Design momentum P0 = 182.50000 GeV Revolution freq. f0 = 12537.872 Hz Energy loss per turn U0 = 2483.9712 MV Effective voltage Vc = 2858.8474 MV Equilibrium position dz = 125.57012 mm Momentum compact. alpha = 6.8909E-6 Orbit dilation dl = .0014774 mm Effective harmonic # h = 31903.338 Bucket height dV/P0 = .0452151 Synchrotron frequency = 206.53317 Hz Imag.tune: 0.0000000 0.0000000 -0.0000000 Real tune: 0.1873215 0.2396186 -0.0164727 Damping per one revolution: X : -6.792488E-03 Y : -6.782806E-03 Z : -1.341755E-02 Damping time (sec): X : 1.174214E-02 Y : 1.175890E-02 Z : 5.944328E-03 Tune shift due to radiation: X : 4.726611E-05 Y : 4.912861E-05 Z : 2.732044E-06 Damping partition number: X : 1.0066 Y : 1.0051 Z : 1.9883 Emittance X = 1.39088E-9 m Emittance Y = 6.9508E-12 m Emittance Z = 3.93943E-6 m Energy spread = .00157445 Bunch Length = 2.50209352 mm Beam tilt = -.02224074 rad Beam size xi = .42442597 mm Beam size eta = .01249052 mm Nominal spin tune = 414.162328 Polarization time = .0000000 min

26

slide-37
SLIDE 37

Dynamic aperture results (Z-X)

nturn=180; ! Number of turns. DynamicApertureSurvey[ ! DA on Z-X plane. {{0,50},{0,50*Sqrt[MINCOUP]}, ! The horizontal and vertical ranges to survey. Table[dp,{dp,-0.025/SIGE,0.025/SIGE,0.002/SIGE}]}, ! The initial momentum offsets. nturn,Output->$Output, ! outputs to the default output stream. Damping->False]; ! No artificial damping. Turns =180 Maximum number of particles =364 Range Xmin: 0.000 Xmax: 50.000 (Ymin: 0.000 Ymax: 5.000) Zmin: -15.883 Zmax: 15.883 Display: 10 turns/character (A lot of warning messages may appear) NZ 0----|----1----|----2----|----3----|----4----|----5

  • 15.88 18 ***********EEEEEEE61. 1111EE . . .
  • 14.61 24 *****************EEEEEEE . . .
  • 13.34 18 ***********EEEEEEE7EEEEE 4 . . .
  • 12.07 15 ********EEEEEEE6EEE22EE1 1 . . .
  • 10.80 24 *****************EEEEEEE3E6 . . .
  • 9.53 19 ************EEEEEEE1EEEEEE212 . 1 . .
  • 8.26 22 ***************EEEEEEE211111EEEE3 1 . .
  • 6.99 24 *****************EEEEEEE11 1. 11 1127 . .
  • 5.72 23 ****************EEEEEEE117E1 . 1 1EE 11 .
  • 4.45 24 *****************EEEEEEE2123E71 . .
  • 3.18 25 ******************EEEEEEE221111111 . .
  • 1.91 27 ********************EEEEEEE1211 1 . .
  • 0.64 29 **********************EEEEEEE21E11 21 . .

0.64 27 ********************EEEEEEE1E2111911 . . 1.91 28 *********************EEEEEEEA231 11 11 . . 3.18 26 *******************EEEEEEE4E1EE111 1 .111 . 4.45 29 **********************EEEEEEE1122E11211E. 1 1 . 5.72 30 ***********************EEEEEEE7E141E1111111111 . 6.99 28 *********************EEEEEEE22E12A11111 113E1 . 8.26 29 **********************EEEEEEE3E1E1121111111 . 9.53 31 ************************EEEEEEE21E111 11 11 . 10.80 13 ******EEEEEEE9EEEEE3EEE14E233EE2111 1 . 1 . 12.07 7 EEEEEEE64EEE3E622332EEE11112241EE2 . . 13.34 6 EEEEEE2EE2221E922221223E111E111112 11 . . 14.61 7 EEEEEEE1119212EE222111112111 . EE . . 15.88 11 ****EEEEEEE222E1222E3211 11 . 121 . . NZ 0----|----1----|----2----|----3----|----4----|----5 Score: 564

Δp/σp Δx/σx, Δy/σy

27

slide-38
SLIDE 38

Dynamic aperture results (X-Y)

DynamicApertureSurvey[ ! DA on X-Y plane. {Table[x,{x,-40,40,2}],{0,400*Sqrt[MINCOUP]},{0,0}}, nturn,Axes->"XY", Output->$Output, Damping->False]; Turns =180 Maximum number of particles =574 Range Ymin: 0.000 Ymax: 40.000 (Zmin: 0.000 Zmax: 0.000) Xmin: -40.000 Xmax: 40.000 Display: 10 turns/character NX 0----|----1----|----2----|----3----|----4----|----5

  • 40.00 0 . 2 . . . .
  • 38.00 0 E11111EE . . . .
  • 36.00 0 . 111 1 8 . 1 . .
  • 34.00 0 . .E61 . . .
  • 32.00 0 11111112218E721 1 . 1 1 . . 1 .
  • 30.00 0 11111EE11 . 1116111 1 .1 E . .
  • 28.00 0 912EEE2111161111111 . 11 1 11 121 3 . 1 .
  • 26.00 12 *****EEEEEEE173E111111E1111 1 11 . E 4.
  • 24.00 15 ********EEEEEEE2EE211E1111732 . 15 1E . 1 .
  • 22.00 19 ************EEEEEEE21E11E1111111 1 11E1. 8 .
  • 20.00 22 ***************EEEEEEE11123E31111 6E .
  • 18.00 23 ****************EEEEEEE215E11E1 11 1 16E 1 .
  • 16.00 25 ******************EEEEEEE21E112E 111 1 111 6 .
  • 14.00 25 ******************EEEEEEE2E12111E111 1 . 11 .
  • 12.00 26 *******************EEEEEEE2E12111E 31 1. 1 .
  • 10.00 27 ********************EEEEEEE121111341111 . 1 .
  • 8.00 28 *********************EEEEEEE191111E1111 .1 .
  • 6.00 29 **********************EEEEEEE241111E1111. .
  • 4.00 29 **********************EEEEEEE22E111EE111. A .
  • 2.00 30 ***********************EEEEEEE2E311EE111. .

0.00 30 ***********************EEEEEEE1E1111EE121 1 . 2.00 30 ***********************EEEEEEE1E2111E211. 2 . 4.00 29 **********************EEEEEEE21221118E11. 1 . 6.00 28 *********************EEEEEEE212E1711EE116 E1 . 8.00 27 ********************EEEEEEE212E41111EE1 . 41 1. 10.00 26 *******************EEEEEEE41234111EEE11 . 11 . 12.00 25 ******************EEEEEEE411E51116EE11 . 1 1 . 14.00 24 *****************EEEEEEE221E2111EEE11 E1. . 16.00 23 ****************EEEEEEE273E11115E111 1 . . 18.00 25 ******************EEEEEEE4112E211 11 1. . 20.00 23 ****************EEEEEEE2E113E11 111 . . 22.00 21 **************EEEEEEE111EEE11 . 111 . 1 . 24.00 15 ********EEEEEEE2E112EEEE1111 . 1111 . . 26.00 2 EE3E3EEE321116E21115311111 1 .11 1. . 28.00 0 2EEEE2E1111E1EE211111111 171 . . 30.00 6 EEEEEE21111111111711. 111171 . . . 32.00 0 111111E2E1212111 111 81 . . . 34.00 0 111111111 . 11 1191 . 1 . . 36.00 0 1 . 11 1 . 1 . . 38.00 0 11 3 . 1. . . 40.00 0 . . 1 . . . NX 0----|----1----|----2----|----3----|----4----|----5 Score: 644 CPU[]; CPU time so far =54.2899055480957 sec susp;

Δx/σx Δy/σy

28

slide-39
SLIDE 39

Summary

  • An example of ring design by SAD has been presented using a toy

model of the main booster for FCC-ee.

  • Optics matching of FODO cells, straight sections and the arc,

emittance/bunch length adjustments, chromaticity correction, misalignment & orbit correction, and dynamic aperture survey have been done in a single SAD deck from scratch.

  • SAD uses about 55 seconds of the CPU time for above tasks, on a

notebook (this time is for the main thread only).

29