Application of multi-objective optimisation to match turn pattern - - PowerPoint PPT Presentation

application of multi objective optimisation to match turn
SMART_READER_LITE
LIVE PREVIEW

Application of multi-objective optimisation to match turn pattern - - PowerPoint PPT Presentation

WIR SCHAFFEN WISSEN HEUTE F UR MORGEN M. Frey, J. Snuverink, C. Baumgarten, A. Adelmann :: SNSF project 200021 159936 :: Paul Scherrer Institut Application of multi-objective optimisation to match turn pattern measurements for cyclotrons


slide-1
SLIDE 1

WIR SCHAFFEN WISSEN – HEUTE F¨ UR MORGEN

  • M. Frey, J. Snuverink, C. Baumgarten, A. Adelmann :: SNSF project

200021 159936 :: Paul Scherrer Institut

Application of multi-objective optimisation to match turn pattern measurements for cyclotrons

15/04/2019 :: GFA Seminar Thesis advisor: Prof. Dr. Klaus S. Kirch Thesis supervisor: Dr. Andreas Adelmann

slide-2
SLIDE 2

Outline

  • Motivation
  • New Trimcoil Model in OPAL
  • Multi-Objective Optimisation
  • Local Search
  • Final Results & Conclusions
  • M. Frey

2 / 45

slide-3
SLIDE 3

Obtain Isochronicity in Cyclotrons

  • Discrepancies / Error in
  • magnetic field (calculation and construction)
  • injection parameters (Ekin, r, pr, ...)
  • element positioning (RF cavities)
  • etc.
  • Restored / Achieved:

Additional B-field with trimcoils (TCs)

= ⇒ phase shift (beam gets more/less energy by RF cavities) = ⇒ turn radius shift

  • M. Frey

3 / 45

slide-4
SLIDE 4

Mismatch between Measurements and Simulations

  • Discrepancies / Error in
  • measured magnetic field due to

measuring conditions, technique and machine accessibility

  • simulation model:
  • discretisation in time and space
  • simplified device models
  • missing device models
  • etc.
  • injection parameters (Ekin, r, pr, ...)
  • element positioning (RF cavities)
  • etc.

Towards quantitative simulations of high power proton cyclotrons.

  • Y. J. Bi, A. Adelmann, R. D¨
  • lling, M. Humbel, W. Joho, M. Seidel,

and T. J. Zhang. Phys. Rev. ST Accel. Beams 14, 054402

  • M. Frey

4 / 45

slide-5
SLIDE 5

Towards More Realistic Trimcoil Simulations

  • OPAL PSI-Ring model only TC15

but 16 TCs (TC17/18 not used) in PSI-Ring Cyclotron

  • TC-model in OPAL approximated using analytical model mimicking profile

but there are TC measurements available

  • TC-field contribution in OPAL for 360 degree

but in reality only on sector magnets

  • M. Frey

5 / 45

slide-6
SLIDE 6

New Trimcoil Model in OPAL

  • Radially rational TC profile description

TC(r) = Bmax n

i=0 airi

m

j=0 bjrj

n, m ∈ N0 ∧ r ∈ [rmin, rmax] tc1 : TRIMCOIL , TYPE = ”PSI−PHASE” , RMIN = . . . , // i n n e r r a d i u s [mm] RMAX = . . . , //

  • uter

r a d i u s [mm] BMAX = . . . , // B−f i e l d peak value [T] COEFNUM = {a0 , a1 , a2 , a3 } , COEFDENOM = {b0 , b1 , b2 , b3 , b4 , b5 };

  • M. Frey

6 / 45

slide-7
SLIDE 7

New Trimcoil Model in OPAL

  • Supported types:
  • new: PSI-BFIELD, PSI-PHASE
  • old: PSI-BFIELD-MIRRORED
  • Cyclotron-Definition:

Ring : CYCLOTRON, TRIMCOILTHRESHOLD = . . . , // lower l i m i t

  • f TC c o n t r i b u t i o n

[T] TRIMCOIL = {tc1 , tc2 , tc3 , . . . } . . . ;

  • M. Frey

7 / 45

slide-8
SLIDE 8

PSI-Ring Trimcoil Model

  • Starting point: Measurement of phase shift effect1 ∆B ∼ − d∆ sin(φ)

