Skip to content

Commit

Permalink
Modify Python and MAD-X input
Browse files Browse the repository at this point in the history
  • Loading branch information
cemitch99 committed Apr 26, 2024
1 parent 63dca74 commit ba1bc6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 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;
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 # projected bend 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 ba1bc6a

Please sign in to comment.