Optimization of dynamic aperture by TESLA (a genetic algorithm code)

advertisement
Optimization of dynamic aperture
by TESLA
for double mini-by lattice in TPS
Mau-Sen Chiu
2012/03/14
Beam Dynamics Group, NSRRC
Outline
• Introduction
- Double mini-by lattice in TPS.
• Multi-objective genetic algorithm
• Optimization of dynamic aperture (DA) by TESLA
- Check 268 sets of solutions after completion: DA, tune shift with momentum and tune
shift with amplitude.
- Pick up the best one to calculate frequency map and Touschek lifetime.
• Conclusion
Introduction
TPS Storage Ring Parameters
Circumference
518.4 (m)
Nominal energy
3.0 GeV
Betatron tune
Natural chromaticity
RF frequency
26.18/13.28
Locations of the double mini-by lattice
TPS Storage ring
-75/-26
499.654
Harmonic number
864
Natural emittance
1.6 nm-rad
Energy spread
8.86E-04
Energy loss per turn
853 keV
7m X 18
12m X 6
Purpose: Install two small gap IDs
in tandem to obtain 4 times brightness.
Double mini-by lattice
1. Use 240 quadrupoles to match a lattice (nx/ny =26.18/12.82). 13.26-0.44
2. Add three sets of quadrupole triplet at the center of three long straights, respectively.
3. Apply p trick to match the double mini-by lattice (nx/ny = 26.18/14.26).
Q2
Q3
4.9 m
Q1
Q4
4.9 m
Q4
Q1
Q2
Q3
ny = 14.26
(m)
ny = 12.82
Q5
Purpose: Install two small gap IDs in tandem to
obtain 4 times brightness.
Q1
Q2
Q3
Q4
Q5
L (m)
K1
0.3 -1.217349
0.6
1.384064
0.3 -1.526270
0.5 -1.431159
0.6
1.681944
Multiobjective Optimization
A general multiobjective optimization problem consists of a number of objectives and
is associated with a number of inequality and equality constraints. Mathematically, the
problem can be written as follows
Minimize/Maximize
Subject to
with
fk(x)
k = 1, 2, …, K
gj(x)  0
hm(x)  0
L
U
j = 1, 2, …, J
m= 1, 2, …, K
i = 1, 2, …, N
xi  xi  xi
The variable vector x represents a set of variables xi, i = 1, 2, …, N
Ex: Optimization of dynamic aperture (DA) for double mini-by lattice in TPS
Objectives:
f1(S1, S2, …, S6, SA, SB): DA area in (x-d) plane.
f2(S1, S2, …, S6, SA, SB): Tune shift with amplitude terms.
Constraints:
Chromaticity are corrected at fixed values with SF and SD through out DA optimization.
Sextupole integral strength:
 6  b3L  6 for each family.
Genetic Algorithm
A genetic algorithm (GA) is routinely used to generate useful solutions to optimization and
search problems using techniques inspired by natural evolution, such as inheritance, crossover,
mutation, and selection.
Crossover during meiosis
Mutation of gene
What’s a gene?
Type of mutation:
point mutation, substitution,
insertion, deletion,
A gene is a segment of DNA needed
to contribute to a function.
This diagram labels a region of
only 50 or so bases as a gene.
In reality, most genes are hundreds
of times larger.
Multi-Objective Genetic Algorithm (MOGA)
1: Initialize population (first generation, random)
2: for ( int i = 2; i <= gen; i++)
{
- crossover: Within crossover probability,
apply crossover to two parents to generate two children. These two
parents are randomly chosen from the survivals of the last generation.
Otherwise, copy parents to children.
- mutation : Within mutation
probability,
apply mutation to parents to generate children.
Otherwise, do nothing.
- evaluate (children):
calculate objective functions
- merge ( parents, children):
- non-dominated sort (rank):
- select half of (parents, children) for next generation.
}
TESLA
•Author: Dr. LingYun Yang, NSLS-II, Brookhaven National Laboratory
•Algorithm: NSGA-II (Non-dominated Sorting Genetic Algorithm II)
•Parameters:
-Number of individual: 2000.
-Number of generation: 50
-Number of sextupole family: 8
-Lower and Upper bound of each sextupole family: 3 33 # L H SA
-33
0
-30
18
-48
18
-48
-3 # L H SB
30
# L H S1
0
# L H S2
48 # L H S3
-18 # L H S4
48 # L H S5
-18 # L H S6
-Crossover probability: 0.8
-Mutation probability: 0.9
-Distribution index for crossover: 3
-Distribution index for mutation: 0.3
Reference:
Tracking code development for beam dynamics optimization, L. Yang, BNL, PAC11
A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II, K. Deb et al. IEEE, 2002
Flow of MOGA in TESLA
GAloop
loop
GA
evaluate_pop (child)
1. Master prepare the input for each individual in the child population then sent it to slaves
2. Each slave : Execute DA tracking (128 turns) in (x-d) plane, calculate the DA area and tune
shift with amplitude terms. Chromaticity are corrected to a fixed value before DA tracking.
After completion, send the results back to the master.
3. Once master receive the results sent by some slave. This slave will receive another individual.
4. This process will continue till the whole population are distributed to slaves completely.
PC Cluster in NSRRC
Hardware for running TESLA
node28 ~ node37:
CPU: Intel Xeon X5550, quad core 2.66 GHz * 2
RAM: 16G ECC DDR2 RAM
node38 ~ node40:
CPU: Intel Xeon X5550, quad core 2.66 GHz * 2
RAM: 18G ECC DDR3 RAM
Total: 104 cores / 26 CPUs
2000 individuals and 50 generations takes about
10 days.
Hardware for running TRACY 2.6
node19 ~ node23:
CPU: Intel Xeon X5550, quad core 2.66 GHz * 2
RAM: 18G ECC DDR3
Total: 40 cores / 10 CPUs
Objective functions in TESLA
f1: The inverse of the sum of the on- and off-momentum DA area S in (x-d) plane.
(To transfer the maximum problem to minimum problem.)
f1  1 /[1   S (d , y  1um)]
d
f2: Square sum of tune shift with amplitude.
2
 n x   n x   n y
 
  