dr

  • 1S. Adam and W. Joho, PSI Technical Report No. TM-11-13, 1974.
  • M. Frey

8 / 45

slide-9
SLIDE 9

PSI-Ring Trimcoil Model

  • Fit of phase shift curves:

∆ sin(φ)(r) ≈ hphase(r) = f (r) g(r) = n

i=0 airi

m

j=0 bjrj

with m > n ∈ N0

  • TC2 - TC15: n = 2, m = 4
  • TC1, TC16 - TC18: n = 4, m = 5
  • Magnetic field:

B(r) = −dhphase dr = −h′

phase = −f ′g − fg′

g2

  • M. Frey

9 / 45

slide-10
SLIDE 10

PSI-Ring Trimcoil Model - Example TC6

  • M. Frey

10 / 45

slide-11
SLIDE 11

PSI-Ring Trimcoil Model - Example TC6

  • M. Frey

11 / 45

slide-12
SLIDE 12

Multi-Objective Optimisation (MOO) in OPAL

  • Built-in MOO2:

min f(x), dim(f) ≥ 1 s.t. g(x) ≥ 0, dim(g) ≥ 0 −∞ ≤ xL

i ≤ x = xi ≤ xU i

≤ ∞, x ∈ X ⊂ Rn, n ∈ N>0

  • Design variables x: Ekin, pr, ϕ, TC1 - TC16 max. B-field, etc.
  • Objectives: Measure between simulation and real data

Note: f is our PSI-Ring model + evaluation of objectives!

2Toward massively parallel multi-objective optimisation with application to particle accelerators.

PhD Thesis. Y. Ineichen. 2013

  • M. Frey

12 / 45

slide-13
SLIDE 13

Multi-Objective Genetic Algorithm (MOGA)

1st generation Charles Darwin3

3Image:https://en.wikipedia.org/wiki/Charles Darwin

  • M. Frey

13 / 45

slide-14
SLIDE 14

Multi-Objective Genetic Algorithm (MOGA)

1st generation Charles Darwin3 mutation

3Image:https://en.wikipedia.org/wiki/Charles Darwin

  • M. Frey

14 / 45

slide-15
SLIDE 15

Multi-Objective Genetic Algorithm (MOGA)

1st generation Charles Darwin3 mutation crossover

3Image:https://en.wikipedia.org/wiki/Charles Darwin

  • M. Frey

15 / 45

slide-16
SLIDE 16

Multi-Objective Genetic Algorithm (MOGA)

1st generation Charles Darwin3 mutation crossover 2nd generation

3Image:https://en.wikipedia.org/wiki/Charles Darwin

  • M. Frey

16 / 45

slide-17
SLIDE 17

Multi-Objective Genetic Algorithm (MOGA)

1st generation Charles Darwin3 mutation crossover 2nd generation ...

3Image:https://en.wikipedia.org/wiki/Charles Darwin

  • M. Frey

17 / 45

slide-18
SLIDE 18

Radial Profile Measurement – Centred Beam

  • Measurements: Peak intensity of radial profile of probes to distinguish turns

Figure: Histogram of RRL measurement

  • M. Frey

18 / 45

slide-19
SLIDE 19

Trimcoil Optimisation in OPAL

  • Simulations:
  • Single particle ⇒ probe hit = turn
  • Multi particles ⇒ peak finder routine
  • Good setting: Radial peak of measurement

and simulation at probes are close!

  • RRI2: turns 1 - 16
  • RRL: turns 9 - 182

182 turns ⇒ Infeasible number of objectives!

OPAL simulations of the PSI ring cyclotron and a design for a higher order mode flat top cavity. N. J. Pogue, A. Adelmann. Proceedings of IPAC2017. THPAB077. 2017.

  • M. Frey

19 / 45

slide-20
SLIDE 20

Problem Reduction

  • Turn - Aggregation:
  • L2-norm

σ[l,u] = 1 N

  • u
  • i=l

(r m

i

− r s

i )2

  • L∞-norm

σ[l,u] = max

i=l...u |r m i

− r s

i |

N = u − l + 1: number of aggregated turns rm

i : i-th turn radii of measurement

rs

i : i-th turn radii of simulation

  • M. Frey

20 / 45

slide-21
SLIDE 21

