Skip to content

Commit 85bdf24

Browse files
committed
adding talks
0 parents  commit 85bdf24

File tree

2 files changed

+924
-0
lines changed

2 files changed

+924
-0
lines changed

ADC_talk/ADC_talk.tex

+391
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,391 @@
1+
\documentclass{beamer}
2+
%\usecolortheme{dove} %Make title black
3+
\usepackage{graphicx} % Allows including images
4+
\usepackage{booktabs} % Allows the use of \toprule, \midrule and \bottomrule in tables
5+
%\usepackage{siunitx} %Use SI unit formatting
6+
%\sisetup{range-phrase=--}
7+
%Bold command
8+
%\newcommand\SEC[1]{\textbf{\uppercase{#1}}}
9+
\usepackage{pifont}% http://ctan.org/pkg/pifont
10+
\newcommand{\cmark}{\ding{51}}%
11+
\newcommand{\xmark}{\ding{55}}%
12+
%\usepackage{siunitx} %Use SI unit formatting
13+
%For drawing beam line
14+
\include{tikz}
15+
\usetikzlibrary{shapes.misc}
16+
\usetikzlibrary{shapes,arrows,decorations.markings,shadows,positioning}
17+
%Adjust width of slide
18+
\newcommand\Wider[2][3em]{%
19+
\makebox[\linewidth][c]{%
20+
\begin{minipage}{\dimexpr\textwidth+#1\relax}
21+
\raggedright#2
22+
\end{minipage}%
23+
}%
24+
}
25+
26+
\include{header}
27+
\usebackgroundtemplate{\includegraphics[width=\paperwidth]{NormalANLMaroon}}
28+
\title[PSI Talk]{Optimization of the AWA Drive Linac}
29+
\author[Speaker]{Nicole Neveu}
30+
\subtitle{}
31+
\institute[ANL/IIT]{Argonne National Laboratory\\Illinois Institute of Technology}
32+
\date{\today}
33+
34+
\logo{%
35+
\makebox[0.95\paperwidth]{%
36+
%\includegraphics[width=3cm,keepaspectratio]{IIT_logo}%
37+
\hfill%
38+
\includegraphics[width=3cm,keepaspectratio]{IIT_logo_blk}%
39+
}%
40+
}
41+
42+
\setbeamertemplate{navigation symbols}{}
43+
44+
45+
%------------------------------------------------------
46+
\begin{document}
47+
\setbeamertemplate{footline}{}
48+
{
49+
\usebackgroundtemplate{\includegraphics[width=\paperwidth]{TitleANLMaroon}}
50+
\logo{%
51+
\makebox[0.95\paperwidth]{%
52+
\includegraphics[width=3cm,keepaspectratio]{IIT_logo}%
53+
\hfill%
54+
%\includegraphics[width=3cm,keepaspectratio]{IIT_logo_blk}%
55+
}%
56+
}
57+
\frame{\titlepage}
58+
}
59+
60+
\setbeamertemplate{footline}[page number]{}
61+
62+
% FRAME: overview
63+
\begin{frame}
64+
\frametitle{Outline}
65+
\tableofcontents
66+
\end{frame}
67+
% ========================================
68+
% main slides come here
69+
% ========================================
70+
\section{Optimization Introduction}
71+
%\begin{frame}
72+
% \frametitle{Before we start ...}
73+
%\end{frame}
74+
75+
\begin{frame}[plain]
76+
\frametitle{Optimization Introduction}
77+
78+
\Wider[4em]{
79+
\setlength{\leftmargin}{0.1cm}
80+
\begin{itemize}
81+
\item{Why use optimization?}\\
82+
\begin{itemize}
83+
%\item{\underline{\textbf{Drive Line}}: $Cs_2Te$ cathode, 6 linac cavities}
84+
\item{Reduce the number of simulations needed}
85+
\begin{itemize}
86+
\item{Eliminate brute force simulations}
87+
\item{i.e. scanning parameters one by one}
88+
\item{This is not efficient when many variables can change} \\
89+
\end{itemize}
90+
%\item{\underline{\textbf{Witness Line}}: $Mg$ cathode, 1 lin}
91+
\item{Get better beam parameters} \\
92+
\item{Try to understand the parameter space better}
93+
\end{itemize}
94+
\end{itemize}
95+
96+
}
97+
\end{frame}
98+
99+
\begin{frame}
100+
\frametitle{Optimization Introduction}
101+
So, what is an optimization algorithm?
102+
\begin{itemize}
103+
\item{Similar to coding definition of algorithm.}
104+
\item{Set of rules that determines which points are good based on math.
105+
Each point is compared to other points, and you have to pick what you want to optimize.}
106+
\item{What you want to optimize = "objectives"}
107+
\begin{itemize}
108+
\item{in optimization terminology}
109+
\end{itemize}
110+
\item{Genetic Algorithms are commonly used in accelerator physics}
111+
\begin{itemize}
112+
\item{Gwanghui, Borland, OPAL people, etc.}
113+
\end{itemize}
114+
\end{itemize}
115+
116+
\end{frame}
117+
%--------------------------------------------------------------------------------------------
118+
\section{Types of Optimization Algorithms}
119+
\begin{frame}
120+
\frametitle{Genetic Algorithms}
121+
\begin{itemize}
122+
\item{Based on biology and nature}
123+
\item{This method is close to random sampling (IMO)}
124+
\item{In general the steps are:}
125+
\begin{enumerate}
126+
\item{Do initial random sample, this is initial "population"}
127+
\item{Choose best points w.r.t objectives}
128+
\item{"Breed" best points (mix their input parameters)}
129+
\item{Do another set of simulations with the new "generation"}
130+
\item{Repeat for many generations }
131+
\end{enumerate}
132+
\end{itemize}
133+
\vspace*{-\baselineskip}
134+
\begin{center}
135+
\includegraphics[width=0.5\textwidth]{ga}
136+
\end{center}
137+
\end{frame}
138+
139+
\begin{frame}
140+
\frametitle{Model Based Algorithms}
141+
\begin{itemize}
142+
\item These methods try to use information about the problem instead of random sampling.
143+
\item For the IPAC paper, we used a method called BOBYQA:
144+
\begin{itemize}
145+
\item Bounded Optimization BY Quadratic Approximation
146+
\begin{enumerate}
147+
\item The initial sample is N+1 points (where N is number of variables)
148+
\item The objectives are found for those points
149+
\item A quadratic is built using the objective values
150+
\item The next point is chosen by trying to minimize the objective
151+
\item This process is repeated until convergence criteria met
152+
\end{enumerate}
153+
154+
\item Let's look at an AWA example....
155+
\end{itemize}
156+
\end{itemize}
157+
\vspace*{-\baselineskip}
158+
\begin{center}
159+
\includegraphics[width=0.5\textwidth]{bobyqa}
160+
\end{center}
161+
\end{frame}
162+
163+
%--------------------------------------------------------------------------------------------
164+
\section{Initial OPAL and Python Optimization Results}
165+
\begin{frame}
166+
\frametitle{Initial Optimization Work (Linac only)}
167+
\Wider[4em]{
168+
\begin{minipage}{0.6\textwidth}
169+
\begin{itemize}
170+
\item{Determine what emittance and bunch length we can expect from the linac}
171+
\item{Understand beam at entrance of quads}
172+
\begin{itemize}
173+
\item After $L_6$: $z_1=12.51$ m
174+
\end{itemize}
175+
\item{Used pre-packaged algorithm BOBYQA}
176+
\item{Varied 10 parameters:}
177+
\end{itemize}
178+
\end{minipage}%
179+
\begin{minipage}{0.4\textwidth}
180+
\def \gunleft {-1.0}
181+
\def \gunright {0.3}
182+
\def \loneright {1.0}
183+
\def \ltworight {2.0}
184+
\def \lthreeright {3.0}
185+
\def \lfourright {4.0}
186+
\def \lfiveright {5.0}
187+
\def \lsixright {6.0}
188+
\centering
189+
\begin{center}
190+
\begin{tikzpicture}[scale=0.55]%,use optics
191+
%Gun drawings
192+
\draw[fill=orange, very thick, rounded corners =0.1cm] (\gunleft,0.5)rectangle (\gunright,1.5) node[pos=.5, white] {\textbf{Gun}} ;
193+
194+
%S1
195+
\node[] at (-1.3,2.9) {$S_1$};
196+
\draw[ultra thick, fill=black!60!green] (-1.4,-0.5)rectangle (-1.0,0.5) node[pos=.5, white] {} ;
197+
\draw[black, ultra thick] (-1.4,-0.5) -- (-1.0,0.5);
198+
\draw[black, ultra thick] (-1.4,0.5) -- (-1.0,-0.5);
199+
\draw[ultra thick, fill=black!60!green] (-1.4,1.5)rectangle (-1.0,2.5) node[pos=.5, white] {} ;
200+
\draw[black, ultra thick] (-1.4,1.5) -- (-1.0,2.5);
201+
\draw[black, ultra thick] (-1.4,2.5) -- (-1.0,1.5);
202+
%S2
203+
\node[] at (-0.8,2.9) {$S_2$};
204+
\draw[ultra thick, fill=black!60!green] (-1.0,-0.5)rectangle (-0.6,0.5) node[pos=.5, white] {} ;
205+
\draw[black, ultra thick] (-1.0,-0.5) -- (-0.6,0.5);
206+
\draw[black, ultra thick] (-1.0,0.5) -- (-0.6,-0.5);
207+
\draw[ultra thick, fill=black!60!green] (-1.0,1.5)rectangle (-0.6,2.5) node[pos=.5, white] {} ;
208+
\draw[black, ultra thick] (-1.0,1.5) -- (-0.6,2.5);
209+
\draw[black, ultra thick] (-1.0,2.5) -- (-0.6,1.5);
210+
211+
%S3
212+
\node[] at (0.2,2.9) {$S_3$};
213+
\draw[ultra thick, fill=black!60!green] (-0.1,-0.5) rectangle (0.3,0.5) node[pos=.5, white] {};
214+
\draw[black, ultra thick] (-0.1,-0.5) -- (0.3,0.5);
215+
\draw[black, ultra thick] (-0.1,0.5) -- (0.3,-0.5);
216+
\draw[ultra thick, fill=black!60!green] (-0.1,1.5) rectangle (0.3,2.5) node[pos=.5, white] {};
217+
\draw[black, ultra thick] (-0.1,1.5) -- (0.3,2.5);
218+
\draw[black, ultra thick] (-0.1,2.5) -- (0.3,1.5);
219+
%Linac drawings
220+
\draw[fill=blue, ultra thick, rounded corners =0.1cm] (\loneright,0)rectangle ({\loneright+0.84},2) node[pos=.5, white] {$L_1$} ;
221+
\draw[fill=blue, ultra thick, rounded corners =0.1cm] (\ltworight,0)rectangle ({\ltworight+0.84},2) node[pos=.5, white] {$L_2$};
222+
\draw[fill=blue, ultra thick, rounded corners =0.1cm] (\lthreeright,0)rectangle ({\lthreeright+0.84},2) node[pos=.5, white] {$L_3$};
223+
\draw[fill=blue, ultra thick, rounded corners =0.1cm] (\lfourright,0)rectangle ({\lfourright+0.84},2) node[pos=.5, white] {$L_4$};
224+
\draw[fill=blue, ultra thick, rounded corners =0.1cm] (\lfiveright,0)rectangle ({\lfiveright+0.84},2) node[pos=.5, white] {$L_5$};
225+
\draw[fill=blue, ultra thick, rounded corners =0.1cm] (\lsixright,0)rectangle ({\lsixright+0.84},2) node[pos=.5, white] {$L_6$};
226+
\end{tikzpicture}
227+
\end{center}
228+
\end{minipage}%
229+
\begin{center}
230+
\setcounter{mpfootnote}{\value{footnote}}%
231+
\renewcommand{\thempfootnote}{\arabic{mpfootnote}}%
232+
\begin{tabular}{ l *{3}{c}}
233+
%\toprule
234+
\textbf{Variable} & \textbf{Range} & \textbf{Unit} \\
235+
\midrule
236+
Solenoid Strength & $ 0 \le S_3 \le 440$ & amps \\
237+
Phase of Gun & $-60 \le \phi_g \le 60$ & degrees \\
238+
Laser Radius & $0.1 \le R \le 30$ & mm \\
239+
Laser FWHM & $2 \le T \le $10 & ps \\
240+
Cavity Phase & $-20 \le \phi_L \le 20$\footnote[1]{$\phi_L=[\phi_{L_1},\ldots,\phi_{L_6}]$} & degrees
241+
%\bottomrule
242+
\end{tabular}
243+
\end{center}
244+
}
245+
\end{frame}
246+
247+
\begin{frame}
248+
\frametitle{Linac Optimization}
249+
\begin{itemize}
250+
\item{1,000 point sample was done}
251+
\item{132 simulations completed w/o error}
252+
\item{Scaled and shifted raw values to remove unit dependence}
253+
\end{itemize}
254+
\begin{align*}
255+
\bar{\epsilon}_x (v,z_1) = \frac{ \epsilon_x (v,z_1) - \epsilon_{\min} } { \epsilon_{\max} - \epsilon_{\min} }
256+
\end{align*}
257+
258+
\begin{itemize}
259+
\item{Used 11 weights from 0-1}
260+
\item Code: w = np.arange(0, 1.1, 0.1)
261+
\end{itemize}
262+
\end{frame}
263+
264+
\begin{frame}
265+
\frametitle{Linac Optimization}
266+
\begin{itemize}
267+
\item{Solved 11 optimization problems $f(v,w)$ using BOBYQA}
268+
\item i.e. The minimum f(v,w) values were used as starting points for BOBYQA optimization runs.
269+
\item v = 10 optimization variable from table below
270+
\end{itemize}
271+
\begin{gather*}
272+
w\in\left\{ 0, 0.1, \ldots, 1 \right\}\\ \\
273+
f(v,w) = w \,\bar{\epsilon}_x(v,z_1) + (1-w)\, \bar{\sigma}_z(v,z_1)
274+
\end{gather*}
275+
\begin{center}
276+
\setcounter{mpfootnote}{\value{footnote}}%
277+
\renewcommand{\thempfootnote}{\arabic{mpfootnote}}%
278+
\begin{tabular}{ l *{3}{c}}
279+
%\toprule
280+
\textbf{Variable} & \textbf{Range} & \textbf{Unit} \\
281+
\midrule
282+
Solenoid Strength & $ 0 \le S_3 \le 440$ & amps \\
283+
Phase of Gun & $-60 \le \phi_g \le 60$ & degrees \\
284+
Laser Radius & $0.1 \le R \le 30$ & mm \\
285+
Laser FWHM & $2 \le T \le $10 & ps \\
286+
Cavity Phase & $-20 \le \phi_L \le 20$ & degrees
287+
%\bottomrule
288+
\end{tabular}
289+
\end{center}
290+
\end{frame}
291+
292+
\begin{frame}
293+
\frametitle{BOBYQA Results}
294+
Progress during each BOBYQA run
295+
\includegraphics[width=0.9\textwidth]{../psi_talk/THPAB155f2}
296+
\end{frame}
297+
298+
\begin{frame}
299+
\frametitle{Calculating the Pareto Front}
300+
\textbf{Pareto Front:} the set of parameters for which
301+
no other point exists that is better with respect to both objectives.
302+
Steps to calculate this is basically the same as previous starting points: \\
303+
\begin{enumerate}
304+
\item Gather all data from optimization runs and sample
305+
\item Create finer weight array (i.e. w = np.arange(0, 1.1, 0.001))
306+
\item Minimize $f(v,w)$ again with finer weights
307+
\item Plot min points w.r.t $f(v,w)$
308+
\end{enumerate}
309+
\end{frame}
310+
311+
312+
313+
\begin{frame}
314+
\frametitle{Approximate Pareto Front}
315+
\centering
316+
Trade off between emittance and bunch length
317+
\includegraphics[width=0.9\textwidth]{../psi_talk/THPAB155f1}
318+
\end{frame}
319+
320+
\section{Look at Code}
321+
\begin{frame}
322+
\frametitle{Look at the code...}
323+
If time permits, let's look at the following in python:
324+
\begin{itemize}
325+
\item Random sample
326+
\item Bobyqa runs
327+
\item Plotting Pareto Front
328+
\end{itemize}
329+
330+
\end{frame}
331+
332+
\begin{frame}
333+
\huge Thanks for your time!!\\
334+
\vskip12pt
335+
\end{frame}
336+
337+
\begin{frame}
338+
\frametitle{Backup: Optimized Gun Results}
339+
\includegraphics[width=1.0\textwidth]{../psi_talk/THPAB155f3}
340+
\end{frame}
341+
342+
\begin{frame}
343+
\frametitle{Code Features}
344+
\begin{table}
345+
\begin{minipage}{\textwidth}
346+
\begin{center}
347+
\setcounter{mpfootnote}{\value{footnote}}%
348+
\renewcommand{\thempfootnote}{\arabic{mpfootnote}}%
349+
\begin{tabular}{l c c c}
350+
\toprule
351+
\textbf{Feature} & \textbf{ASTRA} & \textbf{GPT} & \textbf{OPAL}\\
352+
\midrule
353+
Windows & \cmark & \cmark & \xmark \\
354+
Mac & \cmark & \cmark & \cmark \\
355+
Linux & \cmark & \cmark & \cmark \\
356+
Open Source & \xmark & \alert \xmark & \color{black!30!green}\cmark \\
357+
Parallel & \alert \xmark\footnote[1]{A parallel version is available at DESY} & \alert \xmark & \color{black!30!green}\cmark \\
358+
Autophase & \cmark & \xmark & \cmark \\
359+
Adaptive Time Step & \xmark & \cmark & \xmark \\
360+
3D Space Charge & \cmark & \cmark & \cmark \\
361+
Wakefields & \cmark & \xmark\footnote[2]{In house module was written at AWA\label{note2}} & \color{black!30!green}\cmark \\
362+
CSR & \alert \xmark & \xmark\textsuperscript{\ref{note2}} & \color{black!30!green}\cmark \\
363+
\bottomrule
364+
\end{tabular}
365+
%\caption{Table caption}
366+
\end{center}
367+
\end{minipage}
368+
\end{table}
369+
370+
\end{frame}
371+
372+
\begin{frame}
373+
\frametitle{Links for pictures}
374+
Listed in the order they appear:
375+
\begin{itemize}
376+
\item GA: https://arxiv.org/pdf/1302.2889.pdf
377+
\item BOBYQA: https://en.wikipedia.org/wiki/BOBYQA
378+
\item
379+
\end{itemize}
380+
\end{frame}
381+
382+
\end{document}
383+
384+
385+
386+
387+
388+
389+
390+
391+

0 commit comments

Comments
 (0)