Skip to content

Commit

Permalink
Correction to Zeuthen chicane input (#590)
Browse files Browse the repository at this point in the history
* 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.

* Update input_kurth_10nC.in

Selected numerical values for amr.n_cell, lattice.nslice, and geometry.prob_relative.

* Add README documentation for examples/distgen

* Correct C++ input file.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Delete examples/kurth/input_kurth_10nC.in

Not part of this pr

* Modify Python and MAD-X input

* Delete examples/distgen/README.rst

Not part of this PR.

* Update run_chicane.py

Update lb comment.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
cemitch99 and pre-commit-ci[bot] authored Apr 26, 2024
1 parent aa413b4 commit 875f035
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
8 changes: 4 additions & 4 deletions examples/chicane/chicane.madx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ D3: drift, L=2.0;
! theta=0.50037/10.35;
! inv_rho=1.0/10.35
! TODO put `angle=theta` for SBENDs and `e1=theta` for DIPEDGEs with their right sign
SB1: sbend, L=0.50037, angle=-0.04834492753623188, e1=0.000, e2=0.000, k1=0.00;
SB2: sbend, L=0.50037, angle=0.04834492753623188, e1=0.000, e2=0.000, k1=0.00;
SB1: sbend, L=0.500194828041958, angle=-0.04834492753623188, e1=0.000, e2=0.000, k1=0.00;
SB2: sbend, L=0.500194828041958, angle=0.04834492753623188, e1=0.000, e2=0.000, k1=0.00;
! dipole edge elements
DIPE1: dipedge, H=-0.0966183574879227, e1=-0.048345620280243, fint=0.000, hgap=0.000, tilt=0.00;
DIPE2: dipedge, H=0.0966183574879227, e1=0.048345620280243, fint=0.000, hgap=0.000, tilt=0.00;
DIPE1: dipedge, H=-0.096653578905433, e1=-0.048345620280243, fint=0.000, hgap=0.000, tilt=0.00;
DIPE2: dipedge, H=0.096653578905433, e1=0.048345620280243, fint=0.000, hgap=0.000, tilt=0.00;

CHICANE: Line=(M1,SB1,DIPE1,D1,DIPE2,SB2,D2,SB2,DIPE2,D1,DIPE1,SB1,D3,M1);
USE, SEQUENCE = CHICANE;
12 changes: 6 additions & 6 deletions examples/chicane/input_chicane.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ lattice.elements = monitor sbend1 dipedge1 drift1 dipedge2 sbend2 drift2 \
lattice.nslice = 25

sbend1.type = sbend
sbend1.ds = 0.50037 # projected length 0.5 m, angle 2.77 deg
sbend1.rc = -10.35
sbend1.ds = 0.500194828041958 # projected length 0.5 m, angle 2.77 deg
sbend1.rc = -10.3462283686195526

drift1.type = drift
drift1.ds = 5.0058489435 # projected length 5 m

sbend2.type = sbend
sbend2.ds = 0.50037 # projected length 0.5 m, angle 2.77 deg
sbend2.rc = 10.35
sbend2.ds = 0.500194828041958 # projected length 0.5 m, angle 2.77 deg
sbend2.rc = 10.3462283686195526

drift2.type = drift
drift2.ds = 1.0
Expand All @@ -44,13 +44,13 @@ drift3.ds = 2.0

dipedge1.type = dipedge # dipole edge focusing
dipedge1.psi = -0.048345620280243
dipedge1.rc = -10.35
dipedge1.rc = -10.3462283686195526
dipedge1.g = 0.0
dipedge1.K2 = 0.0

dipedge2.type = dipedge
dipedge2.psi = 0.048345620280243
dipedge2.rc = 10.35
dipedge2.rc = 10.3462283686195526
dipedge2.g = 0.0
dipedge2.K2 = 0.0

Expand Down
7 changes: 4 additions & 3 deletions examples/chicane/run_chicane.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,18 @@

# design the accelerator lattice
ns = 25 # number of slices per ds in the element
rc = 10.35 # bend radius (meters)
rc = 10.3462283686195526 # bend radius (meters)
psi = 0.048345620280243 # pole face rotation angle (radians)
lb = 0.500194828041958 # bend arc length (meters)

# Drift elements
dr1 = elements.Drift(ds=5.0058489435, nslice=ns)
dr2 = elements.Drift(ds=1.0, nslice=ns)
dr3 = elements.Drift(ds=2.0, nslice=ns)

# Bend elements
sbend1 = elements.Sbend(ds=0.50037, rc=-rc, nslice=ns)
sbend2 = elements.Sbend(ds=0.50037, rc=rc, nslice=ns)
sbend1 = elements.Sbend(ds=lb, rc=-rc, nslice=ns)
sbend2 = elements.Sbend(ds=lb, rc=rc, nslice=ns)

# Dipole Edge Focusing elements
dipedge1 = elements.DipEdge(psi=-psi, rc=-rc, g=0.0, K2=0.0)
Expand Down

0 comments on commit 875f035

Please sign in to comment.