Problem Reduction

  • TC support reduction:

Feasible assumption for neighbouring TCs ⇒ Cancellation of B-field tails

  • M. Frey

21 / 45

slide-22
SLIDE 22

Trimcoil Optimisation in OPAL - Trial 1

  • Goal:

Find initial injection values

  • Design variables:
  • beam energy Ekin
  • injection angle
  • injection momentum
  • injection radius
  • TC1 - TC4
  • MOO: (504 cores)

#generations 500 + #individuals 502

  • 5000 particles per individual

peak 1 - 3 peak 4 - 6 peak 7 - 9 peak 10-12 peak 13 - 16

  • bjectives
  • M. Frey

22 / 45

slide-23
SLIDE 23

Issue of Divergence - Trial 1

  • Optimising a few TCs after the others (i.e. optimise sub-problems) lead to

divergence!

  • RF cavity voltages not correct → more design variables needed!
  • M. Frey

23 / 45

slide-24
SLIDE 24

Model Simplification + Design Variable Extension

  • Single particle tracking instead of bunch (5000 particles) tracking

= ⇒ full PSI-Ring simulation in 1 - 2 s

  • Design variables:
  • injection angle, radius, momentum and energy
  • main cavity voltages
  • phase of Flat-Top cavity
  • voltage of Flat-Top cavity
  • radial position of main cavities
  • radial position of Flat-Top cavity
  • Turn number constraint to guarantee feasible solutions
  • M. Frey

24 / 45

slide-25
SLIDE 25

Design Variables in Context of Cyclotron

5 5 5 5 1 1 1 1 2 8 10 3 4 6 RRL RRI2 7 9 9 9 9 9 9 9 9

① main RF cavity displacement in radial direction; RF voltage on main cavity 1 - 4 ② displacement of main cavity’s axis from global center ③ flat top cavity displacement in radial direction ④ displacement of flat top’s axis from global center ⑤ main cavity’s angle w.r.t. the center line of sector magnet 1 ⑥ injection beam energy, injection radial momentum, injection angle of beam, injection radius w.r.t. the global coordinate system ⑦ positioning of probes (6 parameters) ⑧ flat top cavity angle w.r.t. global coordinate system ⑨ trim coil maximum magnetic field ⑩ phase of flat top; RF voltage on flat top cavity

  • M. Frey

25 / 45

slide-26
SLIDE 26

Evolution of best individual during MOGA

>8k individuals/generation

10 20 30 40 50 60 70 generation 10 20 30 40 50 min

i=1,...,N

M

j=1 σj

  • i [mm]

σ[106,148] σ[149,182] σ[1,16] σ[32,61] σ[62,105] σ[9,31]

Figure: The label σ[l,u] indicates an objective for the turns in the range [l, u]. M: number of objectives; N: number of individuals per generation.

  • M. Frey

26 / 45

slide-27
SLIDE 27

Result of best individual obtained by MOGA

Objective l∞-error Probe σ[l,u] (mm) σ[1,16] 6.38 RRI2 σ[9,31] 3.76 RRL σ[32,61] 6.34 RRL σ[62,105] 4.39 RRL σ[106,148] 2.91 RRL σ[149,182] 3.27 RRL

Table: The label σ[l,u] indicates an objective for the turns in the range [l, u].

  • M. Frey

27 / 45

slide-28
SLIDE 28

Local search after MOGA

  • Issues:
  • Optimiser suffered with individual selection
  • No further improvements!
  • Changing all parameters at same time might be disadvantageous
  • Idea: Do simple parameter scanning!
  • Python script (1 core)
  • Starting from best MOO individual
  • Iteratively find worst turn and vary parameters to obtain better individual

(check L∞- and L2-norm, 2nd and 3rd worst turn to avoid getting stuck with only L∞)

  • Change a input parameter only in per-mille magnitude
  • M. Frey

28 / 45

slide-29
SLIDE 29

Evolution of maximum absolute error during local search

> 1 mm error reduction after a few iterations 0.0 0.5 1.0 1.5 2.0 2.5 3.0 iteration ×104 4.5 5.0 5.5 6.0

  • max. error [mm]
  • M. Frey

29 / 45

slide-30
SLIDE 30

Total effect on max. absolute error per design variable.