f 2  

 
 J x   J y   J y
2




2
3 cos(|  j k , x | pn x ) cos(|3 j k , x | 3pn x ) 
3/ 2 3/ 2 
(
b
L
)
(
b
L
)
b
b



3
j
3
k xj
xk


sin(
pn
)
sin(3pn x )
j 1 k 1
x


n y n y
1 N N


 (b3 L) j (b3 L)k b xj b xk b yj 
J y J x 8p j 1 k 1
n x
1

J x
16p
N
N
 2b xk cos(|  j k , x | pn x ) b yk cos[|  j k , x  2 j k , y | p (n x  2n y )] b yk cos[|  j k , x  2 j k , y | p (n x  2n y )]




sin(pn x )
sin p (n x  2n y )
sin p (n x  2n y )


n y
1 N N

 (b3 L) j (b3 L)k b xj b xk b yj b yk 
J y
16p j 1 k 1
 4 cos(|  j k , x | pn x ) cos[|  j k , x  2 j k , y | p (n x  2n y )] cos[|  j k , x  2 j k , y | p (n x  2n y )]




sin(
pn
)
sin
p
(
n

2
n
)
sin p (n x  2n y )


x
x
y
The Sextupole Scheme for the Swiss Light Source (SLS), 1997, Johan Bengtsson
nature log
Objective functions after generation 2
Total number of points: 2000
Each point represents a set of solution of sextupole strength.
nature log
Objective functions after generation 50
1. 286 points inside 3 regions are checked: DA (d =0, 3%, -3%), tune shift with momentum, tune shift with
amplitude (horizontal and vertical direction). Total number of figures: 286 * 6 = 1716.
2. Pick up the best solution by inspection for further analysis by frequency map and Touschek lifetime.
DA, Tune shift with momentum and amplitude
DA
calculated at x = 0, y = 0
calculated at the long straight center
Vertical
calculated at x = 0, d = 0
Horizontal
calculated at y = 0, d = 0
1% Emittance
coupling
Multipole
errors
Chamber
limit
ID kick
map
━
━
━
━
Frequency map analysis (x – d)
1% Emittance coupling
┿
Multipole errors Chamber limit ID kick map
┿
━
━
1% Emittance coupling
┿
Multipole errors Chamber limit ID kick map
┿
━
┿
DA & FMA (dp/p = 0)
3nx + ny = 93
1% Emittance coupling
┿
Multipole errors Chamber limit ID kick map
┿
┿
━
3nx + ny = 93
1% Emittance coupling
┿
3ny = 43
Multipole errors Chamber limit ID kick map
┿
┿
┿
DA & FMA (dp/p = 3%)
4nx = 105
1% Emittance coupling
┿
Multipole errors Chamber limit ID kick map
┿
┿
━
1% Emittance coupling
┿
Multipole errors Chamber limit ID kick map
┿
┿
┿
DA & FMA (dp/p = -3%)
3nx – 2ny = 50
3ny = 43
1% Emittance coupling
┿
Multipole errors Chamber limit ID kick map
┿
┿
━
1% Emittance coupling
┿
Multipole errors Chamber limit ID kick map
┿
┿
┿
Momentum Acceptance & Touschek lifetime
Bruck’s formula:
T: 18.72/ Tp: 12.86/ Tn: 34.39 (hrs)
Ex: 1.58E-9
Ey: 1.59E-11
Bunch current: 400 mA / 800 bunches
Bunch length: 2.86 mm
1% Emittance coupling
┿
Multipole errors Chamber limit ID kick map
┿
┿
━
Momentum Acceptance & Touschek lifetime
Bruck’s formula:
T: 18.64/ Tp: 12.84/ Tn: 34.03 (hrs)
Ex: 1.58E-9
Ey: 1.60E-11
Bunch current: 400 mA / 800 bunches
Bunch length: 2.86 mm
1% Emittance coupling
┿
Multipole errors Chamber limit ID kick map
┿
┿
┿
Conclusions
1. After DA optimization by TESLA, you still use tracking code to do DA tracking,
then pick up the best one. Finally, plot frequency map to decide whether the
solution could be accepted or not.
2. We can see that the frequency map show resonance line when ID kick maps are included.
It should slightly move working point to avoid resonance line.
3. Maybe it should add the tune optimization in the near future to search ,
Appendix
Crossover: Simulated Binary Cross-Over (SBX)
SBX is used to create child solutions xc1 , xc2 from parents xp1 , xp2.
2( x p1  x L ) c 1
2( xU  x p 2 ) c 1
1  2  [1 
]
 2  2  [1 
]
x p 2  x p1
x p 2  x p1
 (u   2 )1/(c 1)
 (u  1 )1/(c 1)
