Optimizing LCLS2 taper profile with genetic algorithms: preliminary results
description
Transcript of Optimizing LCLS2 taper profile with genetic algorithms: preliminary results
12/29/2012
Optimizing LCLS2 taper profile with genetic algorithms: preliminary results
X. Huang, J. Wu, T. Raubenhaimer, Y. Jiao, S. Spampinati, A. Mandlekar, G. Yu
2/29/2012
2
An Overview of Multi-Objective Genetic Algorithms • Multi-objective optimization
– Goal: to find the Pareto optimal set– Traditional approach: Weighted sum of objectives and its variants. – Evolutionary approach: converge to the Pareto front in one run.
• Genetic algorithms– Manipulate a set of solutions (a population) toward the optimal front
with operations that simulate biological evolution. – Three operators
• Selection – apply the evolution pressure toward the optimal front• Crossover – create new solution (child) by combining two solutions
(parents)• Mutation – alters an existing solution to create a new one.
2/29/2012
3
• Pros and Cons– Obtain global optimum (more likely) despite complexity of the
problem.– Optimize multiple objectives simultaneously.– Easy to apply constraints.– But it can be much slower than gradient-based methods.
2/29/2012
42/29/2012
Domination and the Pareto set
5
The NSGA-II algorithm• NSGA (non-dominated sorting genetic algorithm) -II
2/29/2012
K. Deb, IEEE Transtions On Evolutionary Computation Vol 6, No 2,April 2002
Selection (of parents)Crossover Mutation
6
NSGA-II with parallel computation• Use Matlab script for control and processing
– The algorithm is implemented in matlab– Post-processing is in matlab
• Parallel computation via submitting multiple jobs to a cluster– Use file input/output as communication between external program
(Genesis) and matlab.– I/O time limits the average number of nodes in use when
computation time is short.
2/29/2012
35 min per generation with up to 60 processors, or 4.5 s per evaluation, up from 20 s for individual evaluation. However the speed gain from parallel computing will be much higher for time-dependent runs.
7
LCLS2 Taper Optimization• Undulator tapering is required for LCLS2 to reach TW
power because of SASE saturation.• Taper profile optimization is critical to capture as many
electrons as possible in coherent emission.– Exploration of profile models is necessary.
• Should phase between undulator segments be included in optimization?
2/29/2012
8
Taper Models Considered
2/29/2012
Adding phase shift variables to the above models. So far we only varied the first few phase shifts after exponential growth.
Focusing scheme
])(1[)( 00b
ww zzaAzA
])()()(1[)( 30
2000 zzczzbzzaAzA ww
])()(1[)( 40
200 zzbzzaAzA ww
Basic 8 variables
Cubic 9 variables
Quartic 8 variables
For 0zz
220
2110
10
),1(, ),1(
,)(
zzzrKzzzzrK
zzKzK
9
GA setup• Objectives: 2
– Power– “Emittance”: beam size x divergence at the exit, a convenient way
to introduce diversity• Population: 600• Termination condition: about 100 generations or
converged.• Evolving mutation and crossover probability
2/29/2012
10
The basic 8 variable model (0118)
2/29/2012
0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24
0.6
0.8
1
1.2
1.4
1.6
1.8
emittance
pow
er (T
W)
gen 1gen 11gen 21gen 41gen 61gen 81gen 103
])(1[0
00
b
uww zL
zzaAA
parameter low high delta besta 0.01 0.3 0.001 0.1043z0 10 40 0.2 13.1b 1.1 3.3 0.01 2.0359K0 20 40 0.1 34.4r1 -0.005 0.005 0.00005 0.0018z1 20 80 0.2 80.0r2 -0.01 0.01 0.00005 0.0061z2-z1 0 70 0.2 28.9
(a, z0) (b, K0) (r1, z1) (r2, z2-z1)
11
The basic 8 variable model with 7 phase shifts (0115b)
2/29/2012
0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
emittance
pow
er (T
W)
gen 1gen 16gen 31gen 46gen 61gen 76gen 91gen 100
(a, z0) (b, K0)
Introduce phase shifts in gaps following undulators 5 to 11.
(r1, z1) (r2, z2-z1)
parameter low high delta besta 0.01 0.3 0.001 0.114z0 10 40 0.2 16.8b 1.1 3.3 0.01 2.072K0 20 40 0.1 34.9r1 -0.005 0.005 0.00005 0.0008z1 20 80 0.2 74.3r2 -0.01 0.01 0.00005 0.0022z2-z1 0 70 0.2 9.3
12
The cubic model (9 variables) (0119)
2/29/2012
0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
emittance
pow
er (T
W)
01192012
gen 1gen 11gen 21gen 41gen 61gen 81gen 101
(z0, a1) (a2, a3) (K0, r1) (z1,r2)
parameter Low high delta bestz0 10 40 0.2 18.8a1 -0.1 0.1 0.001 0.0118a2 0.001 0.3 0.001 0.0551a3 -0.1 0.1 0.001 0.0538K0 20 40 0.1 27.9r1 -0.01 0.01 0.0005 -0.005z1 20 80 0.2 38.1r2 -0.01 0.01 0.0005 -0.009z2-z1 0 70 0.2 66.8
m 100
])()()(1[)(
0
3
0
02
0
0
0
00
LLzzc
Lzzb
LzzaAzA ww
13
0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16
0.8
1
1.2
1.4
1.6
1.8
emittance
pow
er (T
W)
gen 1gen 21gen 41gen 61gen 81gen 104
The quadratic and quartic model (0112)
2/29/2012
])()(1[)( 4
0
02
0
00 zL
zzbzLzzaAzA
uuww
(a, z0) (b, K0) (r1, z1) (r2, z2-z1)
14
Summary of time-independent results
2/29/2012
case Nvar generation populationmax Power
inc in 10 gen
emittance (um) taper ratio
capture ratio
# # TW % um %"01182012" basic 8 103 600 1.760 0.20% 0.0753 0.075 43.0% 1+a x^b "01152012b" 8+7 100 600 1.830 0.27% 0.0790 0.0816 41.1% from random"01152012b" no phase 1.563 0.0816 35.1%
"01212012" phase 7 109 600 1.805 0.00% 0.0751 0.0762 43.4%based on 01182012 @ gen 47, 1.753 TW
"01192012" cubic 9 100 600 1.743 0.00% 0.0702 0.0722 44.3% 1+a x+b x^2+c x^3"01202012" 9+7 115 600 1.842 0.31% 0.0794 0.0804 42.0% "01202012" no phase 1.521 0.0804 34.7%
"01122012" quartic 8 104 600 1.799 0.00% 0.0757 0.0783 42.1% 1+a x^2 + b x^4
15
Effects of phase shift variables
2/29/2012
1 2 3 4 5 6 7-0.2
-0.1
0
0.1
0.2
0.3
wiggler index-4
phas
e
comparison of phase variables 2/2/2012
8+77 phase9+7
Based on case 0118.
Inside undulators, phase rotation and energy loss both change. In the gaps, the two can be decoupled. Can this improve the performance?
16
Time dependent results with the taper profiles
2/29/2012
Taper profile slightly shifted (detuned to maximize for average power for the slices) to maintain high power (but not optimized)
0 20 40 60 80 100 1200
0.2
0.4
0.6
0.8
1
1.2
1.4
z (m)
Pow
er (T
W)
0118: basic0119: cubic0112: quartic
0 20 40 60 80 100 1200
0.1
0.2
0.3
0.4
0.5
0.6
0.7
z (m)
b n
0118: basic0119: cubic0112: quartic
0 0.5 1 1.5 2 2.5 3 3.5 4
0.8
1
1.2
1.4
1.6
1.8
2
s (um)
Pow
er (T
W)
0118: basic0119: cubic0112: quartic
0.145 0.15 0.155
10-10
10-5
(nm)
P( )
(arb
. uni
ts)
0118: basic0119: cubic0112: quartic
0 20 40 60 80 1002.2
2.25
2.3
2.35
2.4
2.45
2.5
z (m)
b n (bun
chin
g fa
ctor
)
0118: basic0119: cubic0112: quartic
0 20 40 60 80 100 120-50
0
50
z (m)
b n (bun
chin
g fa
ctor
)
0118: basic0119: cubic0112: quartic
The three model attain similar power. More study is needed to understand the results.
17
Time dependent simulation with phase shifts
2/29/2012
0 20 40 60 80 100 1200
0.5
1
1.5
z (m)
Pow
er (T
W)
0118: basic0121: phase only0115b: basic+phase
0 20 40 60 80 1002.2
2.25
2.3
2.35
2.4
2.45
2.5
z (m)
b n (bun
chin
g fa
ctor
)
0118: basic0121: phase only0115b: basic+phase
0.146 0.148 0.15 0.152 0.154 0.156
10-10
10-5
(nm)
P(
) (ar
b. u
nits
)
0118: basic0121: phase only0115b: basic+phase
0 1 2 3 40.5
1
1.5
2
s (um)
Pow
er (T
W)
0118: basic0121: phase only0115b: basic+phase
0 20 40 60 80 100 1200
0.2
0.4
0.6
0.8
z (m)b n
0118: basic0121: phase only0115b: basic+phase
0 20 40 60 80 100 120-40
-20
0
20
40
z (m)
b n (bun
chin
g fa
ctor
)
0118: basic0121: phase only0115b: basic+phase
The effects of phase shifts are not conclusive from results we got so far.
18
Summary• All cases without phase shifts converge to solutions with
similar beam power and taper ratio, with a capture ratio of about 43%.
• Phase shifts only slightly increase beam power. But they can considerably change capture ratio (e.g., from 35% to 41%).
• We will continue the exploration– Other taper profile models– Introduce other objective functions– More time dependent studies
2/29/2012