Ocelot Optimizer Sergey Tomin Hugo Slepicka Joseph Duris

  • Slides: 9
Download presentation
Ocelot Optimizer Sergey Tomin, Hugo Slepicka Joseph Duris, Ilya Agapov, Daniel Ratner

Ocelot Optimizer Sergey Tomin, Hugo Slepicka Joseph Duris, Ilya Agapov, Daniel Ratner

Motivation • • Gun optimization: gun phase, solenoids, airquads, etc Longitudinal dynamics: tweaking of

Motivation • • Gun optimization: gun phase, solenoids, airquads, etc Longitudinal dynamics: tweaking of RF settings (e. g. chirps, curvature third derivative, energies). Transverse dynamics: ► Orbit in low beam energy sections ► Local dispersion correction ► Matching: fine tuning of the quads Self-effects: depend on longitudinal and transverse dynamics and contribute to 6 D phase space as well FEL optimization: ► Tapering ► launch orbit optimization ► phase-shifters tweaking Tens to hundreds of knobs A lot of things to optimize at a FEL facility (and not only): Manual tuning is mainly 1 D scan Computers are good at blind optimization. What needs: Flexible platform • Interchangeable optimization methods • Decent GUI • Add/select device or group of devices • Craft/modify target function • Infrastructure for testing new methods • etc

Ocelot schematic [XFEL-, LCLS-, BESSY-, FLASH, Sim-Interface] Machine Interface Ocelot Optimizer Operators Operator GUI

Ocelot schematic [XFEL-, LCLS-, BESSY-, FLASH, Sim-Interface] Machine Interface Ocelot Optimizer Operators Operator GUI Algorithm API Optimization algorithm [simplex, Bayesian optimization w/ a GP, RCDS, extremum seeking]

Use cases FEL facilities FEL pulse energy maximization: ► Launch orbit and orbit inside

Use cases FEL facilities FEL pulse energy maximization: ► Launch orbit and orbit inside an undulator (Eu. XFEL) ► Phase-shifters (Eu. XFEL) ► Orbit in low energy sections (Eu. XFEL) ► Matching quads (LCLS & Eu. XFEL) ► RF settings (Eu. XFEL) Local dispersion correction (Eu. XFEL & FLASH) HOM signal minimization in cavities (FLASH) Storage rings: Injection efficiency optimization (Kurchatov Institute) Beam life time (test at BESSY-II)

Ocelot optimizer stats SLAC: Ocelot with Nelder-Mead simplex reduced tuning times on average by

Ocelot optimizer stats SLAC: Ocelot with Nelder-Mead simplex reduced tuning times on average by 25% to 50% compared to hand tuning

Graphical User Interface PYTHON Select different optimizers (Simplex, GP, ES, …) Select any group

Graphical User Interface PYTHON Select different optimizers (Simplex, GP, ES, …) Select any group of devices Craft your objective function Simple PV Do math on up to 5 PVs Statistics: mean, stdev, quantiles Write python script (loaded/edited via GUI) Option to have simulated objective to test optimization methods Data browser Save predefined settings & routines

How to get started Download @Git. Hub: https: //github. com/ocelot-collab/optimizer/tree/optimizer-dev Try “simulation” interface: >>

How to get started Download @Git. Hub: https: //github. com/ocelot-collab/optimizer/tree/optimizer-dev Try “simulation” interface: >> python generic_optim. py Multinormal. Interface Edit template machine interface to map in your control system: XFELMachine. Interface (DOOCS) class XFELMachine. Interface(Machine. Interface): LCLSMachine. Interface (EPICS) name = 'XFELMachine. Interface' def __init__(self, args=None): super(XFELMachine. Interface, self). __init__(args) Simplified example of Machine. Interface def get_value(self, channel): val = pydoocs. read(channel) return val["data"] def set_value(self, channel, val): pydoocs. write(channel, float(val)) return

Advanced use Command Line Interface Possible to run optimization from other apps Batch execution

Advanced use Command Line Interface Possible to run optimization from other apps Batch execution and automation of optimization Continuous optimization routines Evaluate sequence of the optimizations dev_group 1 = [Device(eid="d 1"), Device(eid="d 2"), Device(eid="d 3")] dev_group 2 = [Device(eid="d 4"), Device(eid="d 5"), Device(eid="d 6")] target = Target() # init Optimizer opt = Optimizer() opt. timeout = 0 # init Minimizer minimizer = Simplex() minimizer. max_iter = 300 opt. minimizer = minimizer # build actions A 1 = Action(func=opt. max_target_func, args=[target, dev_group 1]) A 2 = Action(func=opt. max_target_func, args=[target, dev_group 2]) # evaluate optimization opt. eval(seq=[A 1, A 2, …])

thank you for your attention

thank you for your attention