AWA Drive Linac G2 Optimisation PSI Ring Turnseparation Superconducting Optimisation
AWA Drive Linac
Input files: optLinac.dataoptLinac.tmpl
10 design variables
- Laser radius
- FWHM of laser pulse
- Solenoid strength
- Gun phase
- Linac cavity phase L1-L6
Emittance (emitx) and bunch length (rms_s) are recorded/optimized at 12.51 m.
optLinac-1
Reduced problem in order to have one forward solution in less than 2 minutes:
- Cores= 128
- Gens = 1000
- Indiv = 127
- Grid = 8x8x16
- Np = 5000
- T1 = 5e-13
- T2 = 5e-12
- Total time for optimisation: 1271 (s)
Generation 1
Generation 999
- Cores= 128
- Gens = 1000
- India = 127
- Grid = 16x16x32
- Np = 10000
- T1 = 5e-13
- T2 = 5e-12
- Total time for optimisation: 4157 (s)
Generation 1
Generation 999
optLinac-3
- Cores= 128
- Gens = 100
- India = 127
- Grid = 16x16x32
- Np = 50000
- T1 = 5e-13
- T2 = 5e-12
- Total time for optimisation: 1995.01 (s)
Generation 1
Generation 100
G2 Optimisation
7 design variables
- 7 quadrupole field gradients (all gantry 2 quadrupoles)
To optimize are the beam size (and the transmission) at the gantry isocenter (52.165m). The simulation started with a pre defined beam and also included the last quadrupole triplet (untouched settings) before the gantry (31.5926 - 52.50m).
- Cores= 64
- Gens = 100
- Initial population = 63
- Final population = 125
- NumParticles = 8000
- Timestep = 1e-11s
Generation 1
Generation 100
Generation 100 with constraint
constrs: CONSTRAINTS = (abs(drmsx-drmsy)>0.001);
Results in comparison with opal to the previous "by hand" tune.
Isocenter:
Left: Tune by hand
Right: OptPilot tune
Including Transmission
Runtime each Simulation: 51s
NumParticles over rmsx @Isocenter:
NumParticles over rmsx @Isocenter:
NumParticles over rmsx @Isocenter (zoom):
PSI Ring Turnseparation
The PSI Ring parameters are not well-known. The goal of this study is to find good simulation parameters that match the measurements. As objectives we use the radial turn locations. As optimisation parameters we use the injection angle, radius, energy and radial momentum.
The OPAL probe code has been extended to find the radial turn locations in the same way as in the measurement, see figure below.
RRI2 probe simulation histogram (for 5000 particles) with found peak locations.
RRI2 probe measurement with peak locations.
Test 1
First trial of optimizing three objectives:
- difference between simulation and measurement of peak 1
- difference between simulation and measurement of peak 2
- difference between simulation and measurement of peak 3 up to 5
Settings
- 1000 generations,
- 32 cores
- 500 particles
- no space charge
- 7 turns
IF ( _optpilot_ ) {
// ---- OPTIMIZER SECTION -------
//dphiinit: DVAR, VARIABLE="phiinit", LOWERBOUND="106", UPPERBOUND="114";
//drinit: DVAR, VARIABLE="rinit", LOWERBOUND="2000", UPPERBOUND="2060";
//dprinit: DVAR, VARIABLE="prinit", LOWERBOUND="-0.02", UPPERBOUND="-0.01";
//dbenergy: DVAR, VARIABLE="benergy", LOWERBOUND="0.071", UPPERBOUND="0.072";
//dvars: DVARS=(dphiinit,drinit,dprinit, dbenergy);
//dpeak1:OBJECTIVE,EXPR="fabs(radialPeak("RRI2.peaks", 1) - radialPeak("RawData/RRI2-0038Y17.peaks", 1))";
//dpeak2:OBJECTIVE,EXPR="fabs(radialPeak("RRI2.peaks", 2) - radialPeak("RawData/RRI2-0038Y17.peaks", 2))";
//dpeak3_5:OBJECTIVE,EXPR="sumErrSqRadialPeak("RRI2.peaks", "RawData/RRI2-0038Y17.peaks", 3, 5)";
//objs: OBJECTIVES=(dpeak1,dpeak2,dpeak3_5);
//constrs: CONSTRAINTS = ();
//opt: OPTIMIZE, OBJECTIVES = objs, DVARS = dvars, CONSTRAINTS = constrs;
}
Sum of all differences (simulation - measurement) of peak 1 per generation.
Sum of all differences (simulation - measurement) of peak 2 per generation.
Sum of all differences (simulation - measurement) of objective 3 per generation.
We see a nice decreasing curve for peak 1. Also the curve for peak 2 is mainly decreasing. However, the third objective is also increasing over the generations.
Superconducting Optimisation
Simple setup one dipole. Shift initial distribution in x-y plane and search for minimal emittance. Run 1000 generations.
Generation 1
Generation 100
Generation 999
Open questions and new runs
- Possibility to run optPilot while keeping the input files and maps on afs -> Achim is checking
- Read from a file: structure for optPilot
# Element PROB_2 x (mm), y (mm), z (mm), px ( ), py ( ), pz ( ), id, turn, time (ns)
PROB_2 0.618627 2325.63 150 0.848461 -0.062113 0 2 1 16.1428
PROB_2 0.606715 2300.1 150 0.741857 -0.000575306 0 1 1 17.0473
PROB_2 0.697536 2494.72 -832.791 0.534304 0.320705 -0.402196 0 1 18.6247
- New run:
//dv0: DVAR, VARIABLE="BEAM_RINIT", LOWERBOUND="-900", UPPERBOUND="-1100";
//dv1: DVAR, VARIABLE="FIELD_UNITS", LOWERBOUND="8.0", UPPERBOUND="11.0";
//dvars: DVARS=(dv0,dv1);
//oey:OBJECTIVE,EXPR="fabs(sameSDDSVariableAt("rms_x",7.05) - 0.005)";
//oes:OBJECTIVE,EXPR="fabs(sameSDDSVariableAt("rms_s",7.05) - 0.005)";