Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
m4-20091125-411-4PMDW.lat 6.59 KiB
{ TITLE "ring20n-20080222 MAXIV lattice from Simon Leeman" }

define lattice; ringtype = 1;

Energy = 3.0;

{making dP smaller speeds up runtime}
dP     = 1e-6;
CODeps = 1e-14;

{Meth = 4; Nbend = 4; Nquad = 4; Nsext = 4; Ncorr = 1;}
Meth = 4; Nbend = 10; Nquad = 10; Nsext = 10; Ncorr = 1;

pi = 4.0*arctan(1.0);
c0 = 2.99792458e8;
Brho = 1e9*Energy/c0;


STR0500:   DRIFT, L= 5.0000000000E-01;
STR0450:   DRIFT, L= 4.5000000000E-01;
STRx403:   DRIFT, L= 4.0311000000E-01;
STR0400:   DRIFT, L= 4.0000000000E-01;
STR0302:   DRIFT, L= 3.0200000000E-01;
STRx203:   DRIFT, L= 2.0311000000E-01;
STRx113:   DRIFT, L= 1.1268000000E-01;
STR0100:   DRIFT, L= 1.0000000000E-01;
STR0075:   DRIFT, L= 7.5000000000E-02;
STR0050:   DRIFT, L= 5.0000000000E-02;
STR0025:   DRIFT, L= 2.5000000000E-02;
STRx013:   DRIFT, L= 1.2500000000E-02;
STR0010:   DRIFT, L= 1.0000000000E-02;
STRx006:   DRIFT, L= 6.0800000000E-03;


{ Girder Markers }
GS:  Marker;
GE:  Marker;


{ Beam Position Monitors }
BPM_D: Drift, L = 5.0e-2/2.0;
BPM_M: Beam Position Monitor;
BPM:   BPM_D, BPM_M, BPM_D;

{ Horizontal and vertical corrector }
CORR_D:  Drift, L = 10.0e-2/2.0;
CORR_H:  Corrector, Horizontal, Method= Meth;
CORR_V:  Corrector, Vertical, Method= Meth;
CORR:    CORR_D, CORR_H, CORR_V, CORR_D;


{T3 and OPA quad/sext strengths are normalized}
{m->m/2 for MAD8->T3}
{m->m/2 for MAD8->OPA}

DISPscale=1.0;QDmaster = 1.0;QFscale = 1.0;QDscale = 1.0;WQDscale = 1.0;WQFscale = 1.0;
{original OPA values}
QDmaster = -0.993433/Brho;
{for disp-free straights}
DISPscale = 1.0;
{for 42.20/14.28 in bare RING}
QFscale = 0.999993897;QDscale = 1.000595795;


D0:    BENDING, L= 3.6189000000E-01, T= 1.085673,
       K=8.6837*QDmaster*QDscale, T1= 0.0, T2= 0.0,
       N = Nbend, Method = Meth;

Df1:   BENDING, L= 5.0000000000E-02, T= 0.149940,
       K=8.6798*QDmaster*QDscale, T1= 0.0, T2= 0.0,
       N = Nbend, Method = Meth;

Df2:   BENDING, L= 5.0000000000E-02, T= 0.149685,
       K=8.6723*QDmaster*QDscale, T1= 0.0, T2= 0.0,
       N = Nbend, Method = Meth;

Df3:   BENDING, L= 5.0000000000E-02, T= 0.107834,
       K=5.9235*QDmaster*QDscale, T1= 0.0, T2= 0.0,
       N = Nbend, Method = Meth;

Df4:   BENDING, L= 5.0000000000E-02, T= 0.005351,
       K=-0.06434*QDmaster*QDscale, T1= 0.0, T2= 0.0,
       N = Nbend, Method = Meth;

Df5:   BENDING, L= 5.0000000000E-02, T= 0.001543,
       K=-0.00121*QDmaster*QDscale, T1= 0.0, T2= 0.0,
       N = Nbend, Method = Meth;

Dm6:   BENDING, L= 5.0000000000E-02, T= 0.002217,
       K=0.005164*QDmaster*QDscale, T1= 0.0, T2= 0.0,
       N = Nbend, Method = Meth;

Dm5:   BENDING, L= 5.0000000000E-02, T= 0.053563,
       K=2.932271*QDmaster*QDscale, T1= 0.0, T2= 0.0,
       N = Nbend, Method = Meth;

Dm4:   BENDING, L= 5.0000000000E-02, T= 0.074264,
       K=4.234943*QDmaster*QDscale, T1= 0.0, T2= 0.0,
       N = Nbend, Method = Meth;

Dm3:   BENDING, L= 5.0000000000E-02, T= 0.077218,
       K=4.299814*QDmaster*QDscale, T1= 0.0, T2= 0.0,
       N = Nbend, Method = Meth;

Dm2:   BENDING, L= 5.0000000000E-02, T= 0.116500,
       K=6.082495*QDmaster*QDscale, T1= 0.0, T2= 0.0,
       N = Nbend, Method = Meth;

Dm1:   BENDING, L= 5.0000000000E-02, T= 0.149165,
       K=8.562347*QDmaster*QDscale, T1= 0.0, T2= 0.0,
       N = Nbend, Method = Meth;

Dm0:   BENDING, L= 2.0424000000E-01, T= 0.612721,
       K=8.66874*QDmaster*QDscale, T1= 0.0, T2= 0.0,
       N = Nbend, Method = Meth;

