source: PSPA/madxPSPA/tests/test-ptc-trackline/test-ptc-trackline.madx @ 430

Last change on this file since 430 was 430, checked in by touze, 11 years ago

import madx-5.01.00

File size: 3.9 KB
Line 
1!Example file showing the usage of PTC_SETSWITCH command
2!that sets the internal state (i.e switches) of PTC
3!
4!Piotr Skowronski (CERN)
5!
6! examples/ptc_madx_interface/intstate/intstate.ptc.madx
7!
8option,-echo;
9option,-info;
10
11LQL := 0.220; ! length of QL
12LQS := 0.124; ! length of QS
13CAVLENGTH := 2.4;
14QL  : QUADRUPOLE, L=LQL; ! QL quadrupole
15QS  : QUADRUPOLE, L=LQS; ! QS quadrupole
16
17!****** define the regular linac cell (Daniel)...
18
19TCAV      : TWCAVITY,  L=CAVLENGTH, VOLT=14.0d0, LAG=-30.d0/360., FREQ=3000.;
20
21ds_ql     : drift, l=0.25;    ! short drift between quads in Daniels design
22ds_trip   : drift, l=(3.34-CAVLENGTH)/2.; ! long drift between quads in Daniels design
23cell_mrk  : marker;
24cell_q1   : marker;
25cell_q3   : marker;
26beforecav : marker;
27bc : marker;
28aftercav  : marker;
29k_ls1     := -1.53125*.56/LQL; ! weaker foc.
30k_ls2     :=  1.53125/LQL;     ! weaker foc.
31quad_l1   : quadrupole, l=LQL,   k1=k_ls1;
32quad_l2   : quadrupole, l=LQL/2, k1=k_ls2;
33LDLS      :=(LQL-LQS)/2.; ! half L difference of QL and QS
34dls       : DRIFT, L=LDLS; ! 0.048 m
35
36ctfcell  : line=( quad_l2,ds_ql,quad_l1,cell_q1,ds_trip ,cell_mrk,
37                  beforecav,
38                  TCAV,
39                  aftercav,
40                  ds_trip,cell_q3,quad_l1,ds_ql,quad_l2);
41
42ctf   : line=(1*ctfcell);
43
44! calculate Twiss parameters for regular cell structure
45beam, PARTICLE=ELECTRON, ENERGY=0.02d0;
46
47USE, period=ctf;
48
49
50ptc_create_universe;
51ptc_create_layout, model=1, method=6, nst=100, exact=false, closed_layout=false;
52
53
54ptc_start, x=0.001, px=0.0003, y=-0.002, py=0, pt=0.0, t=0.0015;
55
56
57print, text="############################################";
58print, text="############################################";
59print, text="##     Tracking with default settings     ##";
60print, text="############################################";
61print, text="############################################";
62
63ptc_setswitch, debuglevel = 0, maxacceleration=true, exact_mis=true, time=true, totalpath=true, fringe=true;
64ptc_trackline,everystep, ffile=1;
65
66
67!print, text="############################################";
68!print, text="############################################";
69!print, text="##  Extensive Debug information printout  ##";
70!print, text="############################################";
71!print, text="############################################";
72!
73!ptc_setswitch, debuglevel = 10, maxacceleration=true, exact_mis=true, time=true, totalpath=true;
74!ptc_trackline;
75!!____________________________________________________________________________________________________________
76!
77!print, text="############################################";
78!print, text="############################################";
79!print, text="##           TOTALPATH==FALSE             ##";
80!print, text="##  T is given with respect to ref. part. ##";
81!print, text="############################################";
82!print, text="############################################";
83!
84!ptc_setswitch, debuglevel = 3, maxacceleration=true, exact_mis=true, time=true, totalpath=false;
85!ptc_trackline;
86!!____________________________________________________________________________________________________________
87!
88!
89!print, text="############################################";
90!print, text="############################################";
91!print, text="##              TIME==FALSE               ##";
92!print, text="##It is assumed that particle moves with c##";
93!print, text="############################################";
94!print, text="############################################";
95!
96!ptc_setswitch, debuglevel = 3, maxacceleration=true, exact_mis=true, time=false, totalpath=true;
97!ptc_trackline;
98!!____________________________________________________________________________________________________________
99
100
101ptc_track_end;
102
103
104
105ptc_end;
106stop;
107!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
108!  SSSSS  TTTTT   OOO   PPP
109!  S        T    O   O  P  P
110!  SSSSS    T    O   O  PPP
111!      S    T    O   O  P
112!  SSSSS    T     OOO   P
113!
Note: See TracBrowser for help on using the repository browser.