From 205090bdfc1ca56d0a8814da91e28afd8d543ff3 Mon Sep 17 00:00:00 2001 From: Chad Mitchell Date: Tue, 7 Jun 2022 15:47:07 -0700 Subject: [PATCH 1/6] Examples for 3D space charge benchmarking - Modified the initial beam size in the IOTA lens benchmark example. - Added 2 benchmarks of 3D space charge for initial testing. - Add documentation for 2 benchmarks with space charge. - Add a benchmark example with space charge and periodic s-dependent focusing. - Added an s-dependent example using a Kurth beam without space charge. - Modified tolerance for IOTA lens benchmark example. Reduced tolerance to account for smaller initial beam size and improved preservation of invariants of motion. - Modified tolerances of space charge examples to allow CI tests to pass when space charge is not active. - Modified tolerance for space charge examples. These should fail unless space charge is turned on. --- examples/kurth/input_kurth_10nC.in | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 examples/kurth/input_kurth_10nC.in diff --git a/examples/kurth/input_kurth_10nC.in b/examples/kurth/input_kurth_10nC.in new file mode 100644 index 000000000..be1a3611d --- /dev/null +++ b/examples/kurth/input_kurth_10nC.in @@ -0,0 +1,37 @@ +############################################################################### +# Particle Beam(s) +############################################################################### +beam.npart = 10000 +beam.units = static +beam.energy = 2.0e3 +beam.charge = 1.0e-8 +beam.particle = proton +beam.distribution = kurth6d +beam.sigmaX = 1.2154443728379865788e-3 +beam.sigmaY = 1.2154443728379865788e-3 +beam.sigmaT = 4.0956844276541331005e-4 +beam.sigmaPx = 8.2274435782286157175e-4 +beam.sigmaPy = 8.2274435782286157175e-4 +beam.sigmaPt = 2.4415943602685364584e-3 + + +############################################################################### +# Beamline: lattice elements and segments +############################################################################### +lattice.elements = constf1 + +constf1.type = constf +constf1.ds = 2.0 +constf1.kx = 1.0 +constf1.ky = 1.0 +constf1.kt = 1.0 + + +############################################################################### +# Algorithms +############################################################################### +algo.particle_shape = 2 +algo.space_charge = true + +amr.n_cell = 40 40 32 +geometry.prob_relative = 1.0 From c7a2f7adfc23f8d6a693d7a03c4a19106f083012 Mon Sep 17 00:00:00 2001 From: Chad Mitchell <46825199+cemitch99@users.noreply.github.com> Date: Mon, 5 Dec 2022 15:14:50 -0800 Subject: [PATCH 2/6] Update input_kurth_10nC.in Selected numerical values for amr.n_cell, lattice.nslice, and geometry.prob_relative. --- examples/kurth/input_kurth_10nC.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/kurth/input_kurth_10nC.in b/examples/kurth/input_kurth_10nC.in index be1a3611d..6349bfdda 100644 --- a/examples/kurth/input_kurth_10nC.in +++ b/examples/kurth/input_kurth_10nC.in @@ -2,6 +2,7 @@ # Particle Beam(s) ############################################################################### beam.npart = 10000 +#beam.npart = 100000 #optional for increased precision beam.units = static beam.energy = 2.0e3 beam.charge = 1.0e-8 @@ -19,6 +20,8 @@ beam.sigmaPt = 2.4415943602685364584e-3 # Beamline: lattice elements and segments ############################################################################### lattice.elements = constf1 +lattice.nslice = 50 +#lattice.nslice = 100 #optional for increased precision constf1.type = constf constf1.ds = 2.0 @@ -33,5 +36,6 @@ constf1.kt = 1.0 algo.particle_shape = 2 algo.space_charge = true -amr.n_cell = 40 40 32 +amr.n_cell = 48 48 40 +#amr.n_cell = 72 72 72 #optional for increased precision geometry.prob_relative = 1.0 From 579fe4c95ecb76ae4cd3bc733e39e16798bfc073 Mon Sep 17 00:00:00 2001 From: Chad Mitchell Date: Wed, 28 Jun 2023 18:45:03 -0700 Subject: [PATCH 3/6] Add GSI space charge benchmark lattice. --- examples/gsi_benchmark/gsi.madx | 36 +++++++ examples/gsi_benchmark/input_gsilattice.in | 118 +++++++++++++++++++++ 2 files changed, 154 insertions(+) create mode 100644 examples/gsi_benchmark/gsi.madx create mode 100644 examples/gsi_benchmark/input_gsilattice.in diff --git a/examples/gsi_benchmark/gsi.madx b/examples/gsi_benchmark/gsi.madx new file mode 100644 index 000000000..fb08e4224 --- /dev/null +++ b/examples/gsi_benchmark/gsi.madx @@ -0,0 +1,36 @@ +! TITLE,'GSI.MADX -- SIS18 with a sextupole --'; +BEAM, PARTICLE=PROTON,ENERGY=11.4e-3; + +!--------------------- DRIFT SPACES DEFINITION --------------------- +DR1: DRIFT, TYPE=DRIF, L=0.6450000; +DR2: DRIFT, TYPE=DRIF, L=0.9700000; +DR3: DRIFT, TYPE=DRIF, L=6.8390117; +DR4: DRIFT, TYPE=DRIF, L=0.6000000; +DR5: DRIFT, TYPE=DRIF, L=0.7098000; +DR6: DRIFT, TYPE=DRIF, L=0.4998000; + + +!-------------------------- BENDING MAGNET --------------------------- +ALPHA := 15 * RADDEG; +LL := 150 * RADDEG; +PFR := 7.3 * RADDEG; +RB: SBEND,TYPE=B1,L= LL,ANGLE= ALPHA,E1= PFR,E2=PFR,HGAP= 0.035; + + +! ------------------- horizontal quadrupole ---------------------------- +QS1F: QUADRUPOLE, TYPE= QD1, L= 1.0400000, K1= 0.311872401; +QS2D: QUADRUPOLE, TYPE= QD2, L= 1.0400000, K1= -0.496504354; +QS3T: QUADRUPOLE, TYPE= QD3, L= 0.4804000, K1= 0.62221964; + + +! ------------------- normal sextupole --------------------------------- +S: MULTIPOLE, K2L = 0.2; + + +! --------------------------- LINE DEFINITION ------------------------- +CELL: LINE=(DR1,RB,DR2,RB,DR3,QS1F,DR4,QS2D,DR5,QS3T,DR6); + +MACHINE: LINE=(CELL, S, 11*CELL); + +USE, SEQUENCE = MACHINE; + diff --git a/examples/gsi_benchmark/input_gsilattice.in b/examples/gsi_benchmark/input_gsilattice.in new file mode 100644 index 000000000..c9579ad17 --- /dev/null +++ b/examples/gsi_benchmark/input_gsilattice.in @@ -0,0 +1,118 @@ +############################################################################### +# Particle Beam(s) +############################################################################### +beam.npart = 10000 +beam.units = static +beam.energy = 11.4 +beam.charge = 1.0e-9 +beam.particle = proton +beam.distribution = waterbag +beam.sigmaX = 5.0e-3 +beam.sigmaY = 5.0e-3 +beam.sigmaT = 261.198218975890164 +beam.sigmaPx = 1.257e-3 +beam.sigmaPy = 0.93e-3 +beam.sigmaPt = 3.8620094883e-5 +beam.muxpx = 0.0 +beam.muypy = 0.0 +beam.mutpt = 0.0 + + +############################################################################### +# Beamline: lattice elements and segments +############################################################################### +lattice.periods = 5 +lattice.elements = monitor cell sextupole chain + +# lines +cell.type = line +cell.elements = dr1 rb dr2 rb dr3 qs1f dr4 qs2d dr5 qs3t dr6 + +rb.type = line +rb.elements = e1 sbend1 e2 + +chain.type = line +chain.elements = cell +chain.repeat = 11 + + +# thick element splitting for space charge +lattice.nslice = 10 + + +# Drift elements: + +dr1.type = drift +dr1.ds = 0.6450000 + +dr2.type = drift +dr2.ds = 0.9700000 + +dr3.type = drift +dr3.ds = 6.8390117 + +dr4.type = drift +dr4.ds = 0.6000000 + +dr5.type = drift +dr5.ds = 0.7098000 + +dr6.type = drift +dr6.ds = 0.4998000 + + +# Bend elements: +sbend1.type = sbend +sbend1.ds = 2.6179938779914944 +sbend1.rc = 10.0 + +e1.type = dipedge +e1.psi = 0.127409035395586 +e1.rc = 10.0 +e1.g = 0.07 +e1.K2 = 0.5 + +e2.type = dipedge +e2.psi = 0.127409035395586 +e2.rc = 10.0 +e2.g = 0.07 +e2.K2 = 0.5 + + +# Quad elements: +qs1f.type = quad +qs1f.ds = 1.0400000 +qs1f.k = 0.311872401 + +qs2d.type = quad +qs2d.ds = 1.0400000 +qs2d.k = -0.496504354 + +qs3t.type = quad +qs3t.ds = 0.4804000 +qs3t.k = 0.62221964 + + +# Sextupole element: +sextupole.type = multipole +sextupole.multipole = 3 +sextupole.k_normal = 0.2 +sextupole.k_skew = 0.0 + + +# Beam Monitor: Diagnostics +monitor.type = beam_monitor +monitor.backend = h5 + + +############################################################################### +# Algorithms +############################################################################### +algo.particle_shape = 2 +algo.space_charge = false + + +############################################################################### +# Diagnostics +############################################################################### +diag.slice_step_diagnostics = true From 8255f20290317a42f6f6bff471c843abacfde2e6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 29 Jun 2023 01:47:17 +0000 Subject: [PATCH 4/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- examples/gsi_benchmark/gsi.madx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/gsi_benchmark/gsi.madx b/examples/gsi_benchmark/gsi.madx index fb08e4224..e2c511e5c 100644 --- a/examples/gsi_benchmark/gsi.madx +++ b/examples/gsi_benchmark/gsi.madx @@ -14,7 +14,7 @@ DR6: DRIFT, TYPE=DRIF, L=0.4998000; ALPHA := 15 * RADDEG; LL := 150 * RADDEG; PFR := 7.3 * RADDEG; -RB: SBEND,TYPE=B1,L= LL,ANGLE= ALPHA,E1= PFR,E2=PFR,HGAP= 0.035; +RB: SBEND,TYPE=B1,L= LL,ANGLE= ALPHA,E1= PFR,E2=PFR,HGAP= 0.035; ! ------------------- horizontal quadrupole ---------------------------- @@ -33,4 +33,3 @@ CELL: LINE=(DR1,RB,DR2,RB,DR3,QS1F,DR4,QS2D,DR5,QS3T,DR6); MACHINE: LINE=(CELL, S, 11*CELL); USE, SEQUENCE = MACHINE; - From 813af82afa735b213d1f3090a60d2b95225a002a Mon Sep 17 00:00:00 2001 From: Chad Mitchell <46825199+cemitch99@users.noreply.github.com> Date: Wed, 28 Jun 2023 18:47:45 -0700 Subject: [PATCH 5/6] Delete input_kurth_10nC.in This is not part of this pull request. --- examples/kurth/input_kurth_10nC.in | 41 ------------------------------ 1 file changed, 41 deletions(-) delete mode 100644 examples/kurth/input_kurth_10nC.in diff --git a/examples/kurth/input_kurth_10nC.in b/examples/kurth/input_kurth_10nC.in deleted file mode 100644 index 6349bfdda..000000000 --- a/examples/kurth/input_kurth_10nC.in +++ /dev/null @@ -1,41 +0,0 @@ -############################################################################### -# Particle Beam(s) -############################################################################### -beam.npart = 10000 -#beam.npart = 100000 #optional for increased precision -beam.units = static -beam.energy = 2.0e3 -beam.charge = 1.0e-8 -beam.particle = proton -beam.distribution = kurth6d -beam.sigmaX = 1.2154443728379865788e-3 -beam.sigmaY = 1.2154443728379865788e-3 -beam.sigmaT = 4.0956844276541331005e-4 -beam.sigmaPx = 8.2274435782286157175e-4 -beam.sigmaPy = 8.2274435782286157175e-4 -beam.sigmaPt = 2.4415943602685364584e-3 - - -############################################################################### -# Beamline: lattice elements and segments -############################################################################### -lattice.elements = constf1 -lattice.nslice = 50 -#lattice.nslice = 100 #optional for increased precision - -constf1.type = constf -constf1.ds = 2.0 -constf1.kx = 1.0 -constf1.ky = 1.0 -constf1.kt = 1.0 - - -############################################################################### -# Algorithms -############################################################################### -algo.particle_shape = 2 -algo.space_charge = true - -amr.n_cell = 48 48 40 -#amr.n_cell = 72 72 72 #optional for increased precision -geometry.prob_relative = 1.0 From 7714aa0cded3d85ad91b62075453c2b1cf9a7123 Mon Sep 17 00:00:00 2001 From: Chad Mitchell Date: Mon, 28 Aug 2023 09:22:23 -0700 Subject: [PATCH 6/6] Add rf and modify distribution input parameters. --- examples/gsi_benchmark/input_gsilattice.in | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/examples/gsi_benchmark/input_gsilattice.in b/examples/gsi_benchmark/input_gsilattice.in index c9579ad17..ef8f2dd39 100644 --- a/examples/gsi_benchmark/input_gsilattice.in +++ b/examples/gsi_benchmark/input_gsilattice.in @@ -6,13 +6,13 @@ beam.units = static beam.energy = 11.4 beam.charge = 1.0e-9 beam.particle = proton -beam.distribution = waterbag -beam.sigmaX = 5.0e-3 -beam.sigmaY = 5.0e-3 -beam.sigmaT = 261.198218975890164 -beam.sigmaPx = 1.257e-3 -beam.sigmaPy = 0.93e-3 -beam.sigmaPt = 3.8620094883e-5 +beam.distribution = gaussian +beam.sigmaX = 5.0e-3 #checked +beam.sigmaY = 5.0e-3 #checked +beam.sigmaT = 261.198218975890164 #checked +beam.sigmaPx = 1.257e-3 #to verify +beam.sigmaPy = 0.93e-3 #to verify +beam.sigmaPt = 3.8620094883e-5 #checked beam.muxpx = 0.0 beam.muypy = 0.0 beam.mutpt = 0.0 @@ -22,7 +22,7 @@ beam.mutpt = 0.0 # Beamline: lattice elements and segments ############################################################################### lattice.periods = 5 -lattice.elements = monitor cell sextupole chain +lattice.elements = monitor rf cell sextupole chain rf # lines cell.type = line @@ -100,6 +100,13 @@ sextupole.k_normal = 0.2 sextupole.k_skew = 0.0 +# Short RF element for bunching: +rf.type = shortrf +rf.V = 2.3184782e-8 +rf.freq = 1.0e4 +rf.phase = -90.0 + + # Beam Monitor: Diagnostics monitor.type = beam_monitor monitor.backend = h5