> 0 error reduction < 0 error increase

tc03mb tc02mb tc01mb phimain2 vmaincav3 phimain4 rftshift phimain1 phimain3 phirfft tc04mb pdisft rinit vftcav rri2a phift tc05mb tc06mb rrlphi rrla tc07mb tc11mb tc13mb tc08mb tc12mb tc14mb tc15mb tc09mb tc16mb tc10mb vchange vmaincav4 vmaincav2 phiinit vmaincav1 prinit rri2phi benergy −1.0 −0.5 0.0 0.5 effect on l∞-error [mm]

  • M. Frey

30 / 45

slide-31
SLIDE 31

Total effect on max. absolute error per design variable.

> 0 error reduction < 0 error increase trim coils

tc03mb tc02mb tc01mb phimain2 vmaincav3 phimain4 rftshift phimain1 phimain3 phirfft tc04mb pdisft rinit vftcav rri2a phift tc05mb tc06mb rrlphi rrla tc07mb tc11mb tc13mb tc08mb tc12mb tc14mb tc15mb tc09mb tc16mb tc10mb vchange vmaincav4 vmaincav2 phiinit vmaincav1 prinit rri2phi benergy −1.0 −0.5 0.0 0.5 effect on l∞-error [mm]

  • M. Frey

31 / 45

slide-32
SLIDE 32

Total effect on max. absolute error per design variable.

> 0 error reduction < 0 error increase RF cavity voltages

tc03mb tc02mb tc01mb phimain2 vmaincav3 phimain4 rftshift phimain1 phimain3 phirfft tc04mb pdisft rinit vftcav rri2a phift tc05mb tc06mb rrlphi rrla tc07mb tc11mb tc13mb tc08mb tc12mb tc14mb tc15mb tc09mb tc16mb tc10mb vchange vmaincav4 vmaincav2 phiinit vmaincav1 prinit rri2phi benergy −1.0 −0.5 0.0 0.5 effect on l∞-error [mm]

  • M. Frey

32 / 45

slide-33
SLIDE 33

Total effect on max. absolute error per design variable.

> 0 error reduction < 0 error increase beam injection parameters

tc03mb tc02mb tc01mb phimain2 vmaincav3 phimain4 rftshift phimain1 phimain3 phirfft tc04mb pdisft rinit vftcav rri2a phift tc05mb tc06mb rrlphi rrla tc07mb tc11mb tc13mb tc08mb tc12mb tc14mb tc15mb tc09mb tc16mb tc10mb vchange vmaincav4 vmaincav2 phiinit vmaincav1 prinit rri2phi benergy −1.0 −0.5 0.0 0.5 effect on l∞-error [mm]

  • M. Frey

33 / 45

slide-34
SLIDE 34

Total effect on l2 error per design variable (DVAR)

> 0 error reduction < 0 error increase

tc06mb tc08mb tc09mb tc07mb tc10mb tc12mb tc13mb tc11mb tc14mb tc15mb tc16mb vmaincav1 phiinit vmaincav4 vchange vmaincav2 rinit prinit tc05mb benergy rrla rri2a rri2phi tc01mb phift tc02mb phirfft rrlphi phimain1 vftcav phimain2 phimain3 phimain4 rftshift pdisft tc03mb tc04mb vmaincav3 −40 −20 20 40 effect on l2-error [mm]

  • M. Frey

34 / 45

slide-35
SLIDE 35

Total effect on l2 error per design variable (DVAR)

> 0 error reduction < 0 error increase trim coils

tc06mb tc08mb tc09mb tc07mb tc10mb tc12mb tc13mb tc11mb tc14mb tc15mb tc16mb vmaincav1 phiinit vmaincav4 vchange vmaincav2 rinit prinit tc05mb benergy rrla rri2a rri2phi tc01mb phift tc02mb phirfft rrlphi phimain1 vftcav phimain2 phimain3 phimain4 rftshift pdisft tc03mb tc04mb vmaincav3 −40 −20 20 40 effect on l2-error [mm]

  • M. Frey

35 / 45

slide-36
SLIDE 36

Total effect on l2 error per design variable (DVAR)

> 0 error reduction < 0 error increase RF cavity voltages