DIP:   Df5, Df4, Df3, Df2, Df1, D0;
DIPm:  Dm6, Dm5, Dm4, Dm3, Dm2, Dm1, Dm0, Df1, Df2, Df3, Df4, Df5;


QF:     QUADRUPOLE, L= 1.5000000000E-01, K= 4.031557*QFscale,
        N = Nquad, Method = Meth;

QFm:    QUADRUPOLE, L= 1.5000000000E-01, K= 3.776598*DISPscale*QFscale,
        N = Nquad, Method = Meth;

QFend:  QUADRUPOLE, L= 2.5000000000E-01, K= 3.521817,
        N = Nquad, Method = Meth;

QDend:  QUADRUPOLE, L= 2.5000000000E-01, K=-2.176206,
        N = Nquad, Method = Meth;


QFendW: QUADRUPOLE, L= 2.5000000000E-01, K= 3.647797,
        N = Nquad, Method = Meth;

QDendW: QUADRUPOLE, L= 2.5000000000E-01, K=-2.513862,
        N = Nquad, Method = Meth;

SD:     SEXTUPOLE, L= 1.0000000000E-01, K=-116.285211,
        N = Nsext, Method = Meth;

SDend:  SEXTUPOLE, L= 1.0000000000E-01, K=-142.000000,
        N = Nsext, Method = Meth;

SFm:    SEXTUPOLE, L= 1.0000000000E-01, K=156.000000,
        N = Nsext, Method = Meth;

SFo:    SEXTUPOLE, L= 1.0000000000E-01, K=170.000000,
        N = Nsext, Method = Meth;

SFi:    SEXTUPOLE, L= 1.0000000000E-01, K=216.891574,
        N = Nsext, Method = Meth;


SQFm:   QFm, STR0075, SFm, STRx013, BPM, STRx013, QFm, STR0100, CORR;
SQFo:   QF,  STR0075, SFo, STRx013, BPM, STRx013, QF,  STR0100, CORR;
SQFi:   QF,  STR0075, SFi, STRx013, BPM, STRx013, QF,  STR0100, CORR;


OXX:   MULTIPOLE, L = 1.0e-1, HOM=(4,-135.5801/1.0e-1,0),
       N = Nsext, Method = Meth;

OXY:   MULTIPOLE, L = 1.0e-1, HOM=(4,216.2628/1.0e-1,0),
       N = Nsext, Method = Meth;

OYY:   MULTIPOLE, L = 1.0e-1, HOM=(4,-85.5096/1.0e-1,0),
       N = Nsext, Method = Meth;


h_rf = 176; C =  528.0;
CAV: Cavity, Frequency = c0/C*h_rf, Voltage = 1.5e6, Harnum = h_rf;


lambda_PMDW = 80e-3;
n_PMDW = 25;
L_PMDW = n_PMDW*lambda_PMDW;
B_PMDW=2.22;
PMDWw: Wiggler, L = L_PMDW, lambda = lambda_PMDW, kxV = 0.0, 
       BoBrhoV = B_PMDW/Brho, N = n_PMDW*4, Method = 2;
{PMDWw: insertion, scaling = 1.0, N = 50, Method = 2,
       file2 = "/home/simon/projects/in/lattice/pmdwkick.dat";}
PMDWd: Drift, L = -L_PMDW/2.0;
PMDW:  PMDWd, PMDWw, PMDWd;


LongStr:  4*STR0500, STR0400;
LongStrW: 4*STR0500, STR0400;
ShortStr: STR0450, STR0500, STR0302;
DIPuc:    SD, STR0010, DIP, INV(DIP), STR0010, SD;
UC1:      GS, SQFm, STRx203, DIPuc, GE, STRx403;
UC2:      GS, SQFo, STRx203, DIPuc, GE, STRx403;
UC3:      GS, SQFi, STRx203, DIPuc, STRx203;
UC4:      INV(SQFi), GE, STRx403, GS, DIPuc, STRx203;
UC5:      INV(SQFo), GE, STRx403, GS, DIPuc, STRx203, INV(SQFm), GE;
MC:       BPM, CORR, OXX, STR0025, QFend, STR0025, OXY, STR0100, QDend,
          STRx006, DIPm, OYY, STRx113, CORR, BPM, SDend, STR0050;
wMC:      BPM, CORR, OXX, STR0025, QFendW, STR0025, OXY, STR0100, QDendW,
          STRx006, DIPm, OYY, STRx113, CORR, BPM, SDend, STR0050;
LINE:     LongStr, GS, MC, GE, ShortStr, UC1, UC2, UC3, UC4, UC5,
          INV(ShortStr), GS, INV(MC), GE, INV(LongStr);
LINEw:    LongStr, GS, MC, GE, ShortStr, UC1, UC2, UC3, UC4, UC5,
          INV(ShortStr), GS, INV(wMC), GE, INV(LongStrW);
wLINE:    LongStrW, GS, wMC, GE, ShortStr, UC1, UC2, UC3, UC4, UC5,
          INV(ShortStr), GS, INV(MC), GE, INV(LongStr);
LINESw:   LINEw, PMDW, wLINE;


{RING: LINE, CAV;}
{RING: LINESw, CAV;}
{RING: LINESw, 3*LINE, CAV;}
RING: LINESw, 3*LINE, LINESw, 3*LINE, LINESw, 3*LINE, LINESw, 3*LINE, CAV;

CELL: RING, SYMMETRY = 1;

END;