MAD-X V3 with Space Charge via Macros (2010) Benchmarking (GSI) with other Codes

26
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 present MAD-X custodian L. Deniau Application to the Fermilab Debuncher and comparison with ORBIT Frozen space charge model Frozen space charge model in MAD-X with adaptive in MAD-X with adaptive intensity and sigma intensity and sigma calculation calculation on behalf of Valery Kapin on behalf of Valery Kapin Acknowledgements: Acknowledgements: Y. Alexahin, G. Franchetti, F. Y. Alexahin, G. Franchetti, F. Schmidt, Schmidt, P. Zenkevich P. Zenkevich

description

Frozen space charge model in MAD-X with adaptive intensity and sigma calculation. on behalf of Valery Kapin Acknowledgements: Y. Alexahin, G. Franchetti, F. Schmidt, P. Zenkevich. MAD-X V3 with Space Charge via Macros (2010) Benchmarking (GSI) with other Codes - PowerPoint PPT Presentation

Transcript of MAD-X V3 with Space Charge via Macros (2010) Benchmarking (GSI) with other Codes

Page 1: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

• 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 present MAD-X custodian L. Deniau

• Application to the Fermilab Debuncher and comparison with ORBIT

Frozen space charge model in Frozen space charge model in MAD-X with adaptive intensity and MAD-X with adaptive intensity and

sigma calculationsigma calculation

on behalf of Valery Kapin on behalf of Valery Kapin

Acknowledgements: Acknowledgements: Y. Alexahin, G. Franchetti, F. Schmidt, Y. Alexahin, G. Franchetti, F. Schmidt,

P. ZenkevichP. Zenkevich

Page 2: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 2

MAD-X V3 with Space Charge for MAD-X V3 with Space Charge for Debuncher Debuncher (V. Kapin 2010)(V. 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 magnet strengths, phase trombone

• Emittance and sigma recalculation after every turn via TWISS

• Output (losses, emittances, etc)

Page 3: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

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

Page 4: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

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

Page 5: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

Y.AlexahinY.Alexahin, A.Drozhdin, N.Kazarinov, A.Drozhdin, N.Kazarinov, , “direct space charge in Fermilab Booster with MAD8”, “direct space charge in Fermilab Booster with MAD8”,

Beams-doc-2609-v1, 2007Beams-doc-2609-v1, 2007

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 Number of particle

Beam emittanceRed – horizontal, blue – vertical

Turn by Turn run of MAD8 under control of Mathematica

Page 6: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 6

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

Page 7: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 7

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)

Page 8: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 8

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/

Page 9: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 9

Benchmarking SIS18 Benchmarking SIS18 steps 1-5 for 4Dsteps 1-5 for 4D

• 1) Benchmarking of the Phase Space

MADX with BBs

Page 10: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 10

2) Benchmarking of the tunes versus particle

amplitude. Sextupole OFF.

Page 11: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 11

3) Benchmarking of the tunes versus particle

amplitude, with sextupole ON.

Page 12: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 12

4) Benchmarking of the Tunes versus particle

amplitude, with sextupole ON

Page 13: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 13

5) Benchmarking of phase space with space

charge and sextupole on at Qx = 4.3504

MAD-X with BB’s

MICROMAP SIMPSONS

Page 14: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 14

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)

Page 15: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 15

• The MACRO technique of MAD-X is working fine but typically one ends up with very complex logic 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 via turn-by-turn TFS tables

• Time varying phase trombone (Forest/Schmidt: Don’t use them!)

• Time varying RF cavity voltage

• Include the sigma and emittance determination after each turn

• Allow for stop&go for the MAD-X tracking routine to allow intermediate TWISS calculation at start and the locations of the SC elements

• Input via several TFS tables.

MADX-SC V5 (2012)MADX-SC V5 (2012)

Page 16: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 16

• Frank has 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

Page 17: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 17

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.

Page 18: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 18

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-SC

~2-4h

MAD-X V3 with Macros

MADX-SC V5

Page 19: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 19

Ex,y_rms vs Turn Number for the Ex,y_rms vs Turn Number for the DebuncherDebuncher

MADX-SC V5MAD-X V3 with Macros

Page 20: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 20

Longitudinal Emittance vs Turn Longitudinal Emittance vs Turn Number for the DebuncherNumber for the Debuncher

MAD-X V3 with Macros

MADX-SC V5

Page 21: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

Slow extraction in Debuncher using OrbitSlow extraction in Debuncher using Orbit

• Simulations with Orbit code (PIC + matrices) by Vladimir 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)

Page 22: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 22

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: Valery

advised to make mesh refinements

PIC: “Total Beam size increases at slow extraction => mesh number should be increased to keep the cell size”

Page 23: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 23

Simulations with ORBIT by V. Nagaslaev

Ramps are given in tables; Npart in bunch ~ 2.5e12

Page 24: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 24

• MADX-SC 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

Page 25: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 25

ReserveReserve

Page 26: MAD-X V3  with  Space Charge  via  Macros (2010) Benchmarking  (GSI) with other Codes

V. Kapin (F. Schmidt) SC-13 26

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

partpart0

,

1

2

0,,

0, yxyxyx