if u <= 1/2 ,
if
u
<=
1/

,
1


1
1
b q1  
bq2  
1/( c 1)
(
)1/(c 1)
(
)
otherwise,
otherwise,
 2  u  1

2

u


2

xc1  0.5  ( x p1  x p 2  bq1  ( x p 2  x p1 ))
xc 2  0.5  ( x p1  x p 2  bq 2  ( x p 2  x p1 ))
u : a random number between [0, 1]. , assume ( x  x p1  x p 2  x )
L
U
Comput. Methods Appl. Mech. Energ. 186 (2000) 311-338, K. Deb
 (distribution index for crossover): It control the
shape of probability distribution function of crossover.
Within the crossover probability, apply crossover,
Otherwise, copy the parents to children.
Application multiobjective genetic algorithm in accelerator
physics, ICAP09, L. Yang, et al.
Polynomial Mutation
Polynomial mutation is used to create a child solution xc in the vicinity of a parent solution xp.
u = a random number between [0, 1]

x p  x L 1/(m 1) if u <= 0.5,
[2  u  (1  2  u )  (1  U
)]

L

x x
dq  
U
x
 x p 1/(m 1) otherwise,
1  [2  (1  u )  2  (u  0.5)  (1 
)]
U
L

x x

xc  x p  d q  ( xU  x L )
Comput. Methods Appl. Mech. Energ. 186 (2000) 311-338, K. Deb
m (distribution index for mutation): It control the shape
of probability distribution function of mutation.
The smaller the m, the far away from the parents the child.
Within the mutation probability, apply mutation,
Otherwise, do nothing.
Application multiobjective genetic algorithm in accelerator
physics, ICAP09, L. Yang, et al.
Multipole errors
SR multipole tolerances
DM
QM
SM
Bn/BM @ 25mm (*E-4)
B1/B0
B2/B0
B3/B0
B4/B0
B5/B0
B6/B0
B8/B0
±5
-5±2
±2
5±2
±1
-2±0.2
-0.6±0.6
A2/B1
B0/B1
B2/B1
B3/B1
B4/B1
B5/B1
B9/B1
±3
±5
±2
±3
±1
0±1
0±1
B0/B2
B1/B2
B3/B2
B4/B2
B5/B2
B6/B2
B7/B2
±5
±10
±2
±3
±0.5
±0.5
±0.1
Each rest
term
±0.1
B13/B1
0±1
B8/B2
0±1
B17/B1
B21/B1
Each rest term
0±1
0±1
±0.1
B14/B2
B20/B2
B26/B2
Each rest term
0±1
0±1
0±1
±0.1
Note: n=0 is dipole term, n=1 is quadrupole term and so on.
Bn is normal term, An is skew term.
Min(Chamber size, ID gap) (Aperture)
IU22 IU22
Y(mm)
IU22 IU22
S (m)
Injection point (80 cm, down stream of the long straight
center)
Vertical:
Horizontal:
IU22
 3.5mm
 34 mm
EPU48
 3.9mm
 34 mm
EPU46
 6.5mm
 34 mm
Beam Pipe
 15mm
 34 mm
EPU48 EPU46
Download