1 | beam, SEQUENCE=Machine ,PARTICLE=electron, energy=3, RADIATE=True; |
---|
2 | option, RBARC=FALSE; |
---|
3 | OPTION, -ECHO, -WARN, INFO; |
---|
4 | call, file= "ALBA-25.4th.madx"; |
---|
5 | OPTION, ECHO, WARN, INFO; |
---|
6 | |
---|
7 | |
---|
8 | ! Put the RF cavity |
---|
9 | RFC: RFCAVITY, L=0.5, VOLT=3.6, LAG=0.480,HARMON=448; |
---|
10 | L_IDRF : DRIFT, L=L_ID->L-RFC->L; |
---|
11 | L_ID : LINE =(RFC, L_IDRF); |
---|
12 | |
---|
13 | |
---|
14 | use, period=Machine; |
---|
15 | twiss; |
---|
16 | EMIT,DELTAP=0.0 ; |
---|
17 | |
---|
18 | !The result of H emittance computed this way is: 0.11212603E-02 [pi micro m] |
---|
19 | !But it is wrong due to the fact that the variations of the twiss functions inside |
---|
20 | !the bendings are not taken into account. To solve this the best thing to do |
---|
21 | !is to slice the sbends in thick slices as follows: |
---|
22 | |
---|
23 | B1in: SBEND, L=B1->L/28, ANGLE=B1->ANGLE/28, K1=B1->K1, E1=B1->ANGLE/2, E2=0.0; |
---|
24 | B1i: SBEND, L=B1->L/28, ANGLE=B1->ANGLE/28, K1=B1->K1, E1=0.0, E2=0.0; |
---|
25 | B1out: SBEND, L=B1->L/28, ANGLE=B1->ANGLE/28, K1=B1->K1, E1=0.0 , E2=B1->ANGLE/2; |
---|
26 | BE: LINE=(B1in,B1i,B1i,B1i,B1i,B1i,B1i,B1i,& |
---|
27 | B1i, B1i,B1i,B1i,B1i,B1i,B1i,B1i,& |
---|
28 | B1i,B1i,B1i,B1i,B1i,B1i,B1i,B1i, & |
---|
29 | B1i,B1i,B1i,B1out); |
---|
30 | |
---|
31 | use, period=Machine; |
---|
32 | twiss; |
---|
33 | EMIT,DELTAP=0.0 ; |
---|
34 | ! |
---|
35 | !Now the emittance is correct: 0.44845315E-02 |
---|
36 | ! |
---|
37 | |
---|
38 | SELECT, FLAG=TWISS, CLEAR; |
---|
39 | SELECT, FLAG=TWISS, CLASS=QUADRUPOLE, COLUMN=NAME,S,BETX,BETY; |
---|
40 | |
---|
41 | USE, SEQUENCE=Machine; |
---|
42 | TWISS, SEQUENCE=Machine, FILE="twiss1"; |
---|
43 | |
---|
44 | stop; |
---|