tc06mb tc08mb tc09mb tc07mb tc10mb tc12mb tc13mb tc11mb tc14mb tc15mb tc16mb vmaincav1 phiinit vmaincav4 vchange vmaincav2 rinit prinit tc05mb benergy rrla rri2a rri2phi tc01mb phift tc02mb phirfft rrlphi phimain1 vftcav phimain2 phimain3 phimain4 rftshift pdisft tc03mb tc04mb vmaincav3 −40 −20 20 40 effect on l2-error [mm]

  • M. Frey

36 / 45

slide-37
SLIDE 37

Total effect on l2 error per design variable (DVAR)

> 0 error reduction < 0 error increase beam injection parameters

tc06mb tc08mb tc09mb tc07mb tc10mb tc12mb tc13mb tc11mb tc14mb tc15mb tc16mb vmaincav1 phiinit vmaincav4 vchange vmaincav2 rinit prinit tc05mb benergy rrla rri2a rri2phi tc01mb phift tc02mb phirfft rrlphi phimain1 vftcav phimain2 phimain3 phimain4 rftshift pdisft tc03mb tc04mb vmaincav3 −40 −20 20 40 effect on l2-error [mm]

  • M. Frey

37 / 45

slide-38
SLIDE 38

Summary on Effect

  • Maximum absolute error:
  • TC1 - TC6 have a positive effect
  • TC8 - TC16 do not improve / harm
  • Except to initial radius, beam injection parameters negative effect
  • RF voltages mixed effect
  • l2 error ∼ error smoothness:
  • TC1 - TC4 have negative effect
  • TC5 almost no effect
  • TC6 - TC16 decrease non-smooth behaviour
  • Beam injection parameters almost no effect
  • Main cav 3 voltage strong negative effect
  • M. Frey

38 / 45

slide-39
SLIDE 39

Wiggly Solution due to TCs - Long Probe RRL1

Optimisation (subset of DVARs) with TCs disabled Optimisation of above with TCs only

  • M. Frey

39 / 45

slide-40
SLIDE 40

Final Results - RRI2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 turn number −6 −4 −2 2 4 ∆r [mm]

  • ptimiser

local search

  • M. Frey

40 / 45

slide-41
SLIDE 41

Final Results - RRL

9 19 29 39 49 59 69 79 89 99 109 119 129 139 149 159 169 179 turn number −6 −4 −2 2 4 ∆r [mm]

  • ptimiser

local search

  • M. Frey

41 / 45

slide-42
SLIDE 42

Final Results

Method l∞-norm MAE MSE (mm) (mm) (mm2)

  • ptimiser

6.4 2.0 6.3 local search 4.5 1.4 3.4

Table: Maximum absolute error (l∞-norm), mean absolute error (MAE) and the mean squared error (MSE) of the best individual of the optimiser and local search compared to the

  • measurement. In both cases the maximum error is at turn 2.
  • M. Frey

42 / 45

slide-43
SLIDE 43

Conclusions

  • New Trimcoil model
  • successfully implemented and tested
  • more realistic
  • Multi-Objective Optimization (MOO) in OPAL
  • massively parallel (used with > 1′000 cores)
  • suffers with individual selection in case of high-dimensional design variable space
  • other algorithms should be considered (e.g. simulated annealing)
  • to improve a simulation model (matching with measurements)
  • Local search of design variables
  • improved error of simulation vs. measurement
  • may get stuck and stop improving (combination of L∞- and L2-norms helps)
  • Please check out arXiv:1903.08935 (submitted to Phys. Rev. AB)
  • M. Frey

43 / 45

slide-44
SLIDE 44

Wir schaffen Wissen – heute f¨ ur morgen

Thanks to

  • H. Zhang
  • M. Humbel
  • R. D¨
  • lling
  • W. Joho
  • M. Kranjˇ

cevic

  • M. Frey

44 / 45

slide-45
SLIDE 45

Backup - Multi Particle Tracking

Comparison to l∞-norm MAE MSE (mm) (mm) (mm2) measurement 4.64 1.46 3.59 space charge 0.05 0.00 0.00

Table: Maximum absolute error (l∞-norm), mean absolute error (MAE) and the mean squared error (MSE) of the measurement or multi particle tracking simulation including space charge to the multi particle tracking simulation neglecting space charge.

  • M. Frey

45 / 45