mad-x v3 with space charge via macros (2010) benchmarking (gsi) with other codes
DESCRIPTION
Frozen space charge model in MAD-X with adaptive intensity and sigma calculation. on behalf of V. Kapin Acknowledgement: Y. Alexahin, G. Franchetti, F. Schmidt, P. Zenkevich. MAD-X V3 with Space Charge via Macros (2010) Benchmarking (GSI) with other Codes - PowerPoint PPT PresentationTRANSCRIPT
• MAD-X V3 with Space Charge via Macros (2010)
• Benchmarking (GSI) with other Codes
• Implementing Space Charge directly into MADX-SC V5 (2012) latest version (2013) by MAD-X custodian Laurent Deniau
• Application to the Fermilab Debuncher and comparison with ORBIT
Frozen space charge model in MAD-X Frozen space charge model in MAD-X with adaptive intensity and sigma with adaptive intensity and sigma
calculationcalculation
on behalf of V. Kapin on behalf of V. Kapin
Acknowledgement: Acknowledgement: Y. Alexahin, G. Franchetti, F. Schmidt, P. Y. Alexahin, G. Franchetti, F. Schmidt, P. ZenkevichZenkevich
V. Kapin (F. Schmidt) SC-13 2
MAD-X V3 with Space Charge for MAD-X V3 with Space Charge for debuncher (Valery Kapin 2010)debuncher (Valery Kapin 2010)
• Utilizing the BB elements to create a frozen space charge model but adapting emittances and Twiss parameters for the sigma determination.
• Using the MAD-X Macro technique for all operations
• Phase-I: Lattice Preparation
• Splitting the elements (at least once) and introduce SC kicks in between
• Making sure that the lattice is stable including SC and proper sigma values ( next slide)
• Transferring thick lattices into thin ones (symplectic and only way to track in MAD-X)
• Phase-II: Running (turn-by-turn due to Macro procedures)
• Time varying fields
• Emittance and TWISS calculation during run
• Output (losses, emittances, etc)
V. Kapin (F. Schmidt) SC-13 3
The 2nd order ray tracing integrator for a The 2nd order ray tracing integrator for a
number of S-C kicksnumber of S-C kicks
V. Kapin (F. Schmidt) SC-13 4
Procedure to determine Beam SizesProcedure to determine Beam Sizeswith large SC Tune Swings with large SC Tune Swings
• TWISS fails for integer and/or half integer tunes • Trick to avoid it: turn on SC tune-shift in small steps and let tunes converge at each step
• Lines represent Laslett formula
2
2.1
2.2
2.3
2.4
2.5
1
1.1
1.2
1.3
1.4
1.5
0 5 10 15 20
Qx_formulaQx_num_I/2Qx_num_I
Qy_formulaQy_num_I/2Qy_num_I
N_iter
Reference:
Valery Kapin talk at GSI 2009
Y.AlexahinY.Alexahin, A.Drozhdin, N.Kazarinov, A.Drozhdin, N.Kazarinov, , “direct space charge in Booster with MAD8”, Beams-doc-2609-v1, “direct space charge in Booster with MAD8”, Beams-doc-2609-v1,
20072007
Unfortunately TRACK module of MAD8 (frozen, only executable file) does not permit to have more than 200 BB elements. Thereby the particle tracking has been fulfilled with 197 BB elements with average distance between ~ to 2.4 m.
- 3 - 2 - 1 0 1 2 3 , ra d
-2
-1
0
1
2
E ,
Me
V
0 50 100 150 200 250
1.2
1.3
1.4
1.5
x ,
mm
mra
d
Number of particle
Beam emittanceRed – horizontal, blue – vertical
0 50 100 150 200 250Tu rn
1
1.5
2
2.5
Bf
Y.AlexahinY.Alexahin, A.Drozhdin, N.Kazarinov, A.Drozhdin, N.Kazarinov, , “direct space charge in Booster with MAD8”, Beams-doc-2609-v1“direct space charge in Booster with MAD8”, Beams-doc-2609-v1
1) direct space charge in MAD using set of BEAMBEAM (BB) elements. Tune shift:
i
N
iiK
bb
14
1
where β – the Twiss beta-function at BB location, K – kick acting on the particle, Nbb – number of BB elements.
2) The number of particle N in fictitious colliding beam must be set as:
)1( 2
C
NLBN if
Here Bf – bunching factor, N – number of particle, C – circumference, Li – distance between successive BB elements, – relativistic factor.
The emittance have been evaluated by fitting the integral of distribution function with:
)/exp(1)( IIF where I – is action variable.
3) Simulation with changing emittancefrom turn to turn of the beam.
Fit at the first turn
V. Kapin (F. Schmidt) SC-13 7
Self-consistent (linear) BB-sizesSelf-consistent (linear) BB-sizes • Space-charge kicks simulated by
the 1st order MATRIX for
linear TWISS calculations;
• Linearly self-consistent beam sizes calculated by iterations with the
TWISS;
• Analytical Laslett's formula and numerical iterations provide near
the same tune shifts (for coasting beam !!!)
yxyx
yxyx B
Nr
,
,
23
partpart
0,
1
2
0,,
0, yxyxyx
V. Kapin (F. Schmidt) SC-13 8
BB-sizes for 6D simulationsBB-sizes for 6D simulations
Conte & MacKay, “Intro to Phys. Part. Acc”, 1991, 5.5
Dispersion:
trajectories x(s) is composed of two parts:
a) betatron oscillations x(s) , and particular solution
due to dispersion xD(s)=D(s)p.
b) Statistically beam size is tot=
+ [D(s) p]2
Beam size in bends (Dx0)is
increased for beam with p
V. Kapin (F. Schmidt) SC-13 9
Tracking with many BB in 6DTracking with many BB in 6D
• S.C. kicks by BB-elements for non-linear tracking;
(C.O. shifts are included; a total number BB-elements is
not limited);
• Thin-lens tracking with MADX (similar to MAD8)
with lattice conversion by MAKETHIN command
• Transverse BB-forces are modulated according to
longitudinal Gaussian distribution. Two versions:
a) given “fake” harmonical oscillations (GSI- 2009)
b) T from real 6D tracking (FNAL-2010)
V. Kapin (F. Schmidt) SC-13 10
Benchmarking with 4D & 6D simulations using MADX + Sp.Ch.
for SIS18 model(GSI, 2009)
vs.G. Franchetti (GSI), MICROMAP
S. Machida (RAL), SIMPSON
G. Franchetti, “Code Benchmarking on Space Charge Induced Trapping”:
http://www-linux.gsi.de/~giuliano/
V. Kapin (F. Schmidt) SC-13 11
Benchmarking SIS18 Benchmarking SIS18 steps 1-5 for 4Dsteps 1-5 for 4D
• 1) Benchmarking of the Phase Space
MADX with BBs
V. Kapin (F. Schmidt) SC-13 12
2) Benchmarking of the tunes versus particle
amplitude. Sextupole OFF.
V. Kapin (F. Schmidt) SC-13 13
3) Benchmarking of the tunes versus particle
amplitude, with sextupole ON.
V. Kapin (F. Schmidt) SC-13 14
4) Benchmarking of the Tunes versus particle
amplitude, with sextupole ON
V. Kapin (F. Schmidt) SC-13 15
5) Benchmarking of phase space with space
charge and sextupole on at Qx = 4.3504
MAD-X with BB’s
MICROMAP SIMPSONS
V. Kapin (F. Schmidt) SC-13 16
6) Benchmarking SIS18 for 6D (fake longitudinal motion)
Trapping test particle during 1 synchrotron oscillation
Evolution of the transverse rms emittance of a bunch (1000particles)
V. Kapin (F. Schmidt) SC-13 17
• The MACRO technique of MAD-X is working fine but typically one ends up with very complex logic so that even I (Valery) had to work hard to re-understand them after a delay of 2 years! Therefore quite unpractical for new applications.
• Macros are inherently slow!
• Therefore the idea was to reduce the use of Macros as much as possible and to modify the code to do most of the work directly within MAD-X.
• In detail:
• Time varying multipoles
• Time varying phase trombone (Forest/Schmidt: Don’t use them!)
• Time varying cavity voltage
• Include the sigma determination at each turn
• Allow for stop&go for the MAD-X tracking routine to allow intermediate TWISS calculation at start and the location of the SC elements
• Input via several TFS tables.
MADX_SC V5 (2012)MADX_SC V5 (2012)
V. Kapin (F. Schmidt) SC-13 18
• Frank have left the MAD-X project 2 years ago.
• Laurent Deniau at CERN has taken over till then.
• Frank has been a manager of the code with limited involvement in the actual code writing other than the PTC part. In particular, the core of the code in C has been written exclusively by Hans Grote.
• In a state of emergency Frank had to be ready to fix the code quickly.
• MAD-X is not well suited for this task since deferred evaluation
does not easily allow to put element parameters back into the database.
• Various C routines were needed but Hans did not have to help!
MAD-X Status MAD-X Status
V. Kapin (F. Schmidt) SC-13 19
Lattice with variable ParametersLattice with variable ParametersM.J.Syphers, “Status of Mu2e Operating Scenario”, Feb, 2010 Beams-doc-3556
Mu2e experiment Accelerator issue: 8 GeV Accumulator and Debuncher storage rings are used Compact bunches (<200ns, <0.025) are prepared in Accumulator ring Bunches are transferred to Debuncher ring and extracted out to the experiment using 3-rd
order resonant extraction with spill times ~150ms.
A stable, slow spill with a very intense proton beam is a big challenge.
V. Kapin (F. Schmidt) SC-13 20
N_macro_surv vs Turn Number N_macro_surv vs Turn Number for the Debuncher for the Debuncher
Timing on CERN computer
• Macro version ~20-24h
• MADX-5sp
~2-4h
V. Kapin (F. Schmidt) SC-13 21
Ex,y_rms vs Turn Number for the Ex,y_rms vs Turn Number for the DebuncherDebuncher
V. Kapin (F. Schmidt) SC-13 22
Longitudinal Emittance vs Turn Longitudinal Emittance vs Turn Number for the DebuncherNumber for the Debuncher
Slow extraction in Debuncher using OrbitSlow extraction in Debuncher using Orbit
• Simulations with Orbit code (PIC + matrices) by V.Nagaslaev• 3-order resonance with variable tune Qx and sext. str. K2• First “strange” results for extraction: “intensity drop”
intensity vs turns
Need to simulate in a lattice with variable parameters (Qx, K2)
V. Kapin (F. Schmidt) SC-13 24
Simulation Tasks:Simulation Tasks:
• Compare MADX and ORBIT space-charge simulations using the Debuncher lattice in ORBIT(6x6matr.)-style (created by V.Nagaslaev)
• Compare simulations for lattices with MAD-style (MAD-8 -> MADX) and ORBIT-style (6x6 matr.)
• Valery’s task was the code validations and comparisons. • The design of slow extraction is used “as is” and out of his
scope.
• “Intensity drop” was resolved simply at the beginning: I advised to make mesh refinements
PIC: “Total Beam size increases at slow extraction => mesh number should be increased to keep the cell size”
V. Kapin (F. Schmidt) SC-13 25
Simulations with ORBIT by VNSimulations with ORBIT by VN
Ramps are given in tables; Npart in bunch ~ 2.5e12
V. Kapin (F. Schmidt) SC-13 26
• MADX-5sc is going to be used at CERN as their frozen model tool for space charge studies. Any developments, bugfixes etc will be provided to Fermilab. Most probable I (Valery Kapin) and Yuri Alexahin will use it and CERN will hopefully help in case of problems and/or further developments.
• There has already been request by both BNL and GSI to apply it for their machines. Code, examples and help has been offered by CERN.
• In the meantime the code has been implemented into the latest version of MAD-X but a careful checking remains to be done.
• Documentation will soon be provided responsibility F. Schmidt
Future DevelopmentsFuture Developments