Home
USER'S GUIDE
Contents
1. PTC_READ_ERRORS overwrite logical PTC_MOVE_TO_LAYOUT index integer PTC_END Commands PTC_CREATE_UNIVERSE sector_nmul_max integer sector_nmul integer Description The PTC_CREATE_UNIVERSE command is needed to set up the PTC environment 209 Options Meaning Global variable in PTC needed for exact sector bends defining up to which order Maxwell s equation are solved fal page 76 77 The value of SECTOR_NMUL_MAX must not be smaller than SECTOR_NMUL otherwise MAD X stops with an error SECTOR_NMUL_MAX Global variable in PTC needed for exact sector bends defining up to which order the multipole are included in solving Maxwell s equation up to order SECTOR_NMUL_MAX Multipoles of order N with N gt SECTOR_NMUL and N lt SECTOR_NMUL_MAX are treated a la SixTrack SECTOR_NMUL This attribute invokes the second DA package written in C and kindly provided by Lingyun Yang lyyang Ibl gov Etienne Forest has written the wrapper to allow both the use of the legendary DA packages written in Fortran by Martin Berz default or this new DA package It is expected that this DA package will allow for the efficient calculation of a large number of DA parameters This flag allows the supression of the printing SYMPRINT of the check of symplecticity It is recommended to leave this flag set to TRUE PTC_CREATE_LAYOUT time logical model integer method integer
2. Examples BEAM PARTICLE ELECTRON ENERGY 50 EX 1 E 6 EY 1 E 8 SIGE 1 E 3 BEAM RADIATE RESBEAM BEAM EX 2 E 5 EY 3 E 7 SIGE 4 E 3 The first command selects electrons and sets energy and emittances The second one turns on synchrotron radiation The last two select positrons by default set the energy to 1 GeV default clear the synchrotron radiation flag and set the emittances to the values entered Some program modules of MAD X may also store data into a beam data block Expressions may refer to data in this beam data block using the notation BEAM gt attribute name or BEAMSsequence gt attribute name This notation refers to the value of attribute name found in the default BEAM resp the beam belonging to the sequence given This can be used for receiving or using values e g value beamslhcb2 gt bv or for storing values in the beam this does NOT trigger an update of dependent variables e g beam gt charge 1 The current values in the BEAM bank can be obtained by the command show beam resp show beam sequence lhansg 11 9 2000 20 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH RF Cavity label RFCAVITY L real VOLT real LAG real HARMON integer FREQ real An RFCAVITY has eight real attributes and one integer attribute L The length of the cavity DEFAULT 0 m VOLT The peak RF voltage DEFAULT
3. USE CELL1 SAVEBETA LABEL bini PLACE TWISS SEQUENCE CELL1 USE PERIOD LINE1 ATCH SEQUENCE LINE 1 BETAO bini MUX 1 234 MUY 4 567 This example transmits all values of the SAVEBETA array bini as initial values to the MATCH command and overrides the initial phase values by the given values An additional CONSTRAINT may be imposed in other places i e intermediate or end values of the optics functions at the transition point More than one active sequence The matching module can act on more than one sequence simultaneously by specifying more than one sequence after the MATCH command MATCH SE QUE NC E LINE 17 ELL1 B ETAO binil bini2 This example initiates the matching mode for the LINE1 and the CELL1 sequence The Twiss module function of the two sequences are calculated with fixed initial conditions The SAVEBETA array binil is used for calculating the optics functions of sequence LINE1 and the SAVEBETA array bini2 for calculating the optics functions of sequence CELL1 Without the initial conditions the matching module will work in the mode Special speed flag The slow attribute enforces the old and slow matching procedure Recently a number of parameter like RE56 have been added to list of matchable parameters Nevertheless some parameters might only be available when using the slow attribute
4. Examples VARY NAME PAR1 STEP 1 0E 4 vary global parameter PAR1 VARY NAME QL11 gt K1 STEP 1 0E 6 vary attribute K1 of the QL11 VARY NAME Q15 gt K1 STEP 0 0001 LOWER 0 0 UPPER 0 08 vary with limits If the upper limit is smaller than the lower limit the two limits are interchanged If the current value is outside the range defined by the limits it is brought back to range If a parameter comes outside the limits during the matching process the matching module resets the parameter to a value inside the limits and informs the user with a message If such a rescaling occurs more than 20 times the matching process terminates The user should either eliminate the corresponding parameters from the list of varied parameters or change the corresponding upper and lower limits before restarting the matching process After a matching operation all varied attributes retain their value after the last successful matching iteration Using JACOBIAN routine STRATEGY 3 in case the number of parameters is greater the the number of constraint if a parameter comes outside the limits it is excluded automatically from the set of variables and a new solution is searched Oliver Briining June 2002 February 2006 170 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Constraints CONSTRAINT Simple Constraint Simple constraints are imposed by the CONSTRAINT command The CONSTRAINT command has three attributes
5. SELECT FLAG MAKETHIN CLASS class RANGE range SLICE no of slices The created thin lens sequence has the following properties The created sequence has the same name as the original The original is therefore no longer available and has to be reloaded if it is needed again The slicer also slices any inserted sequence used in the main sequence These are also given the same names as the originals Any component changed into a single thin lens has the same name as the original Ifa component is sliced into more than one slice the individual slices have the same name as the original component and a suffix 1 2 etc and a marker will be placed at the center with the original name of the component 144 Hints See the for makethin Compare the optics before and after slicing with makethin Consider to increase the number of slices and rematch after makethin to reach the required accuracy Consider to replace rbend by sbend thin quads taking into account the edge focusing before slicing with makethin The selection works on the current sequence Consider to insert a USE SSEQUENCE before SELECT Helmut Burkhardt September 2005 145 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH DYNAP Tunes Tune Footprints Smear and Lyapunov Exponent DYNAP can be called instead of RUN inside a TRACK command DYNAP TURNS real FASTUNE logical LYAPUNOV real MAXAPER
6. PTC_NORMAL WRITE table normal_results file normal_results PTC_END Commands SELECT_PTC_NORMAL dx integer dpx integer dy integer dpy integer q1 0 dql integer q2 0 dq2 integer anhx integer array anhy integer array gnfu integer 0 0 haml integer 0 0 eign integer integer 241 Description The SELECT_PTC_NORMAL command selects parameters to be calculated by the next PTC_NORMAL command The dispersion and tune parameters are defined by a name and an integer number specifying their order For example the notation dx 2 means the horizontal dispersion to second order D 2 0 x o 38 p 2 where co is abbreviation of closed orbit The anharmonisities are defined by a name and three integer numbers the first is the order of 4 the second is the order of 2 the third is the order of 6 For example the notation anhx 2 0 0 means second order in 4 aq foe P Components of the eigenvectors at the end of the structure can be specified by two integers the first integer defines the eigenvector number the second integer defines the coordinate x Px Y Py gt t pi The Generating Function can be specified by n 0 0 The positive and negative values of n define the order of upright or skew resonances respectively The integers n and n3 are reserved for a future upgrade For example gnfu 5 0 0 will calculate all Generating Function terms for skew decapoles In the output tab
7. slice flatten sequence and cycle start to ip3 4 4 FAFEEFF HEEFT HEEFT EFFEEEEEEFEEEFFHPEFTE EFT E ETE EEE EF use sequence lhcbl makethin sequence lhcb1 save sequence lhcbl1 file lhcbl_thin_new_seq use sequence lhcb2 makethin sequence lhcb2 save sequence lhcb2 file lhcb2_thin_new_seq stop option warn echo info call file l1db V6 5 thin coll str option warn echo info keep sextupoles ksf0 ksf ksd0 ksd use period lhcbl select flag twiss 1 column name x y betx bety twiss file plot haxis s vaxis x y colour 100 noline use period lhcb2 select flag twiss 2 column name x y betx bety twiss file plot haxis s vaxis x y colour 100 noline segedit sequence lhcbl flatten endedit segedit sequence lhcbl cycle start ip3 bl endedit segqedit sequence lLhcb2 flatten 75 endedit seqedit sequence lhcb2 cycle start ip3 b2 endedit bbmarker marker for subsequent remove PEAFFFFFEFHFHFFFFTFFF F 4 4 4 Step 3 H H H am beam elements FEFEEE EEE HEAL E AFH HHH H H 4 4 444444 read macro definitions option echo call file ldb bb macros option echo this sets CHARGE in the head on beam beam elements set 1 ho_charge for para
8. BEAM PARTICLE ELECTRON ENERGY 50 EX 1 E 6 EY 1 E 8 ET 0 002 SIGT 1 E 2 USE PERIOD FODO TRACK START X 0 0010 Y 0 0017 PT 0 0003 DYNAP FASTUNE TURNS 1024 LYAPUNOV 1 e 7 ENDTRACK The first command defines the beam parameters It is essential that the longitudinal emittance ET is set The command use selects the beam line or sequence The track activates the tracking module start enters the starting coordinates more than one particle can be defined dynap finally tracks two nearby particles 146 with an initial distance lyapunov for each start definition over turns revolutions and endtrack terminates the execution of the tracking module The results are stored in the DYNAP and DUNAPTUNE tables and can be obtained by the commands value table dynap smear resp value dynaptune tunx dynaptune tuny dynaptune dtune More generally all results can be printed to a file using the commands write table dynap file write table dynaptune file The output file lyapunov data lists the turn number and phase distance between the two Lyapunov partners respectively allowing for visual inspection of chaoticity Frankz 20 03 2006 147 Fully Coupled Motion and Radiation EMIT Equilibrium Emittances The command EMIT DELTAP real TOL tolerance adjusts the RF frequencies such as to obtain the specified av
9. EUROPEAN ORGANISATION FOR NUCLEAR RESEARCH Program name MAD Methodical Accelerator Design CERN program library entry T5001 Authors or contacts Frank Schmidt cern ch SL Division CERN CH 1211 GENEVA 23 SWITZERLAND Copyright CERN Geneva 1990 Copyright and any other appropriate legal protection of this computer program and associated documentation reserved in all countries of the world Organisations collaborating with CERN may receive this program and documentation freely and without charge CERN undertakes no obligation for the maintenance of this program nor responsibility for its correctness and accepts no liability whatsoever resulting from its use Program and documentation are provided solely for the use of the organisation to which they are distributed This program may not be copied or otherwise distributed without permission This message must be retained on this and any other authorised copies The material cannot be sold CERN should be given credit in all references January 24 1997 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Conventions The accelerator and or beam line to be studied is described as a sequence of beam elements placed sequentially along a reference orbit The reference orbit is the path of a charged particle having the central design momentum of the accelerator through idealised magnets with no fringe fi
10. not OK table2 xx yy zz macro ingvar redtableclothing xx yy Zz macro readtable file afs cern ch user h hagen public MAD ALL emf g 0001 tf s Solution courtesy Hans Grote PTC knobs pol_blocks almost completely interfaced to MAD X User sets a knob with ptc_knob command Twiss parameters and user specified with ptc_select map components are buffered in memory after every element in form of taylor series They can be dumped to text file in two formats with ptc_printparametric command They can be also visualized and further studied with rviewer from rplot plugin Further user can set numeric values of knobs with ptc_setknobvalue what updates all numeric values of the parameters in the tables This way knobs can be used in matching New tracking feature by Andres Gomez Alonso Using flag recloss in the tracking command creates a table called trackloss which keeps a record of lost particles It can be saved using the write table trackloss command Changes for SDDS and online model knobs implemented with PTC with pol_blocks command to dump parametric results to file or stdout content of ptc_madx_tablepush f 90 moved to ptc_madx_knobs 90 the former one removed Correct bug in read_table can read long integers now Sceleton for knobs and arbitrary element placement implemented Lattice visualization via ROOT macro Printing detailed lattice geometry in PTC Several small bug corrections a
11. B B n MSCBV B B B MSCBH B B B MSCBV B B B MSCBH B B B MSCBV B B B Example 2 Addition of variables to any internal table select flag table column name s betx 35 38 51 04 57 825 73 18 88 84 104 aS 126 142 157 164 180 LIS 211 218 233 249 264 271 287 302 318 325 340 356 371 378 393 409 425 432 447 463 478 485 500 516 532 4 5 285 64 96 745 76 42 205 56 22 88 665 02 68 34 125 48 14 585 94 26 045 06 T2 505 86 52 18 61 96499987 34 61640793 33 34442808 58 61984637 103 0313887 166 2602486 171 6688159 108 1309095 61 96499987 34 61640793 33 34442808 58 61984637 103 0313887 166 2602486 171 6688159 108 1309095 61 96499987 34 61640793 33 34442808 58 61984637 103 0313887 166 2602486 171 6688159 108 1309095 61 96499987 34 61640793 33 34442808 58 61984637 103 0313887 166 2602486 171 6688159 108 1309095 61 96499987 34 61640793 33 34442808 58 61984637 103 0313887 166 2602486 eva Elva E27 4 ie 102 9962313 166 2227523 171 6309057 108 0956006 61 93159422 34 58939635 33 31817319 58 58680717 102 9962313 166 2227523 171 6309057 108 0956006 61 93159422 34 58939635 33 31817319 58 58680717 102 9962313 166 2227523 171 6309057 108 0956006 61 93159422 34 58939635 33 31817319 58 5868071
12. ORBIT logical For each previously entered start command DYNAP tracks two close by particles over a selected number of turns from which it obtains the betatron tunes with error the action smear and an estimate of the lyapunov exponent Many such companion particle pairs can be tracked at the same time which speeds up the calculation The smear is defined as 2 0 wxy max WXY min WXY max WXY min Where the WXY min max Tefer to the miminum and maximum values of the sum of the transverse betatron invariants wx wy during the tracking The tunes are computed by using an FFT and either formula 18 or formula 25 of CERN SL 95 84 AP depending on whether the number of turns is less equal or larger than 64 The arguments have the following meaning TURNS The number of turns to be tracked default 64 present maximum 1024 FASTUNE A logical flag If set the tunes are computed default false MAXAPER If the particle phase space coordinates exceed certain maximum values the particle is considered lost The maximum aperture is a vector of 6 real numbers default 0 1 0 01 0 1 0 01 1 0 0 1 LYAPUNOV The launch distance between two companion particles added to the x coordinate default 1 e 7 m ORBIT A logical flag If set the flag orbit is true during the tracking and its initialization default true This flag should be set to be true if normalized coordinates are to be entered Example
13. distort_I _H_end containing eight columns 1 multipole order 2 cosine part of Hamiltonian 3 sine part of Hamiltonian 4 amplitude of Hamiltonian 5 j 6 K 7 T 8 m If the attribute print_all has been set the following two files and the corresponding madx tables are created distort_1_F_all containing eleven columns 1 multipole order 2 appearance number in position range 3 number of resonance 4 position 5 cosine part of distortion 6 sine part of distortion 7 amplitude of distortion 8 j 9 k 10 T 11 m distort_1_H_all containing eleven columns 1 multipole order 2 appearance number in position range 3 number of resonance 4 position 5 cosine part of Hamiltonian 6 sine part of Hamiltonian 7 amplitude of Hamiltonian 8 j 9 K 10 r 11 m Subroutine distort2 launched by the attribute distort2 It calculates the distortion function and Hamiltonian terms in second order in the strength of the multipoles If the attribute print_at_end has been set the following two files and the corresponding madx tables are created distort_2_F_end containing nine columns 1 first multipole order 2 second multipole order 3 cosine part of distortion 4 sine part of distortion 5 amplitude of distortion 6 j 7 K 8 T 9
14. the SEQUENCE entry specifies the sequence for which the constraint applies the RANGE entry specifies the position where the constraint must be satisfied The RANGE can either be the name of a single element in the sequence or a range between two elements In the later case the two element names must be separated by a RANGE nam1 name2 the optics functions to be constrained The optic functions can be constraint in four different ways lower limits BETX gt value gt typel upper limits BETX lt value gt type2 lower and upper limits gt BETX lt valuel BETX gt value gt type3 target value BETX value gt type 4 In case one element is affected my more than one constraint command the last CONSTRAINT will be chosen For example one can specify the maximum acceptable beta function over a range of the sequence and specify the target beta function for one element that lies inside this range In this case one must first specify the constraint that affects the whole range and then the constraint for the single element This way the constraint of the target value overrides the previous constraint on the upper limit for the selected element For example the following constraint statements limit the maximum horizontal beta function between marker1 and marker2 to 200 meter and require a horizontal beta function of 180 meter at element namel CONSTRAINT SEQUENCE sequence name RANG
15. Ntuple and its modern extension called Tree are formats designed for storing particle tracking data It is proven to provide the fastest data writing and reading thanks to column wise I O operations It is commonly used for data storage by HEP experiments Additionally ROOT provides automatical ZIP data compression that is transparent for the user algorithms Morover ROOT provides wide set of very comfortable tools for advanced analysis and plotting of the data stored in Trees Addtionally we plan to extend RVIEWER functionality that would provide intuitive graphical user interface to most commonly used features in particle tracking in accelerators Thanks to that the user is not forced to learn how to use the ROOT package Currently the feature is enabled only for tracking using the ptc_trackline command however it will be extended to other tracking modes 315 Download The newest version is available here Installation Prerequisite ROOT must be installed beforehand compilation and whenever the user wants to use the plug in See explanations onfROOT webpage To install RPLOT 1 Unpack the archive it will create directory rplot tar xvzf rplot X XX tgz 2 Change to rplot directory cd rplot 3 Type make install Examples SYNOPSIS RVIEWER PROGRAMMERS MANUAL To be continued 316 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH References 1 The Graphical Kernel System GKS ISO Geneva
16. RESBEAM reset beam defaults label RESBEAM SEQUENCE name If the sequence name is omitted the default beam is reset Default BEAM Data PARTICLE POSITRON ENERGY 1 GeV EX 1 rad m EY 1 rad m ET 1 rad m KBUNCH al PART 0 BCURRENT OA BUNCHED TRUE RADIATE FALSE January 24 1997 103 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Edit a Beam Line Sequence With the help of the commands explained below a sequence may be modified in many ways the starting point can be moved to another place the order of elements can be inverted elements can be inserted one by one or as a whole group with one single command single elements or classes thereof can be removed elements can be replaced by others finally the sequence can be flattened i e all inserted sequences are replaced by their actual elements such that a flattened sequence contains only elements It is good practice to add a flatten statement at the end of a segedit operation to ensure a fully operational sequence And this is particularly useful for the save command to properly save shared sequences and to write out in MAD S format SEQEDIT segedit sequence s_name selects the sequence named for editing The editing is performed on the non expanded sequence after having finished the editing one has to re expand the sequence if necessary EXTRACT extract sequence s_name from MARKER_1 to MARK
17. SXF file input and output The command SXFWRITE FILE filename writes the currently i e last USEd sequence with all alignment and field errors in SXF format onto the file specified This then represents one instance of the sequence where all parameters are given by numbers rather than expressions the file can be read by other programs to get a complete picture of the sequence The command SXFREAD FILE filename reads a file in SXF format stores the sequence away and USEs it in order to keep the existing errors The following does therefore work Example job 1 define sequence MYSEQU use mysequ add alignment errors and field errors sxfwrite file file stop job 2 sxfread file file twiss stop January 24 1997 198 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH TFS File Format TFS files Table File System have been used in the LEP control system The MAD program knows only coded TFS files The TFS format has been chosen for all table output of MAD X TFS formatted tables can be read back into MAD X and may then be further processed TFS file example June 17 2002 199 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Descriptor Lines MAD X writes the following descriptors on all tables COMMENT The current title string from the most recent TITLE command ORIGIN The version of MAD X used DATE The date of the MAD X
18. sqrt beam gt ex table twiss betx use period fivecell select flag twiss column name s myvar apertype twiss file n 0 create table mytab column dp mql mq2 mgql table summ q1 mq2 table summ q2 while n lt 11 n n 1 dp 1 e 4 n 6 twiss deltap dp fill table mytab write table mytab plot haxis s vaxis aper_1l aper_2 colour 100 range s cbv 1 notitle stop prints the following user table on output NAME 05s MYTAB TYPE 04s USER TITLE S08s no title ORIGIN 16s MAD X 1 09 Linux DATE 08s 10 12 02 TIME 08s 10 45 25 DP MQ1 MQ2 S Sle Sle Sle 0 0005 14242535951 L270 202135 0 0004 1 242495534 1 270197018 0 0003 1 242452432 1 270185673 0 0002 1 242406653 1 270177093 0 0001 1 242358206 1 270171269 0 1 242307102 1 27016819 0 0001 1 242253353 1 270167843 0 0002 1 242196974 1 270170214 0 0003 1 24213798 1 270175288 0 0004 1 242076387 1 270183048 0 0005 1 242012214 1 270193477 and produces a twiss file with the additional column myvar as well as a plot file with the aperture values plotted 52 Example of joing 2 tables with different length into a third table making use of the length of either table as given by table your_table_name tablelength and adding names by the _name attribute title summing of offset and alignment tables set format 13 6f readtable table align
19. 13 14 15 16 17 18 19 20 22 23 A W Chao and M J Lee SPEAR II Touschek lifetime SPEAR 181 SLAC October 1974 M Conte and M Martini Particle Accelerators 17 1 1985 E D Courant and H S Snyder Theory of the alternating gradient synchrotron Annals of Physics 3 1 48 1958 Ph Defert Ph Hofmann and R Keyser The Table File System the C Interfaces LAW Note 9 CERN 1989 M Donald and D Schofield A User s Guide to the HARMON Program LEP Note 420 CERN 1982 A Dragt Lectures on Nonlinear Orbit Dynamics 1981 Summer School on High Energy Particle Accelerators Fermi National Accelerator Laboratory July 1981 American Institute of Physics 1982 D A Edwards and L C Teng Parametrisation of linear coupled motion in periodic systems IEEE Trans on Nucl Sc 20 885 1973 M Giovannozzi Analysis of the stability domain of planar symplectic maps using invariant manifolds CERN PS 96 05 PA 1996 H Grote GXPLOT User s Guide and Reference Manual LEP TH Note 57 CERN 1988 LEP Design Group Design Study of a 22 to 130 GeV electron positron Colliding Beam Machine LEP CERN ISR LEP 79 33 CERN 1979 M Hanney J M Jowett and E Keil BEAMPARAM A program for computing beam dynamics and performance of electron positron storage rings CERN LEP TH 88 2 CERN 1988 R H Helm M J Lee P L Morton and M Sands Evaluation of synchrotron radiation integrals IEEE
20. 164 Further attributes of the TWISS statements are RMATRIX If this flag is used the one turn map at the location of every element is calculated and prepared for storage in the TWISS table Target values for the matrix elements at certain positions in the sequence can be specified with the help of the CONSTRAINT command and the keywords RE RE11 RE16 RE61 RE66 where REij refers to the ij matrix component gt Examples Example 1 AATCH RMATRIX SEQUENCE name BETA0O beta block name CONSTRAINT SEQUENCE insert RANGE e RE11 2 808058321 re22 2 748111197 VARY NAME kqf STEP 1 0e 6 VARY NAME kqd STEP 1 0e 6 This matches the sequence name with initial conditions to new values for the matrix elements REI1 and RE22 by varying the strength of the main quadrupole circuits CHROM If this flag is used the chromatic functions at the location of every element are calculated and prepared for storage in the TWISS table Target values for the chromatic functions at certain positions in the sequence can be specified with the help of the CONSTRAINT command and the keywords WX PHIX WY PHIY Leave Matching Mode The ENDMATCH command terminates the matching section and deletes all tables related to the matching run ENDMATCH October 2003 Riccardo de Mariaj January 2008 165 References MAD Home Pag
21. DESY 98 179 see also Piwinski s article on Touschek lifetime in the Handbook of Accelerator Physics and Engineering A Chao M Tigner eds World Scientific 1999 The syntax of the TOUSCHEK command is TOUSCHEK FILE TOUSCHEK should be called after a TWISS command One or several cavities with rf voltages should be defined prior to calling TWISS and TOUSCHEK Warning Calling EMIT between the TWISS and TOUSCHEK commands leads to TOUSCHEK using wrong beam parameters even if the BEAM command is reiterated The momentum acceptance is taken from the bucket size taking into account the energy loss per turn UO from synchrotron radiation The value of UO is computed from the second synchrotron radiation integral synch_2 in the TWISS summ table synch_2 is calculated only when the TWISS option chrom is invoked using Eq 3 61 in Matt Sands report SLAC 121 which was generalized to the case of several harmonic rf systems If synch_2 0 not defined or not calculated zero energy loss is assumed In the case of several rf systems with nonzero voltages it is assumed that the lowest frequency system defines the phase of the outer point on the separatrix when calculating the momentum acceptance and that all higher harmonic systems are either in phase or in anti phase to the lowest frequency system Note if a storage rings really uses a different rf scheme one would need to change the acceptance function in the routi
22. MB SBEND L 1 MB APERTYPE ELLIPSE APERTURE 0 02202 0 02202 And an example for setting a FILENAME aperture for another magnet Notice that no aperture parameters are needed 130 MB SBEND L 5 APERTYPE myfile The syntax of myfile should be like this x0 yo xi yi xn yn Notes concerning the use of aperture There is some inconsistency in the parameter definition for the different APERTYPE This is historical and has to be kept for backwards compatibility Pay some attention to the parameters you introduce e When MAKETHIN is called all the thin slices inherit the aperture from their original thick lens version When the SIXTRACK command is called see the SixTrack converter module C6T the apertures are ignored by default To convert the apertures as well the APERTURE flag has to be set Aperture parameters are like all parameters and are inherited by offspring Like other parameters they can also be overridden by the offspring elements if necessary The APERTYPE and the APERTUREs themselves can be conveniently added to the TWISS table see Twiss Module by using the SELECT command E G the command select flag twiss clear select flag twiss column name s betx alfx mux bety alfy muy apertype aper_1l aper_2 and a subsequent TWISS command will put the aperture information together with the specified TWISS parameters into the TWISS table Defining tolerances
23. coefficients NAME 13s TYPE OIs TITLE O8s ORIGIN 19s DATE O8s TIME O8s MY_SECT_TABLE SECTORMAP no title MAD X 3 04 62 Linux 18 12 08 10 33 58 55 NAME s FIVECELL START SEQSTART QF 1 DRIFT_O MSCBH CBH 1 DRIFT_1 MB DRIFT_2 MB DRIFT_2 MB DRIFT_3 POS le 0 0 3 1 3 265 4 365 4 365 5 519992305 19 72000769 21 17999231 35 38000769 36 83999231 51 04000769 52 21 K1 le 0 0 1 305314637e 05 7 451656548e 21 1 686090613e 15 0 6 675347543e 21 2 566889547e 18 1 757758802e 20 2 822705549e 18 2 480880093e 20 3 006954115e 18 4 886652187e 20 R11 le 1 1 1 042224745 1 0 9999972755 1 1 1 000000091 1 1 000000091 1 1 000000091 1 R66 le T111 ole 0 0 0 0 0 006004411526 0 0 4 135903063e 25 0 4 135903063e 25 0 4 135903063e 25 0 Of course the select statement can be combined with additional options to filter out the list of elements such as in the following statement which for instance only retains drift type elements select flag my_sect_table class drift column name pos k1 r11 r66 t111 K coefficients range K1 K6 R coefficients range R11 R12 R61 R61 R62 R66 56 T coefficients range T111 we Tel T121 wt T621 T161 we TOOL T112 we F612 T166 we FOG In the above notation Ri j stands for effect on the i th coordina
24. e p Q Di DAI nin N OVW So J O JOa gt olution with initial conditions PTC ROTATION Rotation Around the Longitudinal Axis t N straight reference system tring attribute urve XF file input and outpu YSTEM 273 lt z eHRAK a ASS BE ZIR SISE B alla SAEI 7 Je m agaa a als o7 All lt lt S elle o Ol Ello zg Oyo Ello 1O ak Q S a ee E e 0 0 able access able of summary parameters FS columns table FS file example FS File Format hick Lens Tracking Module ptc_track hin Lens Tracking Module thintrack h ITLE e 4 oO v on io ia 4 R Combined Transverse Kicker OUSCHEK rack tables wiss module wiss table Units table VALU iable name WEIGHT Matching Weights WHILE example ild Card Pattern rite X PHIX WY PHIY 274 y YROTATION Rotation About the Vertical Axis 275 LW EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Effect of the bv flag in MAD X When reversing the direction V of a particle in a magnetic field B while keeping its charge constant the resulting force V B changes sign This is equivalent to flipping the field but not the direction For practical reasons the properties of all elements of the LHC are defined in the MADX input as if they apply to a clockwise proton beam LHC beam 1 This allows a single definition for elements traversed by both beams Their effects on a
25. nst integer exact logical offset_deltap double errors_out logical magnet_name string resplit logical thin double xbend double even logical Description The PTC_CREATE_LAYOUT command creates the PTC layout according to the specified integration method and fills it with the current MAD X sequence defined in the latest USE command The logical input variable time controls the coordinate system that is being used Options 210 Default Value Valu TIME MODEL METHOD nst exact louble XBEND TRUE logical FALSE logieal MAGNET _NAME NULL string RESPL orrser pevrae whle ERRORS OV MAGNET NAME rhis ERRORS OUT Remarks TIME at small energy Bo lt lt 1 momentum dependent variables like dispersion will depend strongly on the choice of the logical input variable time In fact the derivative 0 06 and 9p are different by the factor Bo One would therefore typically choose the option time false which sets the fifth variable to the relative momentum deviation p MODEL 1 for Drift Kick Drift 2 for Matrix Kick Matrix 3 for Delta Matrix Kick Matrix SixTrack code model NST sets the same value for all thick elements L gt 0 of a beam line Please note that each individual element may have its own NST value see below PTC
26. EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Collimators Two types of collimators are defined ECOLLIMATOR Elliptic aperture RCOLLIMATOR Rectangular aperture label ECOLLIMATOR TYPE name L real XSIZE real YSIZI label RCOLLIMATOR TYPE name L real XSIZE real YSIZI Either type has three real attributes L The collimator length default 0 m XSIZE The horizontal half aperture default unlimited YSIZE The vertical half aperture default unlimited For elliptic apertures XSIZE and YSIZE denote the half axes respectively for rectangular apertures they denote the half width of the rectangle Optically a collimator behaves like a drift space but during tracking it also introduces an aperture limit The aperture is checked at the entrance If the length is not zero the aperture is also checked at the exit Example COLLIM ECOLLIMATOR L 0 5 XSIZE 0 01 YSIZE 0 005 The straight reference system for a collimator is a cartesian coordinate system NOTE When a collimator is displaced transversally in order to model an asymmetric collimator particle losses in tracking are reported with respect to the displaced reference system not with respect to the surrounding beam line January 24 1997 114 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Coordinate Transformations YROTATION Rotation About the Vertical Axis label YROTATION TYPE name ANGLE
27. It can be saved using the write table trackloss command change in beambeam command usage of scattering beam with different radial shapes is possible parameters bbshape 1 default Gaussian standard as before 2 flattop or trapezoidal 3 hollow parabolic width for bbshape fractional width of edge region for bbshape fractional width of the parabolic part knobs implemented with PTC with pol_blocks command to dump parametric results to file or stdout content of ptc_madx_tablepush f 90 moved to ptc_madx_knobs 90 the former one removed Comment removed Element placement options added Commands for SDDS read and write Sceleton for knobs and arbitrary element placement implemented Lattice visualization via ROOT macro Printing detailed lattice geometry in PTC Several small bug corrections and some code cosmetics Introducing TRUERBEND and WEDGRBEND in PTC To this end 2 flags have been introduced in the NAD X dictionary madxdict h 1 pterbend if true it uses a PTC type RBEND 2 truerbend if true it uses TRUERBEND if false it uses WEDGRBEND Option for ptc_trackline position given in global coordinate system added Changing the conflicting ksl for the integrated solenoid strength to ksi This name is reserved for the vector of the integrated skew multipoles ksl Thick solenoid can now have normal knl and skew ksl multipole errors in PTC ignored in madx proper Thin solenoids are presently not consi
28. July 1985 International Standard ISO 7942 2 B Autin and Y Marti Closed Orbit Correction of Alternating Gradient Machines using a small Number of Magnets CERN ISR MA 73 17 CERN 1973 3 D P Barber K Heinemann H Mais and G Ripken A Fokker Planck Treatment of Stochastic Particle Motion within the Framework of a Fully Coupled 6 dimensional Formalism for Electron Positron Storage Rings including Classical Spin Motion in Linear Approximation DESY report 91 146 1991 4 R Bartolini A Bazzani M Giovannozzi W Scandale and E Todesco Tune evaluation in simulations and experiments CERN SL 95 84 AP 1995 5 J D Bjorken and S K Mtingwa Particle Accelerators 13 pg 115 6 E M Bollt and J D Meiss Targeting chaotic orbits to the Moon through recurrence Phys Lett A 204 373 1995 7 P Bramham and H Henke private communication and LEP Note LEP 70 107 CERN 8 Karl L Brown A First and Second Order Matrix Theory for the Design of Beam Transport Systems and Charged Particle Spectrometers SLAC 75 Revision 3 SLAC 1972 9 Karl L Brown D C Carey Ch Iselin and F Rothacker TRANSPORT A Computer Program for Designing Charged Particle Beam Transport Systems CERN 73 16 revised as CERN 80 4 CERN 1980 10 A Chao Evaluation of beam distribution parameters in an electron storage ring Journal of Applied Physics 50 595 598 1979 317 11 A W Chao and M J Lee SPEAR II Touschek lifetime
29. X PX Y PY T PT canonical coordinates 0 0 double FX PHIX FY PHIY FT PHIT action angle coordinates 0 0 double Remarks 1 If the option closed_orbit in the PTC_TRACK command is active see below all coordinates are specified with respect to the actual closed orbit possibly off momentum with magnet errors and NOT with respect to the reference orbit If the option is absent then coordinates are specified with respect to the reference orbit 2 In the uncoupled case the canonical and the action angle variables are related with equations z F E cos p F E 7 sin 3 The use of the action angle coordinates requires the option in the IPTC_TRACK command 4 If both the canonical and the action angle coordinates are given in the PTC_START command they are summed after conversion of the action angle coordinates to the canonical ones PTC_OBSERVE place string Description Besides of the beginning of the beam line one can define an additional observation points along the machine Subsequent PTC_TRACK command will then record the tracking data on all these observation points Option Meaning name of observation point markers string are very much preferred Remarks 1 The first observation point at the beginning of the beam line is marked as start 2 It is recommended to useflabels of markers in order to avoid usage observations at the ends of thick elements 3 The
30. bv kick acbhv2 bv kick achv3 bv kick acbv4 5 cbv kick acbv5 mscbh sextupole l 1 1 k2 ksf mscbh multipole knl 0 0 0 ksf tilt pi 8 mscbv sextupole 1 1 1 k2 ksd mscbv octupole 1 1 1 k3 ksd tilt pi 8 o lt 0 lt BwWNHrR OBWNHE lt mO OG A O O G O 0 O OG O T oF a g o o lt sequence declaration fivecell sequence refer centre 1 534 6 gqf l qf 1 at 1 550000e 00 gft qft at 3 815000e 00 mscbh mscbh at 3 815000e 00 cbh 1 cbh 1 at 4 365000e 00 mb mb at 1 262000e 01 mb mb at 2 828000e 01 mb mb at 4 394000e 01 bpv bpv at 5 246000e 01 qd 1l qd 1 at 5 501000e 01 mscbv mscbv at 5 727500e 01 cbv 1 cbv 1 at 5 782500e 01 mb mb at 6 608000e 01 mo mb at 8 174000e 01 mo mb at 9 740000e 01 bph bph at 1 059200e 02 gf 2 qf 2 at 1 084700e 02 oo 50 mscbh mscbh ebh 2 ebH 2 mbo mb mbo mb mbo mb at 1 107350e 02 at 1 112850e 02 at 1 195400e 02 at 1 352000e 02 at 1 508600e 02 bpv bpv qd 2 qd 2 at 1 593800e 02 at 1 619300e 02 mscbv mscbv cbhv 2 cbhv 2 mbo mb mbo mb at 1 641950e 02 at 1 647450e 02 at 1 730000e 02 at 1 886600e 02 mb mb bph bph qE 3 qG 3 mscbh mscbh at 2 043200e 02 at 2 128400e 02 at 2 153900e 02 at 2 176550e 02 chh 3 cbh 3 mb mb mb mb mb mb bpv bpv gqd 3 qd 3 mscbv mscbhv at 2 71 cbhv 3 cbv 3 a
31. considered not existing This allows to study the effect of missing monitors Default is 1 0 100 CORRLIM A limit on the maximum corrector strength can be given and a WARNING is issued if it is exceeded by one or more correctors Please note the strengths computed by the correction algorithms are NOT limited only a warning is printed Default is 1 0 mrad Normally the last active table provides the orbit to be corrected and the model for the correction This can be overwritten by the appropriate options Optionally these tables can be given names like in TWISS TABLE name see documentation on TWISS command To use these named tables one of the following optional parameters must be used ORBIT When this parameter is given the orbit to be corrected is taken from a named table The default is the last named or unnamed Twiss table MODEL When this parameter is given the model for the correction is taken from a named Twiss table The default is the last named or unnamed Twiss table TARGET When this parameter is given the correction is made to a named target orbit pre computed with a TWISS command Default is correction to the zero orbit Please note the target orbit is normally computed by MAD within the same job Two attributes affect the printing of tables and results CLIST file Corrector settings in units of rad before and after correction printed to file MLIST file Monitor readings in units of m before and a
32. either canonical coordinates START X double PX double Y double PY double T double PT double or action angle coordinates START FX double PHIX double FY double PHIY double FT double PHIT double For this case the normalised amplitudes are expressed in number of r m s beam size F x Fy Fr the actions being computed with the emittances in the BEAM command in each mode plane The phases are PHIx PHI y and PHI 7 expressed in radian In the uncoupled case we have in the plane mode labelled z Z F sqrt E cos PHI P F sqrt E sin PHI where E is the r m s emittance in the plane Z Options Default Value Option Meaning Value Type X PX Y PY T PT canonical coordinates 0 0 double FX PHIX FY PHIY FT action angle PHIT coordinates 0 0 double Remarks For usual tracking single multi turn all coordinates are specified with respect to the actual closed orbit possibly off momentum with magnet errors and NOT with respect to the reference orbit If the option onepass is used the coordinates are specified with respect to the reference orbit The name onepass might be misleading Still tracking can be single or multi turn OBSERVE place string Description Coordinates can be recorded at places that have names Such observation points are specified by the command OBSERVE as many commands as places The output files are named automatically The name give
33. i e the MAD X input file is used as input for PTC Internally both PTC and MAD X have their own independent databases which are linked via the interface With the PTC_CREATE_LAYOUT command only numerical numbers are transferred from the MAD X database to the PTC database Any modification to the MAD X database is ignored in PTC until the next call to For example aldeferred expressionlof MAD X after a command is ignored within PTC Examples Examples for any MADX PTC module contain the above PTC set up commands References a E Forest F Schmidt and E McIntosh Introduction to the Polymorphic Tracking Code CERN SL 2002 044 AP KEK report 2002 3 July 2002 b F Schmidt MAD X PTC Integration Proc of the 2005 PAC Conference in Knoxville USA pp 1272 See Also TEA V Kapin ITEP and F Schmidt March 2006 213 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Overview of MAD X Tracking Modules A number of particles with given initial conditions can be tracked through a beam line or a ring The particles can be tracked either for a single passage or for many turns While MAD X fal is keeping most of the functionality of its predecessor MAD 8 the trajectory tracking in MAD X is considerably modified comparing to MAD 8 The reason is that in MADS the thick lens tracking is inherently not symplectic which implies that the phase space volume is not preserved during the tracking i e contrary to the real
34. m distort_2_H_end containing nine columns 1 first multipole order 2 second multipole order 3 cosine part of Hamiltonian 4 sine part of Hamiltonian 5 amplitude of Hamiltonian 6 j 7 K 8 T 9 m 194 00000 O N B The first row of every file is a header containing the names of the columns This row is absent in the internal tables SODD sodd detune logical distortl logical distort2 logical start_stop starl stop multipole_order_range fist last noprint logical print_all logical print_at_end logical nosixtrack logical where the parameters have the following meaning detune logical default false If true the detune subroutine is executed distort1 logical default false If true the distort subroutine is executed distort2 logical default false If true the distort2 subroutine is executed start_stop longitudinal interval of the beam line in m start and stop should be given as real numbers multipole_order_range the lowest and the largest multipole order which will be taken in account first and last should be given as integers noprint logical default false If true no file or internal table will be created to keep the results In this case the attributes print_all or print_at_end have no effect print_all logical default false If true the files and internal tables containing results at each multipole will be gen
35. offsetelem filename where the parameters have the following meaning O O o00000000000 file Output file with aperture table Default none halofile Input file with halo polygon coordinates Will suppress an eventual halo parameter Default none range given by elements Default s e exn Normalised horizontal emittance Default 3 75 e 6 eyn Normalised vertical emittance Default 3 75 e 6 dgf Peak linear dispersion m Default 2 086 betaqfx Beta x in standard qf m Default 170 25 dp Bucket edge at the current beam energy Default 0 0015 dparx Fractional horizontal parasitic dispersion Default 0 273 dpary Fractional vertical parasitic dispersion Default 0 273 cor Maximum radial closed orbit uncertainty m Default 0 004 bbeat Beta beating coefficient applying to beam size Default 1 1 nco Number of azimuth for radial scan Default 5 halo Halo parameters n r h v n is the radius of the primary halo r is the radial part of the secondary halo h and v is the horizontal and vertical cuts in the secondary halo Default 6 8 4 7 3 7 3 interval Approximate length in meters between measurements Actual value nslice nodelength interval nslice is rounded down to closest integer interval nodelength nslice Default 1 0 spec Aperture spec for plotting only Gives the spec line in the plot Default 0 0 notsimple Use only if one or more beamscreens in the ran
36. on_ho2 lt gt 0 exec bbho 2 if on_lr21 lt gt 0 n 1 counter while n lt npara_2 exec bbl 2 n n n 1 Et Cone t2r lt gt lt 0 n 1 counter while n lt npara_2 exec bbr 2 n n n 1 ip8 if on_ho8 lt gt 0 exec bbho 8 if on_lr81 lt gt 0 81 n 1 counter while n lt npara_8 exec bb1 8 n n n 1 if on_lr8r lt gt 0 n 1 counter while n lt npara_8 exec bbr 8 n n n 1 assign echo terminal call file temp bb install system rm temp bb install 1 1 1 install bb elements assign echo temp bb install t ipi if on_ho1 lt gt 0 exec inho bb 1 if on_lrll lt gt 0 n 1 counter while n lt npara_1 exec inl bb 1 n n n 1 if on_lrir lt gt 0 n 1 counter while n lt npara_1 exec inr bb 1 n n n 1 l 25 po if on_ho5 lt gt 0 exec inho bb 5 if on_lr51 lt gt 0 n 1 counter while n lt npara_5 82 exec inl bb 5 n n n 1 if on_lr5r lt gt 0 n 1 counter while n lt npara_5 exec inr bb 5 n n n 1 ip2 if on_ho2 lt gt 0 exec inho bb 2 if i on1r21 lt gt 0 n 1 counter while n lt npara_2 exec inl bb 2 n n n 1 if on_lr2r lt gt 0 n 1 counter while n lt npara_2 exec inr bb 2 n n
37. 0 on_1lr21 lt gt 0 n 1 counter while n lt npara_2 exec mkr 2 n exec sbr 2 n n n 1 ip8 if on_ho8 lt gt 0 exec mkho 8 exec sbhomk 8 if on_lr81 lt gt 0 on_lir8r lt gt 0 n 1 counter while n lt npara_8 exec mk1 8 n exec sbl 8 n n n 1 if on_lr8r lt gt 0 on_l1lr81 lt gt 0 n 1 counter while n lt npara_8 exec mkr 8 n exec sbr 8 n n n 1 assign echo terminal call file temp bb install system rm temp bb install 1 1 install bb markers assign echo temp bb install Las pL if on_ho1 lt gt 0 exec inho mk 1 if on_lrl1l lt gt 0 on_lrir lt gt 0 n 1 counter while n lt npara_1 exec inl mk 1 n n n 1 78 if con lrir lt gt 0 on_lrll lt gt 0 n 1 counter while n lt npara_1 exec inr mk 1 n n n 1 Base 215 if on_ho5 lt gt 0 exec inho mk 5 if on_lr5l lt gt 0 on_lr5Sr lt gt 0 n 1 counter while n lt npara_5 exec inl mk 5 n n n 1 if on_lr5r lt gt 0 on_lr5l lt gt 0 n 1 counter while n lt npara_5 exec inr mk 5 n n n 1 hi ip2 if on_ho2 lt gt 0 exec inho mk 2 if on_lr21 lt gt 0 on_lr2r lt gt 0 n 1 counter while n lt npara_2 exec inl mk 2 n n n 1 if on_lr2r lt g
38. 0 MV The effect of the cavity is delta E VOLT sin 2 pi LAG HARMON fo 0 LAG The phase lag 2pi DEFAULT 0 FREQ The frequency MHz no DEFAULT Note that if the RF frequency is not given it is computed from the harmonic number and the revolution frequency fg as before However for accelerating structures this makes no sense and the frequency is mandatory HARMON The harmonic number h no DEFAULT Only if the frequency is not given Please take note that the following MADS attributes BETRF PG SHUNT and TFILL are currently not implemented in MAD X lt Note as well that twiss is 4D only As a consequence the TWISS parameters in the plane of non zero dispersion may not close as expected Therefore it is best to perform TWISS in 4D only i e with cavities switched off If 6D is needed one has to use the ptc_twiss command The RFCAVITY has attributes that will only become active in PTC n_bessel DEFAULT 0 Transverse focussing effects are typically ignored in the cavity in MAD X or even PTC This effect is being calculated to order n_bessel with n_bessel 0 disregarding this effect and with a correct treatment when n_bessel goes to infinty no_cavity_totalpath DEFAULT no_cavity_totalpath false flag to choose if in a cavity the transit time factor is considered no_cavity_totalpath false or if the particle is kept on the crest of RF voltage no_cavity_totalpath true A cavity requires
39. 1 madx_ptc_module without the ptc_normal stuff 2 fixing the savemaps bug Fix to restricted print out format 1 Se_status preliminary fix of uninitialized variable RADIATION_NEW 2 madx_ptc_module Fix of ptc_normal by fixing the string comparison 3 madx_ptc_module amp madx_ptc_twiss write amp read traditional DA map format PTC version including spin madX 3_03_48 Final fix of the TILT saga Tilt is calculated exclusively in twiss F following the strategy 0 These changes concern quad sext oct elec separator but NOT dipole or multipole 1 TILT input is the external tilt k 2 k amp ks represent an internal tilt 3 at each element the total tilt amp sqrt k 2 ks 2 is calculated including field errors i e the correct way which might cause differences with MAD8 4 PTC has been adjusted appropriate 5 Possible effects on survey and emit will be tested 6 Many Thanks for HG for his help Redundant debug info available only in high level debug mode VORNAME assigned the same as name of node in MADX but with capital letters Too long line split into 3 lines useless print statements Fixing the crash for sbend exact multipoles larger than 10 This set up requires to solve Maxwell s equation up to SECTOR_NMUL_MAX The default is set to 10 to avoid excessive computing time This is now safeguarded in madxp To this end the parameters SECTOR_NMUL and SECTOR_NMUL_MAX are transfered from ptc_create_layout t
40. 1 2 del beta del s MUX Phase function mu 2pi MUX mu integral ds beta e Dx Dispersion D of x m DX D del x del PT DPX Dispersion D of px 1 DPX D px del p del PT ps BETY Amplitude function beta m e ALFY Correlation function alpha 1 ALFY alpha 1 2 del beta del s 35 MUY Phase function mu 2pi MUY mu integral ds beta DY Dispersion D of y m DY D del y del PT DPY Dispersion D px of px 1 DPY D p del p del PT ps R11 R12 R21 R22 Coupling Matrix ENERGY The total energy per particle in GeV If given it must be greater then the particle mass Chromatic Functions Several MAD commands refer to the chromatic functions p x p y instead of the slopes x y their definitions differ slightly from those in Montague Notice that in MAD X PT substitutes DELTAP as longitudinal variable Dispersive and chromatic functions are hence derivatives with respects to PT Being PT BETA DELTAP where BETA is the relativistic Lorentz factor those functions must be multiplied by BETA a number of time equal to the order of the derivative The chromatic functions are known to MAD under the following names Please note that this option is needed for a proper calculation of the chromaticities in the presence of coupling WX Chromatic amplitude function W 1 WX W sqrt a b 7 a del b
41. 2009 check if point x xm ym is in the segment s e with s startx starty and e endx endy by computing cosfi x s x e Ix sllx el cosfi 1 x is in first check if Ix sl and lx el are not too small If yes for one of them in if OK the zero divide check must be superfluous But keep it anyway Work log between releases madX 3_04_68 and madX 3_04_72 Log report started Sun Feb 8 07 01 42 2009 ended Sun Feb 8 07 03 01 2009 290 frs 1 fix lethal error no consequence for LHC 2 Put back etall into DA vector headers both courtesy EF Fixing the Twiss chromaticity problem in presence of coupling by runnining Twiss twice with different deltap which is set to 1e 9 and calculate it numerically Good workaround courtesy HG MAD X version madX 3_04_71_ dev MAD X version madX 3_04_70_dev Version madX 3_04_69_dev chrom also for matching Drop individual BV flag requested by Thys More changes to ensure the chrom option to be always on courtesy HG Throw a warning if EXTRACT is using unknown markers courtesy HG Clean up a pseudo bug concerning AF never dereferenced claimed by the NAG compiler courtesy EF Skip double allocation detected by G95 Fixing an inconsistent TARGET declaration found by NAG courtesy EF Putting back incorrect chromaticity calculation 1 Fix proper disp amp ddisp definition for ring with respect to lines 2 Suppress chromaticity calculation in case of co
42. 2e 4 4e 5 1le 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 See also and Werner Herr 6 12 2004 154 EPRINT List Machine Imperfections This command prints a table of errors assigned to elements The range for these elements has to be specified Field errors are printed as absolute errors because all relative errors are transformed to the corresponding absolute error at definition time An error print is requested by the statement SELECT FLAG ERROR RANGE range CLASS name PATTERN string EPRINT and elements are now selected by the SELECT command A listing for ALL elements i e not only the selected can be obtained with the command EPRINT FULL TRUE In that case the SELECT command has no effect Werner Herr 18 6 2002 155 ESAVE Save Machine Imperfections and read back from file Writing errors to a file This command saves a table of errors assigned to elements on a file using a format which can be read in again to obtain the same results This allows dumping the errors and reloading them after a new USE command The range for these elements has to be specified An error save is requested by the statement ESAVE FILE string Example SELECT FLAG ERROR RANGE range CLASS name PATTERN string ESAVE FILE err file and elements selected by the SELECT command are saved to the file To save the errors of all element
43. CT variable print out in 5D remove bug division by zero due to dipole errors The sign for the second coord system pathelength deltap is corrected Finishing multipoles in thick elements use real kind 1d0 dble_num_c variable as a double precision buffer number for an input parameter at all CALLs of the C routine double_to_table 304 clean up estetics 1 State time is default and can be set in create_layout 2 deltap is transfered to pt when time is on Merged with version MAD X 3 02 29 Merged with version MAD X 3 02 29 Updated to head bug corrected in equaltwiss updated latest head developements Updated to madX 3_02_16 bug corrected in madx_ptc_setcavs 90 madx_ptc_trackcavs 90 Clean up New matching with macros that enables fitting of non linear parameters with PTC 1 Remove residual left over definition of double precision numbers Should all be in a_scratch_size f90 2 The logical needs to be defined as logical lp Several instances found fill tables with single precision values updated latest head developements Updated to madX 3_02_16 bug corrected in madx_ptc_setcavs 90 madxd h New matching with macros that enables fitting of non linear parameters with PTC version 3 02 25 gt PTC examples _track _normal _twiss are checked on abploc with strict version of madxdev The eigenvalue keyword is consistent set to the 2 characters eign eigenvector calculation
44. EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH PTC_NORMAL Module Non Linear Machine Parameters The PTC_NORMAL module of MAD X is based on PTC code This module takes full advantage of the PTC Normal Form analysis which is a considerable upgrade of what was available with the Lie Algebra technique used in MADS It allows to calculate dispersions chromaticities anharmonicities and Hamiltonian terms to very high order In fact the order is only limited by the RAM memory of your computer and your patience to wait for the results The number of terms per order increases with some power law The internal MAD X tables are not adequate to keep such large amounts of data On the other hand only a reduced set of this data is actually needed by the user Thus a much easier and flexible solution is to gather the users requirements with a series of special MAD X command called SELECT_PTC_NORMAL A special MAD X table is dynamically built using just those commands and it will be filled by the next call to the PTC_NORMAL command Another essential advantage of this table is the fact that it is structured to facilitate exchange of Normal Form including Hamiltonian terms of high order between MAD X modules The immediate goal is to use this table to allow non linear matching inside the present MAD X MATCHING module Synopsis PTC_CREATE UNIVERSE PTC_CREATE_LAYOUT model integer method integer nst integer exact SELECT_PTC_NORMAL dx gnfu
45. RADIATION RADIATION_MODEL1 RADIATION_ENERGY_LOSS RADIATION_QUAD BEAM_ENVELOPE SPACE_CHARGE 1 The tracking of a beam line with default parameters 2 As 1 but with element by element tracking and an output at observation points 3 Tracking in a closed ring with closed orbit search and the Normal Forms calculations Both canonical and action angle input output coordinates are possible Output at observation points is produced via PTC maps 4 Similar to 3 except that output at observation points is created by element by element tracking 5 The with PTC radiation References for PTC TRACK 226 a V Kapin and F Schmidt PTC modules for MAD X code to be published as CERN internal note by the end of 2006 b F Schmidt Proc of the 2005 PAC Conference in Knoxville USA pp 1272 c E Forest F Schmidt and E McIntosh Introduction to the Polymorphic Tracking Code KEK report 2002 3 July 2002 d G J Roy A new method for the simulation of synchrotron radiation in particle tracking codes Nuclear Instruments amp Methods in Phys Res Vol A298 1990 pp 128 133 See Also Overview of MAD X Tracking Modules PTC Set up Parameters PTC TRACK V Kapin ITEP and F Schmidt July 2005 revised in April 2006 227 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH PTC_TRACKLINE PERFORMS A PARTICLE TRAJECTORY TRACKING WITH ACCELERATION USING PTC USER MANUAL SYNOPSIS PTC_TRACKLI
46. RE and column REij one gets all or the component ij respectively SECTORMAP This flag initiates the calculation of a sector map as described at SECTORFILE Used to write SECTORMAPs to the file SECTORFILE file_name if missing the output of SECTORMAP will go to the file sectormap with the format as found in SECTORMAP KEEPORBIT The keeporbit attribute with an optional name keeporbit name stores the orbit under this name at the start and at all monitors USEORBIT The useorbit attribute with an optional name useorbit name uses the start value provided for the closed orbit search the values at the monitors are used by the threader COUPLE obsolete This MAD8 option can no longer be set since TWISS in MAD X is always calculated in coupled mode MAD X computes the coupled functions in the sense of Teng For the uncoupled cases they reduce to the C and S functions Twiss calculation is 4D only The Twiss command will calculate an approximate 6D closed orbit when the accelerator structure includes an active However the calcuation of the Twiss parameters are 4D only This may result in apparently non closure of the beta values in the plane with non zero dispersion The full 6D Twiss parameters can be calculated with the ptc_twiss command RIPKEN This flags will calculate the Ripken Mais TWISS parameters betal1 betal2 beta21 beta22 alfal1 alfal2 alfa21 alfa22 gamall gammal2 gamm21 and gamm22 using
47. The distorted orbit is taken from an internal or external TFS table Purpose of this Module The purpose of this orbit module is to provide some basic tools to assess the performance of an orbit correction system of a machine in the design phase Although some interface is available it cannot and does not provide the full functionality expected from a dedicated online orbit correction and steering program CORRECT Correction commands and parameter e Activate Deactivate correctors and monitors e READIWRITE corrector settings e COPTION Global Correction Options 22 10 2008 183 CORRECT Orbit Correction The CORRECT statement makes a complete closed orbit or trajectory correction using the computed values at the monitors from the Twiss table The CORRECT command has the following format not all possible options included some options are valid only for special algorithms CORRECT ORBIT myorbit MODEL mymodel TARGET mytarget FLAG ring MODE l1sq MONERROR integer MONON real MONSCALE real PLANE x COND integer RESOUT integer CLIST filel MLIST file2 The command CORRECT is set up with defaults which should allow a reasonable correction for most cases with a minimum of required options see Example 1 below The orbit correction must always be preceded by TWISS commands which generate Twiss tables The most recent Twiss table is assumed to contain the optical parameters and the distorted orbi
48. The largest horizontal dispersion m DXRMS The r m s of the horizontal dispersion m XCOMAX The maximum of the horizontal closed orbit deviation m XRMS The r m s of the horizontal closed orbit deviation m Q2 The vertical tune Q gt 1 DQ2 The vertical chromaticity dq gt 1 DQ2 dq gt del Q del PT BETYMAxX The largest vertical beta y m DYMAX The largest vertical dispersion m DYRMS The r m s of the vertical dispersion m YCOMAX The maximum of the vertical closed orbit deviation m YCORMS The r m s of the vertical closed orbit deviation m DELTAP Energy difference divided by the reference momentum times the velocity of light 1 DELTAP delta F p c Notice that in MAD X PT substitutes DELTAP as longitudinal variable Dispersive and chromatic functions are hence derivatives with respects to PT Being PT BETA DELTAP where BETA is the relativistic Lorentz factor those functions must be multiplied by BETA a number of time equal to the order of the derivative Variables in the TRACK Table The command RUN writes tables with the following variables X Horizontal position x of the orbit referred to the ideal orbit m PX Horizontal canonical momentum p of the orbit referred to the ideal orbit divided by the reference momentum Y Vertical position y of the orbit referred to the ideal orbit m PY Vertical canonical momentum p of the orbit referred to the ideal or
49. Trans Nucl Sc NS 20 1973 F James MINUIT A package of programs to minimise a function of n variables compute the covariance matrix and find the true errors program library code D507 CERN 1978 167 24 25 26 27 28 29 30 31 32 33 34 35 E Keil Synchrotron radiation from a large electron positron storage ring CERN ISR LTD 76 23 CERN 1976 D E Knuth The Art of Computer Programming Volume 2 Addison Wesley second edition 1981 Semi numerical Algorithms J Laskar C Froeschle and A Celletti The measure of chaos by the numerical analysis of the fundamental frequencies Application to the standard mapping Physica D 56 253 1992 H Mais and G Ripken Theory of Coupled Synchro Betatron Oscillations DESY internal Report DESY M 82 05 1982 M Meddahi Chromaticity correction for the 108 60 degree lattice CERN SL Note 96 19 AP 1996 J Milutinovic and S Ruggiero Comparison of Accelerator Codes for a RHIC Lattice AD AP TN 9 BNL 1988 B W Montague Linear Optics for Improved Chromaticity Correction LEP Note 165 CERN 1979 Gerhard Ripken Untersuchungen zur Strahlf hrung und Stabilit t der Teilchenbewegung in Beschleunigern und Storage Ringen unter strenger Ber cksichtigung einer Kopplung der Betatronschwingungen DESY internal Report R1 70 4 1970 F Ruggiero Dynamic Aperture for LEP 2 with various optics and tunes Proc Sixth Workshop on LEP Performance Ch
50. a tilted normal MULTIPOLE or BEND instead The survey calculation is launched by a single command line with the following syntax SURVEY x0 double yO double zO double theta0 double phi0 double psi0 double file string table string sequence string parameter meaning default value x0 initial horizontal transverse coordinate 0 0 yO initial vertical transverse coordinate 0 0 z0 initial longitudinal coordinate 0 0 theta0 initial horizontal angle 0 0 phiO initial vertical angle 0 0 psi0 initial transverse tilt 0 0 file name of external file null default name survey table name of internal table null default name survey sequence name of sequence to be surveyed last used sequence 196 Example average LHC ring with CERN coordinates REAL CONST RO 1 0 to obtain the average ring OPTION echo info CALL file V6 4 seq 070602 follow this link for the file OPTION echo BEAM particle proton energy 450 sequence lhcb1 USE period lhcb1 SELECT flag survey clear uncomment if the optional select below is used optional SELECT to specify a class and the output columns SELECT flag survey class marker column name s psi SURVEY x0 2202 21027 z0 2710 63882 yO 2359 00656 theta0 4 3 15508007 phi0 0 0124279564 psi0 0 0065309236 file survey lhcb1 WRITE table survey to display the results immediately STOP Jaa The external file survey lhcb1 can now be read a F Tecker March 2006 197
51. beam acceleration References a F Schmidt MAD X PTC Integration Proc of the 2005 PAC Conference in Knoxville USA pp 1272 b E Forest F Schmidt and E McIntosh Introduction to the Polymorphic Tracking Code CERN SL 2002 044 AP IKEK report 2002 3 July 2002 See Also PTC Set up Parameters 214 V Kapin ITEP and F Schmidt March 2006 215 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Thin Lens Tracking Module thintrack The thin lens tracking module of MAD X performs element per element tracking of one to many particle trajectories in the last use sequence Only thin elements are allowed apart from the element drift which guarantees the symplecticity of the coordinate transformation Any lattice can be converted into a thin element lattice by invoking the makethin command Synopsis TRACK onepass deltap double dump START x double px double y double py double t double pt double RUN Commands turns integer ENDTRACK TRACK deltap double onepass dump onetable file string MAD X version 1 TRACK deltap double onepass damp quantum dump aperture onetable file string MAD X version 2 TRACK deltap double onepass damp quantum dump aperture onetable recloss file string MAD X version 3 commands ENDTRACK Description The TRACK command initiates trajectory tracking by entering the thin lens tracking module Several optio
52. beam with identical particle charge but running in the opposite direction LHC beam 2 must then be reversed inside the program In MADX this may be taken into account by setting the value of the BV attribute in the Beam commands In the case of LHC beam 1 clockwise and beam 2 counter clockwise treated in MADX both as clockwise proton beams the Beam commands must look as follows Beam sequence lhcbhl particle proton pc 450 bv 1 Beam sequence lhcb2 particle proton pc 450 bv 1 March 29 2009 276 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH MAD X News Hans Grote and Frank Schmidt MAD X News This is a loose collection of new features new sample jobs and other possibly interesting remarks concerning MAD X Work log between releases madX 4_00_09 and madX 4_00_19 Log report started Thu May 7 20 01 28 2009 ended Thu May 7 20 02 54 2009 elaface Fixed argument of wrong type passed to the mtlmdl Fortran subroutine warning fixed Now the check for OSTYPE works with darwin9 0 frs 1 New TPSA package by lingyun yang gmail com 2 General clean up Preliminary fix of memory crash courtesy JBJ Some rearrangements by Etienne and final clean up of PTC Workaround for a array out off bound problem due to LDA 16000 being too small 1 LDAMAX set to 110 000 amp Ida_used 100000 2 Program stops when an out off bound array access is attempted 3 Real fix needed to make LDA dynamic Missing general p
53. betx bety alfx alfy gamax gamay R11 r12 R21 and R22 as input The tables are suitable for Plot After a successful TWISS run MAD X creates an implicit table of summary parameters named summ which includes tunes chromaticities etc Please note that the chrom option is needed for a proper calculation of the chromaticities in the presence of coupling versus the selected values of DELTAP Notice that in MAD X DELTAP is converted in PT which is used as longitudinal variable Dispersive and chromatic functions are hence derivatives with respects to PT see table These summary parameters can later be accessed via the table access function using the aforementionned implicit table named summ There is no way to change the name of this summary table Twiss Parameters for a Period The simplest form of the TWISS command is TWISS DELTAP real value CHROM TABLE table_name It computes the periodic solution for the specified beam line for all values of DELTAP entered or for DELTAP 0 if none is entered Example USE period OCT TWISS DELTAP 0 001 CHROM This example computes the periodic solution for the linear lattice and chromatic functions for the beam line OCT The DELTAP value used is 0 001 Apart from saving computing time it is equivalent to the command sequence 206 RING LINE 4 OCT OCT USE period RING TWISS DELTAP 0 001 CHROM Initial Values from a Periodic Line It i
54. class to be placed at the position given For uses inside ranges instances of the same class can be accessed with an occurrence count a sequence name with a position this causes the sequence with that name to be placed at the position indicated The entry centre or exit of the inserted sequence are placed at the position given UNLESS a refpos the name of an element in the inserted sequence is given in which case the sequence is inserted such that the refpos element is at the insertion point When the sequence is expanded in a command MAD generates the missing drift spaces At this moment overlapping elements will cause negative drift length errors For efficiency reasons MAD X imposes an important restriction on element lengths and positions once a sequence is expanded the element positions and lengths are considered as fixed in order to vary a position or element length a re expansion of the sequence becomes necessary The MATCH command contains a special flag vlength to match element lengths 124 Example define a default beam beam otherwise fatal error Define element classes for a simple cell be sbend 1 35 09 angle 0 011306116 qf quadrupole 1 1 6 k1 0 02268553 qd quadrupole 1 1 6 k1 0 022683642 sf sextupole 1 0 4 k2 0 13129 sd sextupole 1 0 76 k2 0 26328 define the cell as a sequence sequ sequence 1 79 bis b at 19 115 sfl sf at 37 42 qftl af at 38 70 p2
55. code works with sequences only Consequently there may exist some inconveniences when only lines are used It is recommended to convert as soon as possible lines into sequences by means of the save command in a design phase and to use only sequences for a finalised machine 128 Limits of Construction of Lines Since Lines are in fact depreciated there are some limits of how they can be constructed Please find below a running MADX run which shows an example of OK valid and WRONG invalid cases beam PARTICLE electron energy 1 qf QUADRUPOLE L 1 K1 1 qd QUADRUPOLE L 1 K1 1 d DRIFT 1 1 m MARKER rpl a b LINE a b sl LINE qf d qd test0 LINE rpl sl sl OK testl LINE rpl sl sl OK test2 LINE rpl sl sl OK test3 LINE sl sl OK test4 LINE rpl 3 sl 3 sl WRONG test5 LINE 3 s1 3 sl OK test6 LINE rpl 3 sl 3 sl WRONG test7 LINE 3 s1 3 s1 OK use period test0 twiss BETX 1 bety 1 use period testl twiss BETX 1 bety 1 use period test2 twiss BETX 1 bety 1 use period test3 twiss BETX 1 bety 1 use period test4 twiss BETX 1 bety 1 use period test5 twiss BETX 1 bety 1 use period test6 twiss BETX 1 bety 1 use period test7 twiss BETX 1 bety 1 1 June 17 2002 129 W EUROPEAN ORGANIZATION FOR NUCLEAR RE
56. command Each new EFCOMP statement replaces the field errors for all elements in its range s Any old field errors present in the range are discarded or incremented depending on the setting of EFCOMP defines them in terms of relative or absolute components The attributes are ORDER If relative errors are entered for multipoles this defines the order of the base component to which the relative errors refer This reference strength k always refers to the normal component To use a skew component as the reference the reference radius should be specified as a negative number The default is zero Please note that this implies to specify kg to assign relative field errors to a bending magnet since kg is used for the normalization and NOT the ANGLE RADIUS Radius R were dknr i or dksr i are specified for 0 i 20 default 1 m This attribute is required if dknr i or dksr i are specified If R is negativ the skew component is used for the reference strength DKN i Absolute error for the normal multipole strength with 2i 2 poles default 0 m i DKS i Absolute error for the skewed multipole strength with 2i 2 poles default 0 m i DKNR Relative error for the normal multipole strength with 2i 2 poles default 0 m i 153 DKSR i Relative error for the skewed multipole strength with 2i 2 poles default 0 m Time memory effects The relative errors can be corrected for possible time memory effects A cor
57. commands are used to identify the elements for this operation Example USE USEKICK RANGE OFF USEMONITOR RANGE OFF CORRECT NCORR 32 USEKICK RANGE OFF CORRECT NCORR 32 18 6 2002 set working beam line define imperfections deactivate selected correctors deactivate selected monitors uses different set of correctors deactivate different set of correctors uses different set of correctors 187 ep gists ele This page is under construction options presently only available in MADX development version CSAVE Write orbit correctior settings to file SETCORR Set orbit correctior settings Werner Herr 18 6 2002 188 COPTION Set Orbit Correction Options The random generator for MAD is taken from Knuth In the orbit program monitors can be randomly disabled and the correct option command specifies different seeds for random values COPTION SEED integer PRINT 2 SEED Selects a particular sequence of random values A SEED value is an integer in the range 0 999999999 default 123456789 SEED alone continues with the current sequence See also SEED may be an expression PRINT This flag can take integer values and controls the printout In general the higher its value the more printout is produced For PRINT 0 no output is produced The default value is 1 Correction summary is given Example COPTION SEED 987
58. default 1 2 3 4 or 5 none dot circle and x These symbols are potted at all curve points there size may have to be adapted see below noversion logical default false If set true the information concerning the madx version and the date are suppressed from the title This option frees more space for the user s title interpolate logical default false Normally the curve points from the table are connected by straight lines if interpolate is requested then on momentum Twiss parameters such as beta alfa and dispersion are interpolated with calls to the Twiss module inside each element for all other variables splines are used to smooth the curves noline logical default false If s is the horizontal variable then the machine will be plotted in symbolic form above the curve plot except for tables having been read back into MAD X This may result in a thick black block if the horizontal scale is too large noline allows the user to suppress the machine plotting notitle logical default false If true suppresses the title line marker_plot logical default false If true plotting is done also at the location of marker elements This is only useful for the plotting of non continuous functions like the N1 from the aperture module Beware that the PS file might became very large if this flag is invoked range_plot logical default false Needed to allow to specify a plotting range also for user defined horizon
59. for one turn each Tracks that do not fit in aperture are immediately stopped Behavior of PTC calculations can be adapted with PTC_SETSWITCH command pnd with appropriate switches of PTC_CREATE LAYOUT command Command parameters and switches turns integer default value 1 no default value if value explicitly not specified Number of turns around sequence If layout is not closed then its value is enforced to 1 onetable boolean default value false if value explicitly not specified then true If true then only one table is created and one file is written to disk If false one file per track per observation point is written File format is filename obsNNNN pMMMM where NNNN and MMMM are numbers of observation point and track respectively Filename is defined by the switch described below file character string default is track name of file where track parameters are written see description of onetable switch above PROGRAMMERS MANUAL The routine PTC_TRACKLINE is implemented in file madx_ptc_trackcavs f90 Its single parameter is the number of observation points The call sequence from MAD X interpreter is the following exec_command in madxp c pro_ptc_trackline in madxn c This routine creates appropriates tables where the track parameters are 230 stored and after execution of the Fortran routine dumps filled table s to files w_ptc_trackline_ in wrap f90 Just interface to the appropriate Fortran module ptc_trac
60. in MAD X A parameter closely connected to the aperture is the sum of the mechanical and alignment tolerances The mechanical tolerance is the maximal error margin of errors in the element body which causes a decrease of aperture and the alignment tolerance is a mislignment of the element in the accelerator which also causes a decrease of aperture The tolerance is given in the transverse plane as a racetrack like in the picture below 131 X A tolerance can be assigned to each element in a MAD X sequence as a vector Syntax APER_TOL r g s MB SBEND L 1 MB APER_TOL 1 5 1 1 0 APERTURE MODULE Computes the n1 values for a piece of machine Each element is sliced into thick subelements at given intervals and the available aperture is computed at the end of each slice The computation is based on the last Twiss table so it is important to run the Twiss and aperture commands on the same period or sequence see the aperture example below Also showed in the example is how n1 values can be plotted The minimum n1 for each element is written to the last Twiss table to allow for matching by aperture Aperture file filename halofile filename pipefile filename range range exn real eyn real dqf real betagqfx real dp real dparx real dpary real 132 cor r bbeat real nco integer halo real real real real interval real spec real notsimple logical trueprofile filename
61. in ptc_twiss 1 Adding eign to ptc_normal table normal_results 2 Grow table normal_results if needed Merged with version MAD X 3 02 29 Updated to head bug corrected in equaltwiss updated latest head developements Updated to madX 3_02_16 bug corrected in madx_ptc_setcavs 90 weight paramter in constraint command to be used with use macro madxdict h option no_fatal_stop to not let a fatal error kill madx Clean up New matching with macros that enables fitting of non linear parameters with PTC Cleaned version of thintrack No delta_p dependence internally any more Only radiation part of code still contains delta Full 6D equations Ripken used Some further improvements Closed orbit still computed by twiss 1 Adding eign to ptc_normal table normal_results 2 Grow table normal_results if needed Multipoles and Errors of any order are added to thick elements for MADX PTC only 1 Remove residual left over definition of double precision numbers Should all be in a_scratch_size f90 2 The logical needs to be defined as logical lp Several instances found Merged with version MAD X 3 02 29 updated latest head developements weight paramter in constraint command to be used with use macro madxl h The eigenvalue keyword is consistent set to the 2 characters eign eigenvector calculation in ptc_twiss 1 Adding eign to ptc_normal table normal_results 2 Grow table normal_results i
62. is not a monitor If MREX gt 0 the reading for x is too high default 0 m MREY The vertical read error for a monitor This is ignored if the element is not a monitor If MREY gt 0 the reading for y is too high default 0 m AREX The misalignment in the x direction for the entry of an aperture limit default 0 m AREX gt 0 displaces the element in the positive x direction 150 AREY The misalignment in the y direction for the entry of an aperture limit default 0 m AREY gt 0 displaces the element in the positive y direction MSCALX The relative horizontal scaling error for a monitor This is ignored if the element is not a monitor If MSCALX gt 0 the reading for x is too high default 0 A value of 0 5 implies the actual reading is multiplied by 1 5 MSCALY The relative vertical scaling error for a monitor This is ignored if the element is not a monitor If MSCALY gt 0 the reading for y is too high default 0 A value of 0 3 implies the actual reading is multiplied by 0 7 Example SELECT FLAG ERROR CLASS MQ EALIGN DX 0 002 DY 0 0004 RANF DPHI 0 0002 GAUSS Assigns alignment errors to all elements of class MQ SELECT FLAG ERROR PATTERN 0F EALIGN DX 0 001 TGAUSS 2 5 DY 0 0001 RANF Assigns alignment errors to all elements starting with QF TGAUSS 2 5 means a Gaussian distribution cut at 2 5 sigma original beam line Figure 1 Example of
63. is set Therefore the number of elements selected corresponding to a command like SELECT FLAG ERROR can be different after the execution of SETERR 156 Werner Herr 18 6 2002 157 The Intra Beam Scattering Module IBS As emphasized by its name the Intra Beam Scattering module IBS computes the contribution to emittance growth rates due to Coulomb scattering of particles within relativistic beams The formalism used in this module is that derived by J D Bjorken and S K Mtingwa in 1982 Contrary to other IBS routines the Bjorken Mtingwa formalism takes into account the variation of the lattice parameters around the machine rather than using average values Consequently the knowledge of the optical functions of the machine is required In MAD X this is achieved with the twiss command It is well known that the intra beam scattering growth times behave like ae Goa i 24 8 Ti VExrEyEs where C accounts for some constants and the integrals for the scattering functions N is the number of particles in the bunch Y is the relativistic factor and are the normalized emittances in the horizontal vertical and longitudinal plane respectively It thus follows that the second required input is a description of the beam parameters which is achieved via the beam command see below Once the optical functions and the beam parameters have been defined the evaluation of the scattering growth times f
64. n 1 ip8 if on_ho8 lt gt 0 exec inho bb 8 if on_lr81 lt gt 0 n 1 counter while n lt npara_8 exec inl bb 8 n n n 1 if on_lr8r lt gt 0 n 1 counter while n lt npara_8 exec inr bb 8 n n n 1 83 assign echo terminal select flag seqedit class bbmarker segedit sequence lhch2 remove element selected endedit select flag seqedit clear seqedit sequence lhcbl call file temp bb install endedit Now the beam beam element installation is complete system rm temp bb install seqedit sequence lLhcbl cycle start ipl endedit use period lhcbl twiss sequence lhcbl 1 make footprint option trace small 0 05 big sqrt 1 smal1 2 track xs small ys small value xs ys start fx xs fy ys zero amplitude nsigmax 6 n 1 sigma multiplier m 0 angle multiplier while n lt nsigmax angle 15 m pi 180 if m 0 xs n big ys n small elseif m 6 xs n small ys n big else xs n cos angle ys n sin angle value xs ys start fx xs fy ys m m 1 if m 7 m 0 n nt1 dynap fastune turns 1024 endtrack 84 write table dynap file write table dynaptune file system foot lt dynaptune gt footprint stop Real life example of MACRO definitions bbho nn macro macro defining head on beam beam elements n
65. p gt gt mu_i_j_k_l_m_n numbers separated with underscores parametric logical default false if value explicitly not specified then true If it is true and any knobs are defined the map element is stored as the parametric result 257 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH PTC_DUMPMAPS USER MANUAL SYNOPSIS PTC_DUMPMAPS file s ptcmaps ptcmaps implemented by subroutine ptc_dumpmaps in madx_ptc_module f90 Description PTC_DUMPMAPS dumps linear part of the map for each element of the layout into specified file Command parameters and switches file string default value ptcmaps default value if value explicitly not specified is ptcmaps Specifies name of the file to which the matrices are dumped to PROGRAMMERS MANUAL The command is implemented by subroutine ptc_dumpmaps in madx_ptc_module f90 The matrix for a single element is obtained by tracking identity map through an element that is initialized for each element by adding identity map to the reference particle For the elements that change reference momentum i e traveling wave cavity it is tracked to the end of the following marker that has updated reference momentum Hence each cavity must be followed by a marker If it is not setcavities subroutine detects error and stops the program 258 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH PTC_EPLACEMENT USER MANUAL SYNOPSIS PTC_EPLACEMENT range s none x
66. particle the tracked particle amplitude is either growing or decreasing The non symplectic tracking as in MAD 8 has been completely excluded from MAD X by taking out the thick lens part from the tracking modules Instead two types of tracking modules both symplectic are implemented into MAD X The first part of this design decision is the thin lens tracking module which tracks symplecticly through drifts and kicks and by replacing the end effects by their symplectic part in form of an additional kick on either end of the element This method demands a preliminary conversion of a sequence with thick elements into one composed entirely of thin elements see the MAKETHIN command The details of its usage are given on the page thintrack The second part of this design decision is to produce a thick lens tracking module based on the PTC code bh that allows a symplectic treatment of all accelerator elements giving the user full control over the precision number of steps and integration type and exactness full or extended Hamiltonian of the results The first PTC thick lens tracking module is named ptc_track It has the same features as the thin lens tracking code thintrack except it treats thick lenses in a symplectic manner There is a second PTC tracking module called the line tracking module ptc_track_line It is meant for tracking particles in CLIC in fact it treats beam lines containing traveling wave cavities and includes a
67. read errors in both horizontal and vertical planes Monitor errors MREX MREY MSCALX and MSCALY are ignored for all other elements Each new EALIGN statement replaces the misalignment errors for all elements in its range unless EOPTION ADD TRUE has been entered Alignment errors are defined by the statement SELECT FLAG ERROR RANGE range CLASS name PATTERN string EALIGN DX real DY real DS real DPHI real DTHETA real DPSI real MREX real MREY real MSCALX real MSCALY real AREX real AREY real and elements are now selected by the SELECT command The attributes are DX The misalignment in the x direction for the entry of the beam element default 0 m DX gt 0 displaces the element in the positive x direction DY The misalignment in the y direction for the entry of the beam element default 0 m DY gt 0 displaces the element in the positive y direction DS The misalignment in the s direction for the entry of the beam element default 0 m DS gt 0 displaces the element in the positive s direction DPHI The rotation around the x axis A positive angle gives a greater x coordinate for the exit than for the entry default 0 rad DTHETA The rotation around the y axis according to the right hand rule default 0 rad DPSI The rotation around the s axis according to the right hand rule default O rad MRExX The horizontal read error for a monitor This is ignored if the element
68. real The element YROTATION rotates the straight reference system about the vertical y axis YROTATION has no effect on the beam but it causes the beam to be referred to the new coordinate system x2 x 1cos theta s sin theta y2 x sin theta s cos theta It has one real attribute ANGLE The rotation angle theta default 0 rad It must be a small angle i e an angle comparable to the transverse angles of the orbit A positive angle means that the new reference system is rotated clockwise about the local y axis with respect to the old system Example KINK YROTATION ANGLE 0 0001 SROTATION Rotation Around the Longitudinal Axis label SROTATION ANGLE real The element SROTATION rotates the straight reference system about the longitudinal s axis SROTATION has no effect on the beam but it causes the beam to be referred to the new coordinate system X2 x 1 Cos psi y 1 sin psi y2 x Sin psi y cos psi It has one real attribute ANGLE The rotation angle psi default 0 rad A positive angle means that the new reference system is rotated clockwise about the s axis with respect to the old system Example 115 ROLL1 SROTATION ANGLE PI 2 ROLL2 SROTATION ANGLE PI 2 HBEND SBEND L 6 0 ANGLE 0 01 VBEND LINE ROLL1 HBEND ROLL2 The above is a way to represent a bend down in the vertical plane it could be defined more simpl
69. selected An example can be found at The length of a table can be determined by using the attribute tablelength via table your_table_name tablelength This is useful when creating a table from existing ones See an example at user table II Operands in Arithmetic Expressions An expression may contain the following operands Literal constants Numerical values are entered like FORTRAN constants Real values are accepted in INTEGER or REAL format The use of a decimal exponent marked by the letter D or E is permitted Examples 66 110839 SES 324 1992B2 Symbolic constants MAD recognizes some mathematical and physical constants Their names must not be used for user defined labels Additional symbolic constants may be defined to simplify their repeated use in statements and expressions CONST name constant expression defines a real constant with the name given An existing symbolic constant can be redefined but it cannot change in a matching procedure Example const in 0 0254 mad name value used pi i 4 atan 1 twopi i 2 pi degrad 180 pi deg rad raddeg 180 pi rad deg e exp 1 1 emass S 510998902 10 3 pmass 938271998 mumass 1056583568 clight c 2 99792458 10 8 qelect elem charge 1 602176462e 19 Parameter labels Often a set of numerical values depends on a common variable parameter Such a parameter must
70. the MAD X input language nucleon 208 charge 82 beam particle ion charge charge energy 450 charge mass nucleon nmass An important check for the correctness of the input is the printed value of the relativistic factor y The latter should correspond to charge fe AF Vion Vpro on nucleon The number of particles The number of particles or number of ions is defined with the parameter npart Beam sizes Emittances This part of the input is used to define the normalized emittances horizontal vertical and longitudinal The required parameters are the physical transverse emittances ex and ey m m the bunch length sigt m and the relative energy spread sige File Attribute If FILE file_name appears MAD X produces a table and writes on a file for each element of the machine ELEMENT NAME Position S m DELS m Length Difference of consecutive Elements in the Table TLI Longitudinal growth time TXI Horizontal growth time TYI Vertical growth time 159 Examples The two examples provided for the module Intra Beam Scattering illustrate the commands required to run the module The two examples have been selected such as to highlight the differences between a computation for protons and that for ions Both examples compute the IBS growth times at injection into the LHC The examples are located at http frs home cern ch frs Xdoc mad X html Frank Schmidt 2003 05 23 160 W E
71. the beambeam element with flattop and hollow parabolic radial density profile i e in the subtoutines tmbb_flattop and tmbb_hollowparabolic in twiss F Momentum compaction alfa included into TWISS table for matching Add polarity parameter to the twiss table madX 3_03_48 Final fix of the TILT saga Tilt is calculated exclusively in twiss F following the strategy 0 These changes concern quad sext oct elec separator but NOT dipole or multipole 1 TILT input is the external tilt k gt ks for tilt lt 0 296 2 k amp ks represent an internal tilt 3 at each element the total tilt amp sqrt k 2 ks 2 is calculated including field errors i e the correct way which might cause differences with MAD8 4 PTC has been adjusted appropriate 5 Possible effects on survey and emit will be tested 6 Many Thanks for HG for his help safeguard atan2 against both arguments equal to zero Fixing TILT in multipole kick and make TILT proper in thick octupole Courtesy HG tilt clean up coutesy HG Suppressing imax in favor of calib request by Thys Risselada Adding node value kmax maximum K value and imax maximum Current value Add BV flag to the solenoids Correction of an error occurring in subroutine tmbb_flattop for ftrk false safeguard faulty input change in beambeam command usage of scattering beam with different radial shapes is possible parameters bbshape 1 default Gaussian s
72. the particle energy ENERGY and the particle charge CHARGE to be set by a command before any calculations are performed Example 21 BEAM PARTICLE ELECTRON ENERGY 50 0 CAVITY RFCAVITY L 10 0 VOLT 150 0 LAG 0 0 HARMON 31320 The straight reference system for a cavity is a cartesian coordinate system January 24 1997 22 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH ELSEPARATOR Electrostatic Separator label ELSEPARATOR L real EX real EY real TILT real An ELSEPARATOR electrostatic separator has four real attributes L The length of the separator default 0 m EX The horizontal electric field strength default 0 MV m A positive field increases p for positive particles EY The vertical electric field strength default 0 MV m A positive field increases p for positive particles TILT The roll angle about the longitudinal axis default 0 rad A positive angle represents a clockwise of the electrostatic separator A separator requires the particle energy ENERGY and the particle charge CHARGE to be set by a IBEAM command before any calculations are performed Example BEAM PARTICLE POSITRON ENERGY 50 0 SEP ELSEPARATOR L 5 0 EY 0 5 The straight reference system for a separator is a cartesian coordinate system August 28 2003 23 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Close
73. they are omitted the filename will have lower characters only The optional flag can have the value mad8 without the quotes in which case the sequence s is are saved in MAD 8 input format The flag beam is optional when given all beams belonging to the sequences specified are saved at the top of the save file The parameter sequence is optional when omitted all sequences are saved However it is not advisable to use save without the sequence option unless you know what you are doing This practice will avoid spurious saved entries Any number of select flag save commands may precede the SAVE command In that case the names of elements variables and sequences must match the pattern s if given and in addition the elements must be of the class es specified See here for alSAVE with SELECT example It is important to note that the precision of the output of the save command depends on the output precision Details about default precisions and how to adjust those precisions can be found at the Format instruction page The Attribute bare allows to save just the sequence without the element definitions nor beam information This allows to re read in a sequence with might otherwise create a stop of the program This is particularly useful to turn a line into a sequence to seqedit it Example t13 line 1d16 qt1301 mqn qt1301 1d17 qt1302 mqn qt1302 1d18 ison DLTL3 LINE delay t13 use period d1t13 sa
74. to minimise a function of n variables compute the covariance matrix and find the true errors program library code D507 CERN 1978 318 24 E Keil Synchrotron radiation from a large electron positron storage ring CERN ISR LTD 76 23 CERN 1976 25 D E Knuth The Art of Computer Programming Volume 2 Addison Wesley second edition 1981 Semi numerical Algorithms 26 J Laskar C Froeschle and A Celletti The measure of chaos by the numerical analysis of the fundamental frequencies Application to the standard mapping Physica D 56 253 1992 27 H Mais and G Ripken Theory of Coupled Synchro Betatron Oscillations DESY internal Report DESY M 82 05 1982 28 M Meddahi Chromaticity correction for the 108 60 degree lattice CERN SL Note 96 19 AP 1996 29 J Milutinovic and S Ruggiero Comparison of Accelerator Codes for a RHIC Lattice AD AP TN 9 BNL 1988 30 B W Montague Linear Optics for Improved Chromaticity Correction LEP Note 165 CERN 1979 31 Gerhard Ripken Untersuchungen zur Strahlfiihrung und Stabilit t der Teilchenbewegung in Beschleunigern und Storage Ringen unter strenger Ber cksichtigung einer Kopplung der Betatronschwingungen DESY internal Report R1 70 4 1970 32 F Ruggiero Dynamic Aperture for LEP 2 with various optics and tunes Proc Sixth Workshop on LEP Performance Chamonix 1996 ed J Poole CERN SL 96 05 DI 1996 pp 132 136 33 L C Teng Concerning n Dimensiona
75. two valuesDELTAP 0 001 0 007 0 002 four values If DELTAP is missing MAD X uses the value 0 0 Further attributes of the TWISS statements are CHROM A logical flag If set MAD X also computes the chromatic functions Please note that this option is needed for a proper calculation of the chromaticities in the presence of coupling FILE If FILE file_name appears MAD X writes a full TFS Twiss table Example TFS Twiss table on the disk file file_name FILE alone is equivalent to FILE twiss TABLE overrides SAVE MAD X creates a full Twiss table in memory and gives it the name TWISS unless TABLE table_name appears on the command then it is called table _name This table includes linear lattice functions as well as the chromatic functions for all positions An important new feature of MAD X is the possibility to access entries of tables and in particular the twiss table see table access CENTRE This flag enforces the calculation of the linear lattice functions at the center of the element instead of the end of it Mind you that since this is inside the element the closed orbit includes the misalignment of the element RMATRIX If this flag is used the the one turn map at the location of every element is calculated and prepared for storage in the TWISS table Using the SELECT command and using the column RE 205 RE11 RE16 RE61 RE66 these components will be added to the TWISS table i e with column
76. winconsole ml msvc These compiler flags can be found at http www lahey com docs fujitsu 20compiler 20option 20list pdf 278 To wrap up for Windows Modification for c_tpsa_interface F90 Added new tpsa package Fixing the passing of a double array instead of an integer array Etienne s clean up of AF Fix C C nonstandard features fix pseudo bug in c_tpsa_interface F90 found by NAG f95 Integer shall not be defined as an array of dimension 1 Latest cleanup of Lingyun s TPSA including tpsa dll needed for Windows Clean up gfortran broken in gcc4 4 Therefore back to g95 however the LIBX flags must be fixed according to gcc being used Fix the exclusion of 90 amp F90 files with and without NTPSA Yet another upgrade for MAC using g95 Clean up for MAC Generalization for f90 F90 Compiler preprocessing for c_tpsa_interface to drop DLL for LINUX Add new tpsa missing fno range check flag for gfortran in particular for MAC Back to standard LF95 Further adjustments to safeguard running with gfortran which can be steered with the new SLC4 flag Fix further gfortran for SLC4 Default compiler oh lxplus 1f95 gfortran with Wall pedantic DEBUG flags even for Fortran gfortran explanation for SLC4 Darwin fixes no ONLINE as standard More small fixes 04 off for 1f95 proper libraries for ONLINE Fix gfortran Home link use proper LINK options for MAC hbu 279 using semi automatic object file list Makefi
77. with the arc length shorter straight length the option RBARC FALSE has to be set ANGLE The bend angle default 0 rad A positive bend angle represents a bend to the right i e towards negative x values TILT The roll angle about the longitudinal axis default 0 rad i e a horizontal bend A positive angle represents a clockwise rotation A TILT pi 2 turns a horizontal into a vertical bend i e a positive bend ANGLE denotes a deflection down Please note that contrary to MAD8 one has to specify the desired TILT angle otherwise it is taken as 0 rad This was needed to avoid the confusion in MAD8 about the actual meaning of the TILT attribute for various elements e Please take note that K and Ko are left in the data base but are no longer used for the MAP of the bends but see below for what K 9 is being used instead ANGLE and TILT are used exclusively We believe that this will allow for a clearer and unambiguous definition in particular in view of the upcoming integration of MAD X with PTC which will allow a more 27 general definition of bends However it is required to specify k0 to assign RELATIVE field errors to a bending magnet since k0 is used for the normalization and NOT the ANGLE see EFCOMP K1 The quadrupole coefficient K 1 B rho del By del x The default is 0 m A positive quadrupole strength implies horizontal focussing of positively charged particles E1 The rotation angle for th
78. 1n fns afs cern ch eng lhc optics V6 4 offdb Option echo info warn SU 1 0 call file ldb V6 5 seq call file ldb slice_new madx Option echo info warn PHAFAFFFAFHEFHFFFTTFF 44 4 Step 1 tt 4 4 t4tttttttttttttttt define beam constants PEALE EEEFAFEEEEEEEFAEEEEEEEAFEEEEEEEFEFEEEEEE FAA E EEE EP PT b_t_dist 25 e 9 bunch distance in sec b_h_dist clight b_t_dist 2 bunch half distance in m ipl_range 58 range for parasitic collisions ip5_range ipl_range ip2_range 60 ip8_range ip2_range npara_l ipl_range b_h_dist parasitic either side npara_2 ip2_range b_h_dist npara_5 ip5_range b_h_dist npara_8 ip8_range b_h_dist value npara_l npara_2 npara_5 npara_8 eg 7000 bg eg pmass en 3 75e 06 epsx en bg epsy en bg 74 Beam particle proton sequence lhcbl energy eg sigt 0 077 7 bv 1 NPART 1 1E11 sige 1 le 4 ex epsx ey epsy Beam particle proton sequence lhcb2 energy eg sigt 0 077 bv 1 NPART 1 1E11 sige 1 le 4 ex epsx ey epsy beamx beam lhcbl gt ex beamyslhcbl beam gt ey sigz beam slhcbl gt sigt sige beam Slhcbl gt sige split5 4d long_a 0 53 sigz 2 long_b 1 40 sigz 2 value long_a long_b ho_charge 0 2 LEAFFEFF HEEFT HEEFT HF 444444 Step 2
79. 456321 PRINT 2 Werner Herr 18 6 2002 189 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH PLOT Values contained in MAD X tables can be plotted in the form column versus column with up to four differently scaled vertical axes furthermore if the horizontal axis is the position s of the elements in a sequence then the symbolic machine can be plotted above the curves as well In certain conditions True interpolation inside the element is available through calls to the Twiss module for each slice The environment interpolation line thickness annotation size PostScript format can be set with the command e plot vaxis vnamel vname2 vnamen vaxisl vnamel vname2 vnamen vaxis2 vnamel vname2 Vvnamen vaxis3 vnamel vname2 vnamen vaxis4 vnamel vname2 vnamen haxis vname hmin real hmax real vmin reals vmax reals bars integer style integer colour integer symbol integer noversion logical interpolate logical noline logical notitle logical marker_plot logical range_plot logical table table_name particle particlel particle2 particlen multiple logical title string range range file file_name_start ptc logical ptc_table table_name trackfile table_name where the parameters have the following meaning O vaxis one or several variables from the table to be plotted against the only vertical axis O vaxisl one or several variables from the table to be plotted against the vertical axis numb
80. 5 lt e 5 a as a Q A esi lod og fan Q ee JO 5 S 2 JIQ G o Q Q 269 mi o _ x 5 0e 0 000o amp Sis S217 2 oA os 5 alg aS Sia a al 2 BS module icase PTC dentifiers or Label ae ITIATING Matching NSTAL NSTRUMENT Other Beam Instrumentation integer attribute T ACOBIAN Newton Minimisation eyword KICKER Combined Orbit Corrector nobs PTC A 5 5 J ay Q oO Q la n et O Ca gt a ie x o z n el inear lattice functions ine Tracking Module ptc_track_line MDIF Fast Gradient Minimisation ocal reference system re ogical attribute macro definition macro statemen macro usage ak Table PTC goths matching Matching Examples 270 gt S ae e ale ZE ral 7 EAS I 5 EZ Matching Methods physical constants t maxaper PTC MIGRAD Gradient Minimisation MONITOR Combined Monitor MOV multipole name of the parameter or attribute name or string attribute Z m lt Nn Non Linear Machine Parameters ptc_normal normalize norm_no PTC norm_out PTC NPAR S Octupole onetable PTC operan mer O Z Z zs Q be 5 Q a a 4 DN fo 3 le D zi 5 a as fas 2 g fal 3 oO i Q ee q oO aad J oO 5 lt oO Qo O fo o ary jag oO Dn operator OPTION orbit corrector
81. 7 102 9962313 166 2227523 171 6309057 108 0956006 61 93159422 34 58939635 33 31817319 58 58680717 102 9962313 166 2227523 171 6309057 108 0956006 61 93159422 34 58939635 or select flag table full column varl var2 default col s new will write the current value of varl etc into the table each time a new line is added values from the same current line can be accessed by these variables e g varl sqrt beam gt ex table twiss betx in the case of table above being twiss The plot command accepts the new variables 49 Remark this replaces the string variables of MAD 8 This example demonstrates as well the usage of a user defined table beam ex 1 6 ey 1 33 element definitions mb rbend 1 14 2 angle 0 k0 bang 14 2 mq quadrupole 1 3 1 apertype ellipse aperture 1 2 qft mq 1 0 31 1l kgqf tilt pi 4 qe l kqf qf 1 kqf qf 1 kqf qf l kqf qt 1 kqf 1 kqd 1 kqd 1 kqd mq 1 1 kqd cS sma R Say 1 kqd h hmonitor 1 1 bpm pv vmonitor 1l 1 bpm h hkicker vkicker sobir kis bh kic ll Ww mq mq mq mq mq mq mq mq PRP PPP PPR ll w E P PE N N O E ON A NW AW Oa PWNR T a a O FP QE OSO lt k acbhl Cc k acbh2 cb k acbh3 cbh kick acbh4 cbh kick acbh5 cp k acbv1 o k c k c k o ag y KREG o o D ADN o Dp r kire o lt lt
82. AD X version 1 11 FS 26 04 2003 MAD X version 1 10 HG amp FS 20 01 2003 MAD X version 1 09 FS 09 12 2002 MAD X version 1 08 FS 18 11 2002 MAD X version 1 06 FS 16 10 2002 MAD X version 1 05 HG 25 9 2002 New sample job to create footprints for LHC HG 18 9 2002 314 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH RPLOT Introduction RPLOT is a MAD X plug in that privides additional functionality using ROOT It contains several tools RVIEWER plotting tool that handles the results in paramremtric form What makes it different from the standard PLOT module of MAD X is that it is also able to deal with the parmateric results RPLOT proviedes graphical user interface that allows to choose which functions shall be drawn set its ranges and adjust all the details of the plot formatting Of course the result is immendiately visible on the screen in contrary to the standard plot tool that is able to work solely in the batch mode The user can choose several formats to save his plot including postscript gif pdf root macro and many others RVIEWER is able to draw the lattice functions 1 along the layout 2 at given position in function of one or two knobs It provides a convienient way to set the knob values As the value is set the plotted functions are immediately drawn for the new value In order to run RVIEWER simpy issue rviewer command RTRACKSTORE enables storage of the tracking data in ROOT NTuple Tree format
83. CONSTRAINT expr lhs2 lt gt rhs2 CONSTRAINT statements MACRO 2 definition CONSTRAINT statements MACRO n definition CONSTRAINT statements METHODS statements ENDMATCH The algorithm for evaluating the penalty function is the following execute the first macro evaluate and compute the difference between the Ihs and the rhs the first set of expressions in case of other macros evaluates in order the macro and the expressions the set of differences are minimized by the selected method using the variables defined in the VARY statements Initiating the Matching Module with USE_MACRO With MATCH USE_MACRO the match command can be used for matching any expression which can be defined through expression It requires a slightly different syntax VARY statements In the USE_MACRO mode the vary statement follows the same rules of the other modes explained in the section Define Variable Parameter 177 Macro definitions The macro to be used in the matching routine can be defined in two ways using USE_MACRO statement USE_MACRO NAME macrol defining a new macro on the fly using the usual syntax for macros After a macro definition is necessary to define a set of constraints exclusively with the following syntax CONSTRAINT expr lhs rhs or CONSTRAINT expr lhs lt rhs or CONSTRAINT expr lhs gt rhs where lhs and rhs a
84. E markerl marker2 BETX lt 200 0 CONSTRAINT SEQUENCE sequence name RANGE namel marker2 BETX 100 0 When the two constraint statements are interchanged the horizontal beta function at element namel will only be limited to less than 200 meter and NOT constrained to 100 meter The CONSTRAINTS can either be specified with explicit values for the constraints of the optic functions or via a pre calculated SAVEBETA module The first options has the form CONSTRAINT SEQUENCE sequence name RANGE position BETX real ALFX real MUX real BETY real ALFY real MUY real X real PX real Y real PY real DX real DY real DPX real DPY real 171 Here all BETX BETY ALFX ALFY MUX MUY DX DY DPX DPY or WX XY PHIX PHIY DMUX DUMY DDX DDY DDPX DDPY are constrained at the selected range to the corresponding values The second form of the CONSTRAINT command has the form CONSTRAINT SEQUENCE sequence name RANGE position BETAQ0 beta0 name MUX real MUY real Here all of BETX BETY ALFX ALFY MUX MUY DX DY DPX DPY are constrained in the selected points to the corresponding values of a pre calculated SAVEBETA module In the above example the phases MUX MUY are overridden by the numerical values specified via MUX real and MUY real Normally RANGE refers to a single p
85. ER_2 newname p From the sequence named s_name is extracted a new sequence with name p starting from MARKER_1 and ending at MARKER_2 The new sequence p can be USEd as any other sequence It is declared as shared and can therefore be combined E G into the cycled original sequence FLATTEN flatten This command includes all sequences in the sequence being edited if any The resulting sequence contains only elements 104 INSTALL install lement name class class_name at real from place selected where the parameters have the following meaning element name of the new element to be inserted mandatory class class of the new element to be inserted mandatory at position where the element is to be inserted if no from is given this is relative to the start of the sequence If from is given it is relative to the position specified there from either a place i e the name occurrence count of an element already existing in the sequence e g mb 15 or mq a il 4 etc or the string selected in this latter case an element of the type specified will be inserted behind all elements in the sequence that are currently selected by one or several SELECT commands of the type select flag seqedit class pattern range Attention No element definitions inside seqedit MOVE move lement name selected by real to real from place O element name of the existing element to b
86. ESEARCH Identifiers or Labels A label begins with a letter followed by up to fifteen letters digits decimal points or underscores _ Characters beyond the sixteenth are dropped but should be avoided and the resulting sequence must be unique A label may refer to a keyword an element a beam line a sequence etc The MAD X keywords are protected using one of them as a label results in a fatal error May 8 2001 59 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Command Attributes The following types of attributes are available in MAD A name or string attribute refers to an object or a string Allogical attribute selects or deselects an option Anjlinteger attributelis a counter as for repetition in a beam line Ajreal expression defines a datum for a command it may be varied in matching An expression is built of a combination of operatorjand operand A constraint specifies a matching constraint Al variable name selects a variable to be matched May 8 2001 60 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Name or String Attributes A name or string attribute often selects one of a set of options use period lhc expand the LHC sequenc It may also refer to a user defined object twiss file optics specifies the name of the OPTICS output file It may also define a string title LHC version 6 2 The case of letters is only significant if a string is enclosed in quotes otherwi
87. HO S S S S ELECT FLAG SECTORMAP clear LECT FLAG SECTORMAP PATTERN m ELECT FLAG TWISS clear ELECT FLAG TWISS PATTERN m column name s betx bety USE PERIOD FIVECELL twiss file optics sectormap stop This produces a file sectormap and a twiss output file name optics TYPE 305s TWISS PARTICLE 308s POSITRON MASS Sle 0 000510998902 CHARGE gle 1 EO Sle il PC Sle 0 99999986944 GAMMA Sle 1956 95136738 KBUNCH gle 1 NPART gle 0 EX gle 1 EY gle 1 ET gle 0 LENGTH Sle 534 6 ALFA Sle 0 00044339992938 ORBITS Sle 0 GAMMATR gle 47 4900022541 Q1 Sle 1 25413071556 Q2 Sle 1 25485338377 DQ1 Sle 1 05329608302 DQ2 Sle 1 04837000224 DXMAX gle 2 17763211131 DYMAX gle 0 XCOMAX gle 0 YCOMAX Sle 0 BETXMAX Sle 177 70993499 BETYMAX gle 177 671582415 XCORMS gle 0 YCORMS Sle 0 DXRMS Sle 1 66004270906 DYRMS Sle 0 DELTAP gle 0 TITLE 620s Test input for MAD X ORIGIN 16s MAD X 0 20 Linux DATE 08s 07 06 02 TIME 608s 14 25 51 NAME S BETX BETY s Sle Sle Sle MSCBH 4 365 171 6688159 33 31817319 MB NO 72 108 1309095 58 58680717 48 B B MSCBV 1 B B B MSCBH B B B MSCBV B B B MSCBH B
88. ICKER generates a vertical kick The momentum kick of a kicker has only a single frequency An element having a finite bandwidth can approximately created by defining thin kickers with all amplitudes SINPEAK frequencies SINTUNE and initial phases SINPHASE desired and putting them at the same position s in the accelerator From S Sorge gsi de August 28 2003 25 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Beam Position Monitors A beam monitor acts on the beam like a drift space In addition it serves to record the beam position for closed orbit corrections Four different types of beam position monitors are recognised HMONITOR Monitor for the horizontal beam position VMONITOR Monitor for the vertical beam position MONITOR Monitor for both horizontal and vertical beam position INSTRUMENT A place holder for any type of beam instrumentation Optically it behaves like a drift space it returns no beam observation It represent a class of elements which is completely independent from drifts and monitors label HMONITOR L real label VMONITOR L real label MONITOR L real label INSTRUMENT L real A beam position monitor has one real attribute L The length of the monitor default O m If the length is different from zero the beam position is recorded in the centre of the monitor Examples MH HMONITOR L 1 MV VMONITOR The straight reference system for a monitor is a cartesian coordin
89. IDTH denotes the full width at half maximum of the parabolic density profile in units of SIGX or SIGX and SIGY respectively if SIGX SIGY are not equal It must be WIDTH lt SQRT 2 0 BBDIR The parameter to choose the direction of motion of the opposite beam relative to the beam considered It determines the sign of the Lorenz force between the both beams default 1 BBDIR 1 Beams move in the opposite direction as in a collider Therefore the Lorenz force enhances the beam beam interaction O BBDIR 0 Opposite beam does not move Lorenz force is neglected O BBDIR 1 Beams move in the same direction as in an electron cooler So the Lorenz force reduces the beam beam interaction Note O The particles in the beam considered may have a momentum deviation given by DELTAP 119 defined in the TRACK command The opposite beam is assumed to have the velocity according to the unperturbed energy o the particles in the beam considered So only the direction of motion can be chosen In the case of motion in the opposite direction BBDIR 1 the time of interaction between the beams is given by tau length 2 beta c_light where length is the length of a bunch in the opposite beam In the case of motion in the same direction BBDIR 1 as in an electron cooler this time is given by tau length beta c_light where length is the length of the cooler So the factor 1 2 is inserted only for BBDIR 1 to calculate correct resul
90. In order to follow the standard MAD X representation the values that are written to tables and files are scaled appropriately to the reference momentum for a given element In the general case it changes along the line if traveling wave cavities are present Hence momenta xp yp and zp are zp sqrt 1 x 5 2 x 2 2 x 4 2 xp x 2 zp yp x 4 zp where array x containing 6 elements is the track position in the PTC representation i e x 1 is horizontal spacial coordinate x 2 horizontal momentum x 3 vertical spacial coordinate x 4 vertical momentum x 5 dp poc x 6 longitudinal coordinate caution the exact meaning depends on the PTC settings see PTC_SETSWITCH command 231 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH PTC_SETSWITCH routine that sets the internal PTC switches USER MANUAL SYNOPSIS PTC_SETSWITCH debuglevel i 0 maxacceleration l true true exact_mis l false true totalpath l false true radiation 1 false true fringe l false true time l true true Description Using this command the user can set switches of PTC and the MAD X PTC interface adapting this way the program behavior to his needs Command parameters and switches debuglevel integer default value 1 no default value if value explicitly not specified Sets the level of debugging printout 0 none 4 everything maxacceleration logical default true if value explici
91. Instead of referring to an element a beam line member can refer to another beam line defined in a separate command This provides a shorthand notation for sub lines which occur several times in a beam line Lines and sub lines can be entered in any order but when a line is expanded all its sub lines must be known Example q line a b s b a s a b St line c d e use period 1 this example produces the following expansion steps 1 replace sub line s a b c d e b a c d e a b 2 omit parentheses a b c d e b a c d e a b Reflection and Repetition An unsigned repetition count and an asterisk indicate repetition of a beam line member A minus prefix causes reflection i e all elements in the subsequence are taken in reverse order Sub lines of reflected lines are also reflected but physical elements are not If both reflection and repetition are desired the minus sign must precede the repetition count Example line g h s line c r d t line 2 s 2 e f s a b use period t Attention the repetition 2 s will only work if s is itself a line In case s is an element replace by wae s z Proceeding step by step this example produces 1 Replace sub line S teri rd terrd ef ter E r tar Eek Bra 2 replace sub line r c g h d c g h d e f e f dA h g c b a 127 3 omit parentheses c g h d c g h d e f e f d h g c b a Note that the inner sub line R i
92. LINE needs libmdblib a libmdbmth a librpnlib a libSDDS1 a libSDDSIc a libz a SLC5 needed libX11 a version madX 4_00_18_dev Version 4 00 17 add LRAD to kickers Version 4 00 16 Version 4 00 15 MAD X version 4 00 14 MAD X version madX 4_00_12 dev version madX 4_00_12_dev version madX 4_00_11_dev version 4 00 10 version Add attribute range_plot to allow range also for user defined horizontal axis courtesy HG Allowing plotting at markers using the marker_plot attribute Courtesy HG Add ntpsa flag if present the new C TPSA package by lingyun yang gmail com in invoked and the symprint flag pronts the symplecticity flag by default Remove harmless occurrence dipole_bv by the more obvious one other_bv remove tabs 284 Clean up unused variables Take out Unused external reference RESULT_FROM_ NORMAL found with latest NAG Fortran Compiler Release 5 2 668 Minor clean up Get the compiler directives like ifdef _WIN32_DLL working in F90 files using the Lahey compiler Special Fujitsi flags for 1f95 invoked e g 1f95 c o1 tp lfe Cpp Ife D_WIN32_DLL FPP c_tpsa_interface F90 winconsole ml msvc These compiler flags can be found at http www lahey com docs fujitsu 20compiler 20option 20list pdf To wrap up for Windows Modification for c_tpsa_interface F90 Added new tpsa package Fixing the passing of a double array instead of an integer array Etienne s clean up of AF Fix C C no
93. Lens Tracking Module PTC TRACK Module The PTC TRACK module fal is the symplectic thick lens tracking facility in MAD X fb It is based on PTC library written by E Forest i The commands of this module are described below optional parameters are denoted by square brackets Prior to using this module the active beam line must be selected by means of a command The general must also be initialized Synopsis PTC_CREATE UNIVERSE PTC_CREATE_LAYOUT model integer method integer nst integer exact aesan vp a PI E PTC_TRACK o oo 00 PTC_END Commands PTC_START x double px double y double py double t double pt double fx double phix double fy double phiy double ft double phit double Description To start particle tracking a series of initial trajectory coordinates has to be given by means of PTC_START command as many commands as trajectories It must be done before the PTC_TRACK command The coordinates can be either canonical coordinates x px y py t pt or action angle coordinates fx phix fy phiy ft phit which are expressed by the normalized amplitude F and the phase for the z th mode plane z x y t The actions are computed with the values of the emittances F which must be specified in the preceding BEAM command F are expressed in number of r m s beam sizes and are expressed in radians 221 Options Option Meaning Default Value Value Type
94. Misplacement in the x s plane 151 Figure 2 Example of Misplacement in the x y plane Figure 3 Example of Misplacement in the y s plane beam position given by the moniter horizontal plane Figure 4 Example of Read Errors in a monitor 02 9 2002 18 6 2002 152 Field Errors Field errors can be entered as relative or absolute errors Different multipole components can be specified with different kinds of errors relative or absolute Relations between absolute and relative field errors are listed below In MAD8 two commands were used for that purpose EFIELD and EFCOMP Only EFCOMP was implemented in MAD X since it provides the full functionality of EFIELD and there was no need for duplication All field errors are specified as the integrated value int K ds of the along the magnet axis in m There is no provision to specify a global relative excitation error affecting all field components in a combined function magnet Such an error may only be entered by defining the same relative error for all field components Field errors can be specified for all magnetic elements by the statement SELECT FLAG ERROR RANGE range CLASS name PATTERN string EFCOMP ORDER integer RADIUS real DKN dkn 0 dkn 1 dkn 2 DKS dks 0 dks 1 dks 2 DKNR dknr 0 dknr 1 dknr 2 DKSR dksr 0 dksr 1 dksr 2 and elements are now selected by the SELECT
95. N x Im E2 S Z sqrt m WY The vertical Courant Snyder invariant WY sqrt y Pyn m PHIY The vertical phase PHIY atan p yn y 2 pi 1 TN The normalised longitudinal displacement TN x Re E3 S Z sqrt m PIN The normalised longitudinal transverse momentum PTN x Im E3 S Z sqrt m WT The longitudinal invariant WT sqrt t 2 pm m PHIT The longitudinal phase PHIT atan p m t 2 pi 1 in the above formulas Z is the phase space vector Z X Px Y Py t pi 34 the matrix S is the symplectic unit matrix 0 10 00 0 10000 0 s 9 9 0 1 0 O 0 0 10 0 0 000001 0 0 0 0 1 0 and the vectors E are the three complex eigenvectors Linear Lattice Functions Optical Functions Several MAD commands refer to linear lattice functions Since MAD uses the canonical momenta p Py instead of the slopes x y their definitions differ slightly from those in Notice that in MAD X PT substitutes DELTAP as longitudinal variable Dispersive and chromatic functions are hence derivatives with respects to PT Being PT BETA DELTAP where BETA is the relativistic Lorentz factor those functions must be multiplied by BETA a number of time equal to the order of the derivative The linear lattice functions are known to MAD under the following names BETX Amplitude function beta m ALFX Correlation function alpha 1 ALFX alpha
96. NE turns integer 1 0 onetable logical false true everystep logical false true tableallsteps logical false true gcs logical false true file string track track rootntuple logical false true extension string ig 228 Parameter Type Name Not present turns integer 1 onetable logical false file string track rootntuple logical false everystep logical false gcs logical false Default value Present but value not specified true track true true true Description Number of turns If false tracking data are written to a single table for each track for each observation point Table names follow the naming filename obsMMMM pNNNN where filename is settable prefix with file parameter see below MMMM is observation point number and NNNN is track number If true all data are written to single table called onetable Name of file where track parameters are written see description of onetable switch above Stores data to ROOT file as ntuple Accessible only if RPLOT plugin is available i e only if madxp is dynamically linked and RPLOT plugin is present Switches on track parameters recording every integration step Normally tracking data are stored only at the end of each element Everystep mode allows the user to get finer data points It implies usage of the so called node thin layout Track parameters are stored for each s
97. Nu EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH USER S GUIDE e Table of contents MAD X Copyright Statement O m onventions ommand and Statement Format i 41 i O O o e Rh Ee Awe ee eae o Physical Elements and Markers ww ww eee OT O Sequences 0a wee 14 o UsngapertmeinMADX 2 2 2 ee ee 180 O lt a Soe a a se amp a a ge ee o e hee ae ee ee EO o Dynap Modul 2 2 2 wwe eee 146 o aa B o Emor Assignment Module 2 we O Ao a aD a o LF O Matching Module 000a aaa 161 o Orbit Correction Module Sw a 183 o PLOT s awe d 190 o SODD oe 193 o urvey geometri 196 O SXF file input and output boa k of oa amp a 4 o amp amp 198 o TES File Forma 0 a 19 o S E o 205 PTC Set up Parameters 2 209 o Overview of MAD X Tracking Modi o o 0 ooo ioio 214 O Thin Lens Tracking Module thintrack Me OE ok Oa Se we AG o hick Lens Tracking Module pie rack gt ee 22 O Line Tracking Module ptc_track_line Sa om wo a O a amp amp 228 o Ripken Optics Parameters pictwiss 2 ee 285 o Non Linear Machine Parameters pie nomma gt gt lt io 0 oio ioo 24 o PTC Auxiliary Commands 00a ee eS o Known Differences 1o Other Programs gt o ee 265 o ne be hk d ee he aoe amp 4 Oe o References 6 x 4 amp kw amp BI June 17 2002 Standard CERN Copyright Notice CERN
98. O Iles I oeeoeeeee oo June 17 2002 93 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH General Control Statements ASSIGN assign cho file_name where file_name is the name of an output file or terminal This allows switching the echo stream to a file or back but only for the commands value show and print Allows easy composition of future MAD X input files A real life example always the same is to be found under footprint CALL call file file_name where file_name is the name of an input file This file will be read until a return statement or until end_of_file it may contain any number of calls itself and so on to any depth COGUESS coguess tolerance double x double px double y double py double t double pt double sets the required convergence precision in the closed orbit search tolerance see as well Twiss command tolerance The other parameters define a first guess for all future closed orbit searches in case they are different from zero CREATE create table table column varl var2 _name creates a table with the specified variables as columns This table can then beffilled and finally one can writelit in TFS format The attribute _name adds the element name to the table at the specified column this replaces the undocumented withname attribute that was not always working properly 94 See the example or an example of joining 2 tables of different le
99. OLERANCE real Details are given in James The command has two attributes O CALLS The maximum number of calls to the penalty function default 1000 O TOLERANCE The desired tolerance for the minimum default 10 6 Example SIMPLEX CALLS 2000 TOLERANCE 1 0E 8 JACOBIAN Newton Minimisation The JACOBIAN command minimises the penalty function calculating the Jacobian and solving the linear problem A QR or LQ decomposition is performed when the system is over or under determined Before starting the matching routine two optional transformations COOL and RANDOM are performed JACOBIAN CALLS integer TOLERANCE real REPEAT integer STRATEGY integer COOL real BALANCE real random real The command has the attributes O CALLS The maximum number of calls to the penalty function default 30 O TOLERANCE The desired tolerance for the minimum default 10 6 O REPEAT The number of call of the JACOBIAN routine default 1 BISEC Selects the maximum number of iteratation used to determin the step length which reduces the penalty function during the main iteration A large number i e 6 reduce the probability to diverge from the solution but increase the one for being trapped in a local minum O STRATEGY A code for the strategy to be used default 3 If STRATEGY 1 the routine resets the values of the variables which exceeds the limits If STRATEGY 2 the routine print the Jacobian an
100. OR NUCLEAR RESEARCH String Attributes A string attribute makes alphanumeric information available e g a title or a file name It can contain any characters enclosed in single or double quotes except for quotes of the type used as its delimiter Examples TITLE This is a title for the program run test system ln fns some lengthy directory name local link June 17 2002 45 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Real Attributes Most attributes are of type REAL and are treated internally as double precision values They may be set by integer values real values or expressions Example ddd drift 1 1 2345 dddd drift l ddd gt 1 0 3 May 8 2001 46 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Selection Statements The elements or a range of elements in a sequence can be selected for various purposes Such selections remain valid until cleared in difference to MAD 8 it is therefore recommended to always start with a select flag clear before setting a new selection SELECT FLAG name RANGE range CLASS class PATTERN pattern FULL CLEAR where the name for FLAG can be one of ERROR MAKETHIN SEQEDIT or the name of a twiss table which is established for all sequence positions in general Selected elements have to fulfill the RANGE CLASS and PATTERNcriteria Any number of SELECT commands can be issued for the same flag and are a
101. PE 2 trapezoidal shape SIGX SIGY half width of density profile i e distance from the centre to half edge region with linear decrease of density in horizontal vertical direction Still only circular opposite beam possible i e in the calculations SIGX SIGY SIGX SIGY 2 is used if SIGX and SIGY have different values 117 2 1 0 x SIGX O BBSHAPE 3 hollow parabolic shape SIGX SIGY distance from the centre to the maximum of the parabolic density profile in vertical horizontal direction Still only circular opposite beam possible i e in the calculations SIGX SIGY SIGX SIGY 2 is used if SIGX and SIGY have different values 118 0 25 L 7 1 0 gi u x SIGX The restriction to circular opposite beams in the cases BBSHAPE 2 3 appears to be sufficient because such beam profiles are more important for the description of the interaction between the particle beam and an electron beam of an electron cooler which are usually circular WIDTH The relative extent of the edge region absolute value is given by WIDTH SIGX and WIDTH SIGY vertical and horizontal direction respectively For O BBSHAPE 1 WIDTH is meaningless and will be ignored O BBSHAPE 2 WIDTH denotes the full width of the edge region in units of SIGX or SIGX and SIGY respectively if SIGX and SIGY are not equal i e if WIDTH 0 01 and SIGX 5 mm the edge region has a full width of 0 05 mm It must be WIDTH lt 2 0 O BBSHAPE 3 W
102. PEAN ORGANIZATION FOR NUCLEAR RESEARCH Known Differences to Other Programs Definitions MAD uses full 6 by6 matrices to allow coupling effects to be treated and the canonical variable set x p x Po O Py Po et delta E po c as opposed to other programs most of which use the set x x Q y delta s delta p p o Like Dragt MAD uses the relative energy error py po which is equal the relative momentum error delta delta p p multiplied by beta v c As from Version 8 13 MADS uses an additional constant momentum error delta in all optical calculations The transfer maps contain the exact dependence upon this value therefore the tunes for large deviations can be computed with high accuracy as opposed to previous versions The choice of canonical variables in MAD still leads to slightly different definitions of the lattice functions In MAD the Courant Snyder invariants in Courant and Snyder take the form W gamma x 2 alpha xp beta px Comparison to the original form W gamma x 2 alpha xx beta x shows that the orbit functions cannot be the same A more detailed analysis using x p 1 delta shows that all formulas can be made consistent by defining the MAD orbit functions as beta beta c 1 delta alpha y alpha c gammaa y gamma c 1 delta For constant delta along the beam line and delta 0 the lattice functions are the same In a machine wher
103. SEARCH Defining aperture in MAD X A new feature of MAD X is the ability to set an aperture for a particular element or parent of a set of elements This removes the need of placing a collimator next to every element to do aperture tracking The aperture of any elements can be specified excepts drifts by the use of the following parameters APERTYPE This can have seven text values CIRCLE RECTANGLE ELLIPSE LHCSCREEN a superposition of a CIRCLE and a RECTANGLE MARGUERITE two LHCSCREENS one rotated by 90 degrees RECTELLIPSE a superposition of an ELLIPSE and a RECTANGLE and RACETRACK APERTURE This is an array of values the number and meaning of which depends on the APERTYPE APERTYPE Nene ters meaning of parameters CIRCLE 1 radius ELLIPSE horizontal half axis vertical half axis LHCSCREEN half width half height of rect and radius of circ 2 RECTANGLE 2 half width and half height 3 3 MARGUERITE half width half height of rect and radius of circ half width half height of rectangle horizontal half axis vertical RECT RISE half axis of ellipse RACETRACK horizontal vertical shift radius shift where the file contains a list of x and y coordinates outlining the FILENAME shape This option is only supported by the aperture module see below Here is an example for setting an ELLIPTICAL aperture for the main dipoles for the LHC
104. SPEAR 181 SLAC October 1974 12 M Conte and M Martini Particle Accelerators 17 1 1985 13 E D Courant and H S Snyder Theory of the alternating gradient synchrotron Annals of Physics 3 1 48 1958 14 Ph Defert Ph Hofmann and R Keyser The Table File System the C Interfaces LAW Note 9 CERN 1989 15 M Donald and D Schofield A User s Guide to the HARMON Program LEP Note 420 CERN 1982 16 A Dragt Lectures on Nonlinear Orbit Dynamics 1981 Summer School on High Energy Particle Accelerators Fermi National Accelerator Laboratory July 1981 American Institute of Physics 1982 17 D A Edwards and L C Teng Parametrisation of linear coupled motion in periodic systems IEEE Trans on Nucl Sc 20 885 1973 18 M Giovannozzi Analysis of the stability domain of planar symplectic maps using invariant manifolds CERN PS 96 05 PA 1996 19 H Grote GXPLOT User s Guide and Reference Manual LEP TH Note 57 CERN 1988 20 LEP Design Group Design Study of a 22 to 130 GeV electron positron Colliding Beam Machine LEP CERN ISR LEP 79 33 CERN 1979 M Hanney J M Jowett and E Keil BEAMPARAM A program for computing beam dynamics and performance of electron positron storage rings CERN LEP TH 88 2 CERN 1988 22 R H Helm M J Lee P L Morton and M Sands Evaluation of synchrotron radiation integrals IEEE Trans Nucl Sc NS 20 1973 23 F James MINUIT A package of programs
105. UROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Matching Module Before a match operation at least one sequence must be selected by means of a USE command Matching is then initiated by the MATCH command The matching module can act on more than one sequence simultaneously by specifying more than one sequence when INITIATING the matching mode From this command to the corresponding ENDMATCH command MAD accepts the matching commands listed below For a mathematical description of the minimisation procedures see In particular one may do the following Define the sequence s the matching module will work on Set initial conditions for transfer line matching Define constraints Define the parameters to be varied Match by different methods The matching commands are described in detail below Some other commands can also be issued during matching Enter and Leave Matching Mode O MATCH Initiating the Matching Mode o IENDMATCH Leave Matching Mode e O VARY Set Parameter to Var Constraint O CONSTRAINT Simple Constraint O ICONSTRAINT User Defined Variables O WEIGHT Matching Weights O GLOBAL Global Constraints O GWEIGHT Weights for Global Constraints e MDIF Fast Gradient Minimisation IGRAD Gradient Minimisation IMPLEX Simplex Minimisation ACOBIAN Newton Minimisation Expression Matching with USE_ MACRO O Matching Examples esl Z O O O O p 161 Oliver Briining June 2002 Riccardo de Ma
106. VKICKER KICK AVK4 KHV1 KICKER HKICK 0 001 VKICK 0 0005 KHV2 KICKER HKICK AKHV2H VKICK AKHV2V The assignment in the form of a deferred expression has the advantage that the values can be assigned and or modified at any time and matched The straight reference system for an orbit corrector is a Cartesian coordinate system 24 Please note that there is a new feature introduced by Stefan Sorge from GSI Here his decription The elements KICKER HKICKER and VKICKER can also be used as an exciter providing a sinusoidal momentum kick The usage in this case is xykick KICKER SINKICK integer SINPEAK real SINTUNE real SINPHASE real xkick HKICKER SINKICK integer SINPEAK real SINTUNE real SINPHASE real ykick VKICKER SINKICK integer SINPEAK real SINTUNE real SINPHASE real where a sinusoidal momentum kick dpz as a function of the revolution number n given by dpz n SINPEAK sin 2 PI SINTUNE n SINPHASE pz px py is provided So the variables are SINKICK integer must be set to 1 to switch on the sinusoidal signal default 0 SINPEAK amplitude of the bending angle rad default 0 rad SINTUNE frequency of the signal times the revolution frequency Hence the phase per revolution is 2 PI SINTUNE default 0 SINPHASE initial phase default 0 rad KICKER generates a kick in horizontal and a kick vertical direction where both are synchron HKICKER generates a horizontal kick and VK
107. ZAFS gudie e Defining templates mycalloc and myfree sbedb F in Routine twsint variable alam was used before being inti no effect on the results alized again various bug fixes write out of distance in phase space into file lyapunov data FAFS Fix bug in aperture check of rectellipse The parameters of rectangle ellipse were swapped thus wrong vere fixing the restsum problem of overwriten arrays and lack of initialization logical cplay dorad were uninitialize poisson F Fortran clean up implicit none ete madx main 90 Clean up missing public amp implicit none statements sa fitted 90 No longer needed after PTC upgrade Sh_de _kind 50 changed some stuff in kind and kind6 aixtrack so_fitting 90 unintialized Line 979 added Sa_extend_poly 90 Sb_i_pol_template f90 Sb_2_pol_template 90 Sb_sagan_pol_arbitrary f90 Sb_sagan_pol_arbitrary 90 Sc_euclidean 90 Sd_frane 90 Se_status 90 Sf_def_all_kinds f90 sq_i_fitted 90 Sg_1_template_my_kind 90 Sq_2 template_ay_kind 90 Sg_sagan_wiggler 90 Sh_def_kind 90 Si_def_elenent 190 elenents 90 Sk_link_list f90 Sl_fanily 90 Sm_tracking 90 Sq_nad_like f90 So_fitting 90 sp_keyworda 190 a_def_all_kind inc a_def_element_fibre_layout inc a scratch_size f90 bda_arrays_all 90 c_dabnew 90 define newda 90 hdetinition 90 i_tpsa 90 j_tpsalie 90 k_tps
108. _READ_ERRORS overwrite logical Description The PTC_READ ERRORS command let s you read any numbers of errors_read tables READMYTABLE Options Option Meaning T a Value Type Flag to either OVERWRITE the read in errors on OVERWRITE request by using this flag or by DEFAULT just FALSE logical add them to multipole components already present Remarks 211 PTC_MOVE_TO_LAYOUT index integer Description Several PTC layouts can be created within a one PTC universe The layouts are automatically numbered with sequential integers by the MAD X code The PTC_MOVE_TO_LAYOUT is used for an activation of a requested layout and the next PTC commands will be applied to this active PTC layout until a new PTC layout will be created or activated Option Meaning Default Value Value Type Number of the PTC layout to be ieee activated g PTC_ALIGN Description The PTC_ALIGN command is used to apply the MAD X alignment errors to the current PTC layout PTC_END Description The PTC_END command is turning off the PTC environment which releases all memory back to the MAD X world proper Additional Options for Physical Elements SBEND RBEND QUADRUPOLE SEXTUPOLE OCTUPOLE SOLENOID l double tilt double nst integer knl 0 double double ksl 0 double double Description 1 The full range of normal and skew multipole components on the bench can be spec
109. a thin lense b BB Spb_fake_gino_sub f90 New file needed for Gino Version pointers f 90 remove bad temper comment Etienne s Gino stuff Adding gino command following madx_ptc_script_module logical lp gt 4 and vice versa so NAG does not cry Spc_pointers 90 St_pointers f90 Replaced by St_pointers 90 New 2007 PTC this file replaces pointers f90 Sq_orbit_ptc 90 New routines needed by PTC including spin Sqa_beam_beam_ptc 90 Sqb_accel_ptc 90 Sr_spin 90 New routines needed by PTC including spin FPP File a_def_all_kind inc a_def_element_fibre_layout inc a_def_frame_patch_chart inc a_def_sagan inc a_def_worm inc a_scratch_size 90 b_da_arrays_all 90 c_dabnew 90 d_lielib 90 h_definition f 90 i_tpsa 90 j_tpsalie f90 k_tpsalie_analysis 90 1l_complex_taylor 90 m_real_polymorph 90 n_complex_polymorph f90 o_tree_element 90 Changes Throw out unused variables Fix single double precision definition that crashed NAG 95 logical gt logical lp needed for NAG 95 Bug corrected only first 10 elements of an array was zeroed instead of whole Check of initial conditions provided by the user on imput pointers initialized to null in universal_taylor e_define_newda f90 f_newda f90 g_newLielib 90 Experimental NEWDA no longer for this PTC version Makefiles Makefile Makefile bat Makefile prof Makefile_develop Makefile_g95 Make
110. able of current values These are initially set to weight default values and may be reset at any time to different values Values set in this way remain valid until changed again The command WEIGHT BETX real ALFX real MUX real BETY real ALFY real MUY real X real PX real Y real PY real DX real DPX real DY real DPY real changes the weights for subsequent constraints The weights are entered with the same name as the lattice functionsjorbit coordinate to which the weight applies Frequently the matching weights serve to 172 select a restricted set of functions to be matched Default Matching Weights GLOBAL Global Matching Constraints In addition to conventional matching constraints that specify the optics functions at a certain position in the sequence the user can also constrain global optics parameters such as for example the overall machine tune and the machine chromaticity Such global optics parameters can be constraint via the GLOBAL command having the following syntax GLOBAL SEQUENCE sequence name Q1 real Q2 real dQ1l real dQ2 real amp ddQl real ddQ2 real Global matching weights can be re set by the new GWEIGHT command having attributes identical to those of GLOBAL All the attributes are optional and have the following meaning Q1 Q2 dQ1 dQ2 enable a correction of tunes and chromaticities in presenc
111. adX 3_02_16 bug corrected in madx_ptc_setcavs 90 sm_tracking 90 Adapting Makefiles for non linear matching and PTC upgrade PTC upgrade Proper Thin Lens Lattice 1 Remove residual left over definition of double precision numbers Should all be in a_scratch_size f90 2 The logical needs to be defined as logical lp updated latest head developements Updated to madX 3_02_16 bug corrected in madx_ptc_setcavs 90 Several instances found Sma_multiparticle 90 Needed for PTC upgrade 25 04 2005 Sn_mad_like 90 Adapting Makefiles for non linear matching and PTC upgrade PTC upgrade Proper Thin Lens Lattice 1 Remove residual left over definition of double precision numbers Should all be in a_scratch_size f90 2 The logical needs to be defined as logical 1p Several instances found PTC with dvds implemented in the travelling wave cavity The voltage is given by V V0 dvds z updated latest head developements Updated to madX 3_02_16 bug corrected in madx_ptc_setcavs 90 So_fitting 90 Fixing initialization problems Adapting Makefiles for non linear matching and PTC upgrade PTC upgrade Proper Thin Lens Lattice 1 Remove residual left over definition of double precision numbers Should all be in a_scratch_size f90 2 The logical needs to be defined as logical lp Wrong definition of JMIN and EPSNOW PTC with dvds implemented in the travelling wave cavity T
112. alfa included into TWISS table for matching Add polarity parameter to the twiss table Updated match with knobs Adding el e2 h1 h2 hgap fint fintx to the twiss table Suppressing imax in favor of calib request by Thys Risselada Adding node value kmax maximum K value and imax maximum Current value New tracking feature by Andres Gomez Alonso Using flag recloss in the tracking command creates a table called trackloss which keeps a record of lost particles It can be saved using the write table trackloss command Added madx data types mainly used in SDDS module New function exist courtesy Hans Grote Sodd table names usinf small letters only closing unit 34 to allow multiple SODD runs changing table entries to more logical names print out clean up madxdict h Experimental knob file generation Added option that tells to free memory at the end of the program execution Option for ptc_trackline added that switches on off track parameters storage in memory for every slice Fix traditional matching of alfa First step for node layout tracking in ptc_trackline Added ptc names of twiss functions to constraint hence one can set constraint in a range new setvar command fixed readtable bug Add polarity parameter to the twiss table Clean up wrap 90 Fixing the crash for sbend exact multipoles larger than 10 This set up requires to solve M
113. alie_analysis 90 Leomplex taylor 90 m_realpolymorph 90 madx_ptc_module 90 nocomplex_polynorph 90 o_tree_element f90 run_madx 90 0 Features kindfitted zc0uBI are taken out 1 Plug in public in each module 2 Partial unitialized array in FIND_ORBIT_LAYOUT_noda in So_fitting 90 3 A couple of missing implicit none statements as described before check_iteration check_interpolate_x check_interpolate_y where un associate pointers after PTC upgrade 5q_1_fitted 90 Sq_i_template_my_Kind 90 sq_2_template_my_kind 90 Sq_sagan_wiggler 90 Sh_def_xkind 90 Sp_keywords 90 b_da_arrays_all 90 Missing implicit none and public statement File b_da_arrays_al1 f90 ndamaxi initialized to zero File sh_def_kind f90 unused variable copyMULTI amp find_fb renoved a_det_elenent_fibre_iayout inc Passive field for kind21 twcavity added containing a lag madx_ptc_intstate f90 madx_pte_script f90 madx_pte_seteavs 90 madx_pte tablepush 90 madx_pte_track_run f90 madx_pte_trackcavs 190 madx pte module 90 weap f90 ptc_dumiy f Sn_mad_iike f90 madyp c madxn cy madxu c rplot c madxd h madxdict h madxl h rplot h Fortran code processed by frs s indentation script clean up missing public implicit none statements New functionality for PIC track linac ptc_twise with acceleration pte_select pte_script pte dumpmaps madx_pte_nodul
114. amonix 1996 ed J Poole CERN SL 96 05 DI 1996 pp 132 136 L C Teng Concerning n Dimensional Coupled Motion FN 229 FNAL 1971 U V lkel Particle loss by Touschek effect in a storage ring DESY 67 5 DESY 1967 R P Walker Calculation of the Touschek lifetime in electron storage rings 1987 Also SERC Daresbury Laboratory preprint DL SCI P542A 168 36 P B Wilson Proc 8th Int Conf on High Energy Accelerators Stanford 1974 37 A Wriilich and H Meyer Life time due to the beam beam bremsstrahlung effect PET 75 2 DESY 1975 MAD Home Page JMAD 8 User Guide January 23 1997 169 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Define Variable Parameter VARY Define Variable Parameter A parameter to be varied is specified by the command VARY NAME variable STEP real LOWER real UPPER real It has four attributes NAME The name of the parameter or attribute to be varied STEP The approximate initial step size for varying the parameter If the step is not entered MAD tries to find a reasonable step but this may not always work LOWER Lower limit for the parameter optional UPPER Upper limit for the parameter optional SLOPE allowed change rate optional available only using JACOBIAN routine Limit the parameter to increase SLOPE 1 decrease SLOPE 1 only OPT optimal value for the parameter optional available only using TACOBIAN routine
115. and remain valid until clear is specified the selection criteria on the same command are logically ANDed on different SELECT statements logically ORed Example select flag error class quadrupole range mb 1 mb 5 select flag error pattern mqw selects all quadrupoles in the range mb 1 to mb 5 and all elements in the whole sequence the name of which starts with mqw for treatment by the error module flag can be one of the following O seqedit selection of elements for the seqedit module error selection of elements for the errorjassignment module makethin selection of elements for the makethin module that converts the sequence into one with thin elements only O sectormap selection of elements for the sectormap output file from the Twiss module O table here table is a table name such as twiss track etc and the rows and columns to be written are selected 99 For the RANGE CLASS PATTERN FULL and CLEAR parameters see SELECT slice is only used by makethin and prescribes the number of slices into which the selected elements have to be cut default 1 column is only valid for tables and decides the selection of columns to be written into the TFS file The name argument is special in that it refers to the actual name of the selected element For an example seeJSELECT SHOW show command prints the command typically beam beam sequ or an element name with the act
116. are mandatory each strength can be an expression their position defines the order example m multipole kn 0 0 0 myoct lrad ks 0 0 0 0 1 e 5 defines a multipole with a normal octupole and a skew decapole component To know the current maximum order enter the command help multipole and count 109 January 24 1997 110 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Dipedge Element A thin element describing the edge focusing of a dipole has been introduced in order to make it possible to track trajectories in the presence of dipoles with pole face angles Only linear terms are considered since the higher order terms would the tracking non symplectic The transformation of the machine elements into thin lenses leaves dipedge untouched and splits correctly the SBENDS s It does not make sense to use it alone It can be specified at the entrance and the exit of a SBEND They are defined by the commands label dipedge h real l real fint real hgap real tilt real It has zero length and five attributes e H Is angle length or 1 rho default 0 m for the default the dipedge element has no effect must be equal to that of the associated SBEND El The rotation angle for the pole face The sign convention is as for a SBEND Note that it is different for an entrance and an exit default 0 rad FINT field integral as for SBENDfsector bend Note that each dipedge has its own fint so fintx is no
117. ate system June 17 2002 26 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Bending Magnets Two different type keywords are recognised for bending magnets they are distinguished only by the reference system used RBEND is a rectangular bending magnet It has parallel pole faces and is based on a curved bend its length is the straight length as in the Figure but internally the arc length is being used to define an RBEND with the arc length as length straight line shorter than input for compatibility with MADS version up to version 8 23 06 including the option RBARC FALSE has to be set SBEND is a sector bending magnet Its pole faces meet at the centre of curvature of the curved sbend reference system They are defined by the commands SBEND real ANGLE real TILT real KO real KOS real Kl real El real E2 real FINT real FINTX real HGAP real K2 real H1l real H2 real RBEND real ANGLE real TILT real K0O real KOS real Kl real El real E2 real FINT real FINTX real HGAP real K2 real Hl real H2 real For both types the following first order attributes are permitted L The length of the magnet default 0 m For a rectangular magnet the length is measured along a straight line as in the Figure internally the arc length is used while for a sector magnet it is the arc length of the reference orbit To define an RBEND
118. axwell s equation up to SECTOR_NMUL_MAX The default is set to 10 to avoid excessive computing time This is now safeguarded in madxp To this end the parameters SECTOR_NMUL and SECTOR_NMUL_MAX are transfered from ptc_create_layout to ptc_create_universe such that these global parameters can be set early enough Internally in PTC the parameter lda_used is incremented where needed from 1500 to 3000 and set back Moreover Etienne has done the following modifications to make this possible The modification I made in the new PTC I sent you are as follows You first select SECTOR_NMUL and SECTOR_NMUL_MAX For all multipole lt SECTOR_NMUL then maxwell s is solved to order SECTOR_NMUL_MAX For multipole above SECTOR_NMUL they are treated a la Sixtrack So for example it you have errors to order 20 you may bother with maxwells only to order nmul 4 and nmul_max 10 as far as Maxwell s is concerned Multipole higher will be sixtrack multipoles Updated match with knobs fix bug for select_ptc_normal Added commands to allow reading external orbit files Moments calculation fully imlemented map buffering in ptc_twiss Few bugs corrected f g map initialized to nd2 instead of npara when initial twiss provided Moments seem to work to be tested yet New ptc_twiss so A_ is tracked This makes possible tracking of moments to be completed New jacobian routine with svd Option COND added for controlling the SVD Increased nu
119. b at 58 255 angle b1 gt angle sdl sd at 76 74 qdl qd at 78 20 endm marker at 9 0 endsequence June 17 2002 125 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Beam Lines The accelerator to be studied is known to MAD X either as a sequence of physical elements called or as a hierarchically structured list of elements called a beam line A beam line is built from simpler beam lines whose definitions can be nested to any level A powerful syntax allows to repeat to reflect or to replace pieces of beam lines However internally MAD X knows only sequences and lines as shown below are converted into flat sequences with the same name when they are expanded Consequently only sequences can be SAVEd onto a file see save Formally a beam line is defined by a LINE command label arg arg LIN gives a name to the E member member beam line for later reference The formal argument list arg arg is optional see below Each member may be one of the following Element label Beam line label Sub line enclosed in parentheses Formal argument name Replacement list label Beam lines may be nested to any level Simple Beam Lines The simplest beam line consists of single elements label LINE member member Example Ls line a b c d use period 1 7 a a The command tells MAD to perform all subsequent calculations on the sequence a bo c d a d 126 Sub lines
120. be defined as a global parameter A global parameter always has a current value however this value may be re evaluated or not depending on the parameter definition xX a X is set to the current value of a and not changed even if a changes This makes assignments such as 67 perfectly valid this replaces the old SET instruction The definition of the deferred expression x a assign the current value of a to x every time x is used i e it is re evaluated using the latest value of a therefore x X 1 results in an infinite loop when x is used error abort Of course the following definitions are equivalent 0 1 x x t 013 When such a parameter is used in an expression MAD uses the current value of the parameter if the expression is deferred Example x 1 0 als dArrftyl x O22 dAriftyl s 207s When the value of X is changed the length of the drift d1 remains unchanged that of d2 is recalculated Element or command attributes In arithmetic expressions the attributes of physical elements or commands can occur as operands They are named respectively by element name gt attribute name command name gt attribute name Values are assigned to attributes in element definitions or commands Example Dl DRIFT L 1 0 D2 DRIFT L 2 0 D1 gt L D1 gt L refers to the length L of the drift space D1 Expressions and Random Values The definition of random machine imperfecti
121. beam split into 5 print text install element xxipnnl2 at long_b from ipnn print text install element xxipnnll at long_a from ipnn print text install element xxipnn at l e 9 from ipnn print text install element xxipnnrl at tlong_a from ipnn print text install element xxipnnr2 at tlong_b from ipnn sbhomk nn macro macro to create savebetas for ho markers print text savebeta label rnnipnnl2 place mkipnnl2 print text savebeta label rnnipnnll place mkipnnll print text savebeta label rnnipnn place mkipnn print text savebeta label rnnipnnrl place mkipnnrl print text savebeta label rnnipnnr2 place mkipnnr2 85 mkl nn cc macro macro to create parasitic bb marker on left side of ip nn cc count print text mkipnnplcc bbmarker hi mkr nn cc macro macro to create parasitic bb marker on right side of ip nn cc count print text mkipnnprcc bbmarker sbl nn cc macro macro to create savebetas for left parasitic print text savebeta label rnnipnnplcc place mkipnnplcc sbr nn cc macro macro to create savebetas for right parasitic print text savebeta label rnnipnnprcc place mkipnnprecc inl xx nn cc macro macro installing bb and markers for left side parasitic beam beam print text install element xxipnnplcc at cc b_h_dist
122. bit divided by the reference momentum T Velocity of light times the negative time difference with respect to the reference particle m A 38 positive T means that the particle arrives ahead of the reference particle PT Energy difference divided by the reference momentum times the velocity of light 1 When tracking Lyapunov companions not yet implemented the TRACK table defines the following dependent expressions DISTANCE the relative Lyapunov distance between the two particles LYAPUNOV the estimated Lyapunov Exponent LOGDIST the natural logarithm of the relative distance LOGTURNS the natural logarithm of the turn number January 24 1997 Revised in February 2007 39 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH June 17 2002 Physical Units Throughout the computations MAD uses international SI Syst me International units These units are summarised in the Units table Table 1 Physical Units Length m metres Angle rad radians Quadrupole coefficient m 2 Multipole coefficient 2n poles m n Electric voltage MV Megavolts Electric field strength MV m Frequency MHz Megahertz Phase angles 2 pi Particle energy GeV Particle mass GeV c 2 Particle momentum GeV c Beam current A Amperes Particle charge e elementary charges Impedances MOhm Megohms Emittances pi m
123. bly all cavities are lumped into one and located at the first appearance of a cavity This default is enforced by omitting this flag MULT_AUTO_OFF optional flag default FALSE If TRUE this module does not process zero value multipoles Moreover multipoles are prepared in SixTrack file fc 3 to be treated up to the order as specified with MAX_MULT_ORD MAX_MULT_ORD optional parameter default 11 Process up to this order for mult_auto_off TRUE SPLIT optional flag OBSOLETE This splits all the elements in two This is for backwards compatibilty only The user should now use the JMAKETHIN command instead APERTURE optional flag Set this to convert the apertures from MAD X to SixTrack so SixTrack will track with aperture RADIUS optional default value is 1m This sets the reference radius for the magnets This argument is optional but should normally be set Note the bv flag is presently ignored 142 Therefore it is mandatory to respect this limit for MAD X names The command will then always produce the following file fc 2 contains the basic structure of the lattice and may produce any or all of the following files depending on the sequence fc 3 contains the multipole mask s fc 3 aux contains various beam parameters fc 8 contains the misalignments and tilts fc 16 contains the field errors and or combined multipole kicks fc 34 file with various optics parameters at various location
124. border in the other direction i e Fortran calling C which is more rare than the reverse handle flushing unit 6 on Intel ifort compiler invoke call flush 6 as flush 6 with Intel compiler suppress compilation warnings skowron Added filling of track summ table for ptc_trackline Now the user can check what were the final coordinates of tracking If plugin support link dynamically if debug do not put O4 optimization g95 option add proper debug flags Work log between releases madX 4_00_07 and madX 4_00_09 Log report started Fri Mar 27 20 02 08 2009 ended Fri Mar 27 20 03 03 2009 286 frs New files needed for MAD X Version 4 Clean up Version 4 00 09 version 4 00 08 No lonfer needed for MAD X Version 4 Clean wipes out fortran wrapper stuff New Makefiles for Linux Mac amp Windows include all previous features Work log between releases madX 4_00_00 and madX 4_00_07 Log report started Wed Mar 18 20 02 11 2009 ended Wed Mar 18 20 03 12 2009 frs total_da_size set to very large courtesy Piotr amp Etienne madX 4_00_07_dev amp first candidate for the production version madX 4_00_06_dev Fix of the faulty REPLACE command coutesy HG madX 4_00_05_dev madX 4_00_04_ dev Fix of the memory crash due to the USE command in a while loop found by EB fixed courtesy HG MAD X vesrion 4 00 02 Version 4 00 01 fixing the crash due to conflict with markers courtesy HG Return NULL needed to con
125. bs html Under Construction PTC_Moments html this document 245 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH PTC_KNOB USER MANUAL SYNOPSIS PTC_KNOB elementname kn i ks i exactmatch l true true Description Sets knobs in PTC calculations currently ony in PTC_TWISS PTC_NORMAL will follow Knobs appear as the additional parameters of the phase space Twiss functions are then obtained as functions of these parameters Taylor series Also map elements might be stored as functions of knobs see command description to lear how to request given element to be stored as a Taylor series The parametric results can be further 1 written to a file with 2 plotted and studied using rviewer command rplot plugin 3 used to obtain very quickly approximate values of lattice functions for given values of knobs ptc_setknobvalue This feature is the foundation of a fast matching alorithm with PTC Example Dipolar components of both rbends and dipolar and quadrupolar components of the focusing quads set as knobs Some first and second order map coefficients set to be stored as parametric results ptc_twiss command is performed and the parametric results are written to files in two formats Knobs values are matched to get requested lattice functions Command parameters and switches elementname string in range format 246 Specifies name of the element containing the knob s to be set
126. c optics V6 503 aperture convert_offsets py usage convert_offsets py filename 138 As an example we see in the picture below how the horizontal axes of elements m1 and m2 does not coincide with the reference trajectory Xx m1 Reference trajectory a i gt Axis of m1 S origin m1 Reference trajectory i Si Axis of m2 The X_ref s and Y_ref s of the reference trajectory are calculated via an internal call to the module X_offs s and Y_offs s are derived from the coefficients given in the file The resulting X_tot s X_ref s X_offs s and Y_tot s Y_ref s Y_offs s are taken into account in the aperture calculations Aperture command example The aperture module needs a Twiss table to operate on It is important not to USE another period or sequence between the Twiss and aperture module calls else aperture looses its table One can choose the ranges for Twiss and aperture freely they need not be the same use period lhcbl select flag twiss range mb al4rl1 b1 mb al7r1 b1 column keyword name parent k01 k11 s betx bety n1l twiss file twiss bl data betx beta ipl bety beta ipl x x ipl y y ipl py t py ipl plot haxis s vaxis betx bety colour 100 select flag aperture column name n1 x dy aperture range mb b14rl1 b1 mb al7rl bl spec 5 235 plot table aperture noline vmin 0 vmax 10 haxis s vaxis nl1 spec on_elem style 100 139 The select command can be used
127. can also compute the deltap p dependency of the Twiss parameters The column names betallp beta33p alfallp alfa33p gamallp gama33p denote the derivatives of the optics parameters w r t deltap p If one is interested in evaluating deltap p dependency of the Twiss parameters one must ensure that the order no of the map is set to 2 at least The derivatives of the dispersion w r t deltap p have column names displp disp4p Second and third order derivatives have respective column names displp2 disp4p2 for the second order and displp3 disp4p3 for the third order In addition we compute momentum compaction factor a up to Ist order for icase 5 or 3rd order for icase 56 The values appear in the header of the ptc_twiss output file zero means the value has not been computed This feature is currently only available in the development version 235 For clarification in the 4 D case there is the following correspondence between MAD X and the Ripken s notations bet a11 b 1 betal12 b yy beta21 b bet a22 byy while in the uncoupled 4 D case bet a11 is the same as the classical b bet x and beta22 is b bety while betal2 and beta21 are zero When there is coupling all bet aNN are non zero and betall beta22 are distinctively different from b by respectively PTC_TWISS also tracks the eigenvectors and prints them to Twiss table according to the SELECT command flag ptc_twiss Either all 36 componen
128. ccumulated logically ORed In this context note the following SELECT FLAG name FULL selects all positions in the sequence for this flag This is the default for all tables and makethin whereas for ERROR and SEQEDIT the default is nothing selected SAVE A SELECT FLAG SAVE statement causes the selected sequences elements and variables to be written into the save file A class only used for element selection and a pattern can be specified Example select flag save class variable pattern abc save file mysave will save all variables and sequences containing abc in their name but not elements with names containing abc since the class variable does not exist astucieux non SECTORMAP A SELECT FLAG SECTORMAP statement causes sectormaps to be written into the file sectormap like in MAD 8 For the file to be written a flag SECTORMAP must be issued on the TWISS command in addition TWISS A SELECT FLAG TWISS statement causes the selected rows and columns to be written into the Twiss TFS file former OPTICS command in MAD 8 The column selection is done on the same select See as well example 2 Example 1 47 TITLE Test input for MAD X option rbarc false use arc length of rbends beam sets the default beam for the following sequence option echo call file fv9 opt contains optics parameters call file fv9 seq contains a small sequence fivecell OPTION EC
129. centres of curvature of the pole faces are placed inside the magnet Examples BR RBEND L 5 5 ANGLE 0 001 Deflection to the right BD SBEND L 5 5 KO0S 0 001 5 5 Deflection up BL SBEND L 5 5 K0 0 001 5 5 Deflection to the left BU SBEND L 5 5 K0S 0 001 Deflection down 28 August 28 2003 29 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Marker label MARKER The simplest element which can occur in a beam line is the MARKER It has no effect on the beam but it allows one to identify a position in the beam line for example to apply a matching constraint Example m27 marker June 6 2002 30 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Sign Conventions for Magnetic Fields The MAD program uses the following Taylor expansion for the field on the mid plane y 0 described in SLAC 75 n B 2 By 2 0 pa er n 0 Note the factorial in the denominator The field coefficients have the following meaning Bo Dipole field with a positive value in the positive y direction a positive field bends a positively charged particle to the right B Quadrupole coefficient B del B del x a positive value corresponds to horizontal focussing of a positively charged particle B3 Sextupole coefficient By del B del x B3 Octupole coefficient B3 del B del x3 Using this expansion and the curvature h of the reference orbit the lo
130. ch control the determination of singular values and redundant correctors These can be set with the commands SNGVAL and SNGCUT Both parameters depend on the machine and may need adjustment Default values are adjusted to large machines and reasonable performance for smaller machines NCORR Only used by the MICADO algorithm Defines the number of correctors to be used unless set to 0 in which case all available correctors are used Default is 0 all available correctors SNGVAL Used to set the threshold for finding singular values with the COND command Hint smaller number finds fewer singular values Use with care 184 Default is 2 0 SNGCUT Used to set the threshold for finding redundant correctors with the COND command Hint larger number finds fewer redundant correctors Use with extreme care Default is 50 0 MONERROR When MONERROR is 1 the alignment errors on monitors assigned by EALIGN MREX and MREY are taken into account otherwise they are ignored Default is 0 MONSCALE When MONSCALE is 1 the scaling errors on monitors assigned by EALIGN MSCALX and MSCALY are taken into account otherwise they are ignored Default is 0 MONON MONON takes a real number between 0 0 and 1 0 It determines the number of available monitors If the command is given each monitor is considered valid with a probability MONON In the average a fraction 1 0 MONON of the monitors will be disabled for the correction i e they are
131. ch physical element type Figure 1 Global Reference System January 24 1997 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Local Reference Systems Reference System for Straight Beam Elements In straight elements the local reference system is simply translated by the length of the element along the local s axis This is true for uadrupole extupole olL al sh gt Q amp amp Nn olenoid RABCAVITY lectrostatic separator losed orbit corrector eam position monitor Ti Q e es The corresponding R S are 0 10 0 R 0 S o010 L 001 A rotation of the element about the S axis has no effect on R and S since the rotations of the reference system before and after the element cancel z za Figure 1 Reference System for Straight Beam Elements Reference System for Bending Magnets have a curved reference orbit For both rectangular and sector bending magnets p cos a 1 cose Q sinag R 0 s 0 1 0 psina sine QO casa where alphais the bend angle A positive bend angle represents a bend to the right i e towards negative x values For sector bending magnets the bend radius is given by rho and for rectangular bending magnets it has the value rho L 2 sin alpha 2 If the magnet is rotated about the s axis by an angle psi R and S are transformed by R TR S TST7 where T is the orthogonal rotation matrix cosy siny 0 T sind cos O 0 0 1 The sp
132. ching of initial conditions works now final tests and debugging to be done Updated match with knobs New ptc_twiss so A_ is tracked This makes possible tracking of moments to be completed Corrected bug in match use_macro in match2_evaluate_exressions Now alos ptc_normal accepted in matching with ptcknobs bug corrections Implemented 1 ptc_setfieldcomp that set any order field strengh to requested value It enables matching of higher order field components 2 Special matching mode use_ptcknob It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner For further details see the comments at the top of matchptcknobs c file 3 Minor corrections and protections against segmentation vilation xplot c On some systems it is needed to load manually all needed ROOT libraries Bug correction Now alos ptc_normal accepted in matching with ptcknobs bug corrections Code cosmetics Turn number added in rplot rviewer plugin intefaced from now on rplot is a plugin instead of compiled in optional code Sever bug in knobs corrected attempt to delete not properly assocoated taylors in case no knobs are set by the user C Header Files madx h Add parameter units for orbit correction Added Enumeration type for matching mode protection against multiple inclusion madxl h Definitions for tables used by Slice Tracking with PTC Momentum compaction
133. connexes Geometrical definition of simply connex A figure in which any two points can be connected by a line segment with all points on the segment inside the figure The figure below shows what happens when a beam pipe polygon is not a simple connex The halo is expanded in such a way that it overlaps the external polygon in the area where the latter is dented inwards 134 ratiohalo pipe halo Y value 20 15 10 5 0 5 10 15 20 X value To make the module able to treat all kinds of polygons notsimple must be activated With this option activated apexes are strategically added to the halo polygon wherever the beam pipe polygon might have an inward dent This is done by drawing a line from halo centre to each apex on the pipe polygon An apex with its coordinates on the intersection point line halo is added to a table of halo polygon apexes The result is that the halo polygon has a few excessive points on straight sections but the algorithm used for expansion will now never miss a dent in the beam pipe The use of the notsimple option significantly increases computation time 135 ratiohalo pipe halo added points Y value 20 15 10 5 0 5 10 15 20 X value Trueprofile file syntax This file contains magnet names and their associated displacements of the axis for an arbitrary number of S where So is the start of the magnet and Sn the end The interval between each S must be regular a
134. corrected updated latest head developements Reduntant debug printout removed Updated to madX 3_02_16 bug corrected in madx_ptc_setcavs 90 madx_ptc_script 90 put pointers to the end on request of Etienne Adapting Makefiles for non linear matching and PTC upgrade PTC upgrade Proper Thin Lens Lattice madx_ptc_setcavs 90 Reduntant debug printouts present only in debug mode Clean up New matching with macros that enables fitting of non linear parameters with PTC 1 Remove residual left over definition of double precision numbers Should all be in a_scratch_size f90 2 The logical needs to be defined as logical lp Several instances found updated latest head developements Updated to madX 3_02_16 bug corrected in madx_ptc_setcavs 90 madx_ptc_tablepush 90 Clean up New matching with macros that enables fitting of non linear parameters with PTC 1 Remove residual left over definition of double precision numbers Should all be in a_scratch_size f90 2 The logical needs to be defined as logical lp Several instances found Updated to head bug corrected in equaltwiss updated latest head developements madx_ptc_track_run 90 Fixing the closed orbit at the observation points for ELEMENT_BY_ELEMENT calculation of CO is removed when ELEMENT_BY_ELEMENT is forced to ON at Closed_ORBIT OFF text of print out is corrected 1 Fixing element_by_element false 2 Add
135. d surveyall logical default true if value explicitly not specified then true If true survey of all the line is performed after element placement at new position and orientation It is implemented mainly for the software debugging purposes If patching was performed correctly the global survey should not change anything PROGRAMMERS MANUAL The command is implemented pro_ptc_eplacement function in madxn c and by subroutine ptc_eplacement in madx_ptc_eplacement f90 Sopecified range is resolved with help of get_range command Number of the element in the current sequence is resolved and passed as the parameter to the fortran routine It allows to resolve uniquely the corresponding element in the PTC layout TRANSLATE_Fibre and ROTATE_Fibre routines of ptc are employed to place and orient an element in space These commands adds rotation and translation from the current position Hence if the specified reference frame is other then current the element firstly needs to be placed at the center of the reference frame and then it is moved about the user specified coordinates 260 After element placement at new position and orientation patch needs to be recomputed If autoplacedownstream is false then patch to the next element is also recomputed Otherwise the layout is surveyed from the next element on what places all the elements downstream with default position with respect to the moved element At the end all the layout is surveye
136. d if surveyall flag is true what normally should always take place 261 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Matching with PTC knobs USER MANUAL This matching procedure takes advantage of the parametric results that are accessible with PTC Namely parameters occuring in the matching constrains are obtained as functions polynomials of the matching variables In other words each variable is a knob in PTC calculation Evaluation of the polynomials is relatively fast comparing to the regular PTC calculation what makes findining the minimum with the parametrized constraints very fast However the algorithm is not faster in a general case 1 The calculation time dramatically increases with number of parameters and at some point penalty rising from this overcomes the gain we get from the fast polynomial evaluation 2 A parametric result is an approximation that is valid only around the nominal parameter values The algorithm 1 Buffer the key commands ptc_varyknob constraint ptc_setswitch ptc_twiss or ptc_normal etc appearing between match useptcknobs true and any of matching actions calls migrad lmdif jacobian etc 2 When matching action appears a set The Current Variables Values TCVV to zero b perform THE LOOP i e points 3 17 Prepare PTC environment ptc_createuniverse ptc_createlayout Set the user defined knobs with ptc_knob Set TCVV using ptc_setfieldcomp command Run a PTC comma
137. d Orbit Correctors Three types of closed orbit correctors are available HKICKER a corrector for the horizontal plane VKICKER a corrector for the vertical plane KICKER a corrector for both planes label HKICKER L real KICK real TILT real label VKICKER L real KICK real TILT real label KICKER L real HKICK real VKICK real TILT real The type KICKER should not be used when an orbit corrector kicks only in one plane The attributes have the following meaning L The length of the closed orbit corrector default 0 m KICK The kick angle for either horizontal or vertical correctors default 0 rad HKICK The horizontal kick angle for a corrector in both planes default 0 rad VKICK The vertical kick angle for a corrector in both planes default 0 rad TILT The roll angle about the longitudinal axis default 0 rad A positive angle represents a clockwise rotation of the kicker A positive kick increases p or p respectively This means that a positive horizontal kick bends to the left i e to positive x which is opposite of what is true for bends It should be noted that the kick values assigned to an orbit corrector like above are not overwritten by an orbit correction using the CORRECT command Instead the kicks computed by an orbit correction and the assigned values are added when the correctors are used Examples HK1 HKICKER KICK 0 001 VK3 VKICKER KICK 0 0005 VK4
138. d are taken from the identity transformation kick and second order terms are zero as default In the thin lens tracking module the length of an arbitrary matrix is accepted however no second order are allowed to avoid non symplectic tracking runs In the latter case the tracking run will be aborted June 25 2003 121 Editing Element Definitions An element definition can be changed in two ways Entering a new definition The element will be replaced in the main beam line expansion Entering the element name together with new attributes The element will be updated in place and the new attribute values will replace the old ones This example shows two ways to change the strength of a quadrupole QF QUADRUPOLE L 1 K1 0 01 Original definition of OF QF QUADRUPOLE L 1 K1 0 02 Replace whole definition of OF OF K1 0 02 Replace value of K1 When the type of the element remains the same replacement of an attribute is the more efficient way Element definitions can be edited freely The changes do not affect already defined objects which belong to itsfelement class January 24 1997 122 Element Classes The concept of element classes solves the problem of addressing instances of elements in the accelerator in a convenient manner It will first be explained by an example All the quadrupoles in the accelerator form a class QUADRUPOLE Let us define three subclasses for the focussing quadrupoles the defoc
139. d exit without matching If STRATEGY 3 the routine disables the variables which exceeds the limits keeping however the number of variables greater or equal to the number of the constraints O COOL BALANCE The factors which specify the following transformation if balance gt 0 newval 1 cool oldval cool l balance maxval balance minval else newval 1 cool oldval cool optval where newval is the new value after the transformation oldval is the previous value maxval minval optval are the maximum value minimum value optimal value of the variable specified in the VAR Y command RANDOM The factors which specify the following transformation 175 newval 1 random rand o ldval where newval is the new value after the transformation oldval is the previous value rand is a stochastic variable with a uniform 0 5 0 5 distribution Example JACOBIAN CALLS 20 TOL ERANCE 1g E 8 STRAT EGY 3 COOL 0 1 BALANC Oliver Briining June 2002 February 2006 176 E 0 5 RANDOM 0 01 W7 EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Introduction It is possible to match user defined expressions with the USE_MACRO keyword The general input structure for a match command is the following MATCH USE_MACRO VARY statements USE_MACRO NAME macrol or macrol MACRO madx statements CONSTRAINT expr lhsl lt gt rhsl
140. d protection against inclusion of headers in interpreted mode automatical switch to white background redundant debug printout removed Added header lines to ROOT macro that display layout geometry This makes possible to compile a macro what is a must in the case of lengthy machines Removed redundant debug printout 2 interface routines added needeed by rplot Bugs with rotations corrected element placement works since now madx_ptc_intstate 90 New ptc_twiss so A_ is tracked This makes possible tracking of moments to be completed add lp to logical function indenting 297 Enforce 6d implemented PTC_Enforce6D implemented defaultlevel default has been 0 now 1 as planned originally madx_ptc_knobs 90 Bug Corrected Parametric twiss results where not scaled with energy Exact name matching implemented now passing name with Knobs for Initial parameters New ptc_twiss so A_ is tracked This makes possible tracking of moments to be completed PTC first changes stay October 2006 thinlens cutting Updated to the new nomenclature betal2 gt beta22 Bug corrected in the treatment of 4D and 5D cases cosmetics Universal taylor nullified at the initialization level Implemented 1 ptc_setfieldcomp that set any order field strengh to requested value It enables matching of higher order field components 2 Special matching mode use_ptcknob It implements kind of macro that empl
141. d value It enables matching of higher order field components 2 Special matching mode use_ptcknob It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner For further details see the comments at the top of matchptcknobs c file 3 Minor corrections and protections against segmentation vilation linker option added to export main program symbols so the function can be used from plugins plugin support switched off by default Optional plugin support added that requires dynamic linking Switched Off by default corrected error knobs implemented with PTC with pol_blocks command to dump parametric results to file or stdout content of ptc_madx_tablepush f 90 moved to ptc_madx_knobs 90 the former one removed Sceleton for knobs and arbitrary element placement implemented Lattice visualization via ROOT macro Printing detailed lattice geometry in PTC Several small bug corrections and some code cosmetics Missing dependencies added PTC with crash security First BB Makefile bat JMJ Added line to compile fatchlib2 f and modified lines to link it into madx exe and madxp exe Makefile_gfortran Makefile using gfortran not working yet for PTC Makeonline New files for MAD X On Line Modeling Version MAD X production version 3 03 04 05 2006 1 Documentation of standard PTC modules 2 New PTC module ptc_track_line i e lines with acceleration 3 Thin
142. data at the observation points other than at start can be produced by two different means a traditional MADX element by element tracking use option element_by_element 222 b coordinate transformation from start to the respective observation point using high order PTC transfer maps required option closed_orbit turned off options radiationJand element_by_elementh PTC_TRACK deltap double icase integer closed_orbit element_by_element turns integer dump onetable maxaper double array norm integer norm_out file string extension string ffile integer radiation radiation_model1 radiation_energy_loss radiation_quadr beam_envelope space_charge Description The PTC_TRACK command initiates trajectory tracking by entering the thick lens tracking module Several options can be specified the most important are presented in table Basic Options There are also switches to use special modules for particular tasks They are presented in the table Special Switches The tracking can be done element by element using the option element by element or turn by turn default with coordinate transformations over the whole turn Tracking is done in parallel i e the coordinates of all particles are transformed through each beam element option element by element or over full turns The particle is lost if its trajectory is outside the boundaries as specified by maxaperloption In PTC there is a continuous check if the part
143. default 1 Allows the user to set the curve line width Depends on the system as well so to be tried out xsize bounding box size for PostScript default 27 cm ysize bounding box size for PostScript default 19 cm ascale annotation character height scale factor default 1 Iscale axis label character height scale factor default 1 sscale curve symbol see above scale factor default 1 rscale axis text character height scale factor default 1 O O0O000 0 RESPLOT resplot resets all defaults for the setplot command June 17 2002 rdemarialrdemaria September 2007 192 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH SODD This command will execute the Second Order Detuning and Distortion as described in the paper of J Bengtsson and J Irwin Analytical Calculation of Smear and Tune Shift SSC 232 February 1990 on the beam line defined by the last USE command followed by a TWISS command It is based on the stand alone program written by Frank Schmidt in November 1998 January 1999 who also extended the analytical computation to the second order distortion cfr Beam Physics Note 60 F Schmidt SODD A physics Guide It consists of three parts Subroutine detune launched by the attribute detune It calculates the detuning function terms in first and second order in the strength of the multipoles If the attribute print_at_end has been set the following two files and the corresponding madx tables are creat
144. der temporary solution applied Fix the headvalue routine which stumbled over a blank line courtesy HG Preliminary fix of the crash when the aperture table is used Adding a C routine to read headers of TFS tables courtesy HG Taking deltap from table header both for TWISS and ptc_twiss but NOT in case of a SUMM table and place on the plot Blanking out buffer if ptc_flag true deltap plot entry taken from PTC plots ptc_dummy F First step for node layout tracking in ptc_trackline Missing dummy definitions added Moments calculation fully imlemented map buffering in ptc_twiss New ptc_twiss so A_ is tracked This makes possible tracking of moments to be completed Adding gino command following madx_ptc_script_module Implemented 1 ptc_setfieldcomp that set any order field strengh to requested value It enables matching of higher order field components 2 Special matching mode use_ptcknob It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner For further details see the comments at the top of matchptcknobs c file 3 Minor corrections and protections against segmentation vilation PTC knobs pol_blocks almost completely interfaced to MAD X User sets a knob with ptc_knob command Twiss parameters and user specified with ptc_select map components are buffered in memory after every element in form of taylor series They can be dumped to te
145. dered in PTC PTC_Enforce6D implemented defaultlevel default has been 0 now 1 as planned originally mat chptcknobs h Updated match with knobs Now alos ptc_normal accepted in matching with ptcknobs bug corrections Implemented 1 ptc_setfieldcomp that set any order field strengh to requested value It enables matching of higher order field components 2 Special matching mode use_ptcknob It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner For further details see the comments at the top of matchptcknobs c file 3 Minor corrections and protections against segmentation vilation rplot h Code cosmetics Turn number added in rplot rviewer plugin intefaced from now on rplot is a plugin instead of compiled in optional code Sever bug in knobs corrected attempt to delete not properly assocoated taylors in case no knobs are set by the user sdds h New files for MAD X On Line Modeling Version FORTRAN Files emit F and all Fortran Files Clean up of unused variables Fortran Clean Up match F tentative new output for matching var matchjc F better ending jacobian Penalty function printed with twise larger precision New jacobian routine with svd Option COND added for controlling the SVD Increased number of constraints change in calls behavior for JACOBIAN matchlib F 1 Just the routines needed 2 Fortran90 Clean up Changes n
146. ding PTC_NORMAL command PTC_TWISS icase integer deltap double closed_orbit range string file string table string initial_map_manual Description PTC_TWISS calculates a solution with initial conditions given as a map file fort 18 obtained from a preceding ring or beam line It requires the input option initial_map_manual and an existence of the map file named a fort 18 file which was generated by a preceding PTC_NORMAL command Example An example is found in the PTC_TWISS Examples in the folder Example3 Initial Values from a Given Matrix PTC_TWISS icase integer deltap double closed_orbit range string file string table string initial_matrix_manual rel1 double re12 double re16 double re61 double re62 double re66 double Description PTC_TWISS calculates a solution with initial conditions given by the matrix which is manually entered on the command line It requires the option initial_matrix_manual MAD X expects a symplectic 6x6 transfer matrix as input Example An example is found in the PTC_TWISS Examples in the folder Example4 Initial Values from Twiss Parameters via BETAO block PTC_TWISS icase integer deltap double closed_orbit range string file string table string beta0 string Description PTC_TWISS calculates a solution with initial conditions given by Twiss parameters which are transferred from the BETAO block The data in the the BETAO block have to be fi
147. e 90 an code processed by fre s indentation script 307 MAD X version 3 02 01 08 02 2006 All changes for each file 308 mads pte_ teach run t90 lt ttissing for Loop aver all sequences in nonery in addteel_List c match routine Jacobian inthe matching routine there ds the new conmand ET sinilar to Indlt 1 ew match routine Jacobian nat Ih the matching foutine chere 4a the new conmand jia sinilar to Indt 1 Medifications to allow to format in routine get_val_nun courtesy 5 wissing for Loop over all sequences in memory in add_toel_lsstc placing calloc malloc free by the wrappes nycalloc mymalLoe mytr Missing tor Loop over all sequences in memory in add to_el_listc matcn r matche cy matehje F matehsa F match routine yacobiant 309 MAD X version 3 00 01 07 09 2005 Overview All changes for each file 310 MAD X version 2 13 09 09 03 2005 Overview All changes for each file 311 MAD X version 2 13 Update I WH 09 12 2004 MAD X version 2 13 FS 23 11 2004 312 MAD X version 2 12 FS 29 09 2004 MAD X version 2 11 FS 02 06 2004 MAD X version 2 10 FS 27 03 2004 MAD X version 2 00 FS 24 11 2003 313 MAD X version 1 12 FS 04 07 2003 M
148. e MAD 8 User Guide 10 The Graphical Kernel System GKS ISO Geneva July 1985 International Standard ISO 7942 B Autin and Y Marti Closed Orbit Correction of Alternating Gradient Machines using a small Number of Magnets CERN ISR MA 73 17 CERN 1973 D P Barber K Heinemann H Mais and G Ripken A Fokker Planck Treatment of Stochastic Particle Motion within the Framework of a Fully Coupled 6 dimensional Formalism for Electron Positron Storage Rings including Classical Spin Motion in Linear Approximation DESY report 91 146 1991 R Bartolini A Bazzani M Giovannozzi W Scandale and E Todesco Tune evaluation in simulations and experiments CERN SL 95 84 AP 1995 J D Bjorken and S K Mtingwa Particle Accelerators 13 pg 115 E M Bollt and J D Meiss Targeting chaotic orbits to the Moon through recurrence Phys Lett A 204 373 1995 P Bramham and H Henke private communication and LEP Note LEP 70 107 CERN Karl L Brown A First and Second Order Matrix Theory for the Design of Beam Transport Systems and Charged Particle Spectrometers SLAC 75 Revision 3 SLAC 1972 Karl L Brown D C Carey Ch Iselin and F Rothacker TRANSPORT A Computer Program for Designing Charged Particle Beam Transport Systems CERN 73 16 revised as CERN 80 4 CERN 1980 A Chao Evaluation of beam distribution parameters in an electron storage ring Journal of Applied Physics 50 595 598 1979 166 Il 12
149. e Twiss calculation will always be automatically correct for all machine conditions like closed orbit coupling or after a new element has been introduced into the code In a traditional coding like in MAD8 this depends on reprogramming and modifying the code at various places which is inherently error prone The PTC_TWISS tracks a special representation of the beam in three degrees of freedom It works on the coupled lattice functions defined in Ref b which are essentially the projections of the lattice functions for the eigen modes on the three planes The PTC_TWISS lists the projections of the ellipses of motion onto the three planes x p x Q Py 4 p expressed them via the Ripken s parameters by j ak j amp k j along with the phase advances my in selected positions where index k 1 3 refers to the plane x y and the index j 1 3 denotes the eigen mode The PTC_TWISS also calculates the dispersion values Dj D 4 In the MAD X commands and tables these parameters are denoted as betall beta33 alfall alfa33 gamall gama33 mul mu3 displ disp4 respectively The Ripken parametrization can be transformed into the Edwards Teng parametrization used in twiss proper using the formulae of Ref dj The parameters are noted as bet x bety alfx alfy and the coupling matrix R11 R12 R21 and R22 In absence of coupling it holds bet x betal1l bet y beta22 alfx alfall and alfy alfa22 PTC_TWISS
150. e delta varies along the circumference e g in a linear accelerator or in an electron positron storage ring the definition of the Courant Snyder invariants must be generalised The MAD invariants have the advantage that they remain invariants along the beam line even for variable delta With the new method this problem occurs in only for non constant delta 265 Treatment of Energy Error in TWISS It has been noted in Milutinovic and Ruggiero that MAD returned tunes which are too low for non zero delta The difference was found to be quadratic in delta with a negative coefficient This problem has been eliminated thanks to the new treatment of momentum errors from MAD8 Version 8 13 onwards January 24 1997 266 gt gt Sis 2 Z lt gJ aIo oL oly eye Elle eS 110 Clo O 3 O co O 3 Nn fale Q 5 5 O 3 Nn z W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Index 2 attribute attribute name attribute value ee tr gt Z EAMBEAM Beam Beam Interaction eam beam element examples eam position monitor eam value defaults ending Magnet es o fes w ETAO block PTC oa lt mr te ra sie z Z anonical Variables Describing Orbits AVITY RABCAVITY ELL Matching HARG oSI le nals AR rol ies i oO e Q 5 Nn Q losed_orbit PTC losed Orbit losed orbit corrector OGUESS i Q 267 Qu ollimators olumn Fo
151. e entrance pole face default 0 rad E2 The rotation angle for the exit pole face default O rad FINT The field integral whose default value is 0 FINTX Allows FINTX gt 0 to set FINT at the element exit different from its entry value In particular useful to switch it off FINTX 0 HGAP The half gap of the magnet default 0 m The pole face rotation angles are referred to the magnet model for jrectangular bend and respectively The quantities FINT and HGAP specify the finite extent of the fringe fields as defined in SLAC 75 There they are defined as follows prr f7 Bo BAD dy g 9 naar 0 g Bg The default values of zero corresponds to the hard edge approximation i e a rectangular field distribution For other approximations enter the correct value of the half gap and one of the following values for FINT Linear Field drop off 1 6 Clamped Rogowski fringing field Unclamped Rogowski fringing field 0 7 Square edged non saturating magnet 0 45 Entering the keyword FINT alone sets the integral to 0 5 This is a reasonable average of the above values The following second order attributes are permitted K2 The sextupole coefficient K gt 1 B rho del B del x7 H1 The curvature of the entrance pole face default 0 m H2 The curvature of the exit pole face default 0 m A positive pole face curvature induces a negative sextupole component i e for positive H1 and H2 the
152. e moved or selected in which case all elements from existing SELECT commands will be moved in the latter case by must be given O by amount by which the element s is are to be moved no to nor from in this case O to position to which the element has to be moved if no from then this is relative to the start of the sequence otherwise it is relative to the place given in from O from place in the sequence with respect to which the element is to be positioned REMOVE remove lement name selected O element name of the existing element to be removed or selected in which case all elements from existing SELECT commands will be removed O Attention It is a bad idea to remove all markers from a sequence In particular the start marker and the new markers added by cycle must never be removed from a sequence CYCLE cycle start place This makes the sequence start at the place given which must be a marker 105 In the case there is a shared sequence in the used sequence the command FLATTEN has to be used before the command CYCLE Example flatten cycle start place REFLECT reflect This inverts the order of element in the sequence starting from the last element If there are shared sequences inside the USEd sequence the command FLATTEN must be used before the command REFLECT Alternatively each shared sequence must first be reflected Example flatten reflect REPLACE replace element namel s
153. e of magnetic imperfections or misalignments ddQ1 ddQ2 enable a correction of nonlinear chromaticities Oliver Briining June 2002 173 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Matching Methods MADX currently supports four different matching algorithms LMDIF Fast Gradient Minimisation The LMDIF command minimises the sum of squares of the constraint functions using their numerical derivatives LMDIF CALLS integer TOLERANCE real It is the fastest minimisation method available in MAD The command has two attributes O CALLS The maximum number of calls to the penalty function default 1000 O TOLERANCE The desired tolerance for the minimum default 10 6 Example LMDIF CALLS 2000 TOLERANCE 1 0E 8 MIGRAD Gradient Minimisation The MIGRAD command minimises the penalty function using the numerical derivatives of the sum of squares MIGRAD CALLS integer TOLERANCE real STRATEGY 1 The command has three attributes O CALLS The maximum number of calls to the penalty function default 1000 O TOLERANCE The desired tolerance for the minimum default 10 6 O STRATEGY A code for the strategy to be used default 1 Details are given in James Example MIGRAD CALLS 2000 TOLERANCE 1 0E 8 174 SIMPLEX Simplex Minimisation The SIMPLEX command minimises the penalty function by the simplex method SIMPLEX CALLS integer T
154. e switch to turn on CLOSED_ORBIT the closed logical orbit calculation relative momentum offset double for reference closed orbit turn on the MAPTABLE map table in logical memory turn on the calculation of the Normal Form logical Remarks MAPTABLE requires no 1 creates the one turn matrix which can be used by the next PTC_TWISS command Example The simple example is located on the Web page for the PTC_NORMAL example 243 References for PTC_NORMAL a F Schmidt JMAD X PTC Integration Proc of the 2005 PAC Conference in Knoxville USA pp 1272 b E T d Amico Nonlinear parameters from PTC MAD X Meeting 7 29 11 2004 notes doc file c A Schoch Theory of linear and non linear perturbations of betatron oscillations in alternating gradient synchrotrons CERN 27 21 1958 See Also IPTC_NORMAL example PTC Set up Parameters V Kapin ITEP and F Schmidt March 2006 244 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH MAD X PTC interface documentation Auxiliaries Available documents J TC_Knob html TC_SetKnobValue html TC_PrintParametric html TC_PrintFrames htm TC_Select html TC_SelectMoment html TC_SetSwitch html TC_DumpMaps html TC_SetCavities html TC_EPlacement htm c_general html otc_track html ptc_track_line html J EE E EE EE EE EE EE EE es 8eee A ptc_twiss html ptc_normal html Under Construction Match_WithPTCKno
155. ecial value psi pi 2 represents a bend down Figure 2 Reference System for Rectangular Bends The signs of the pole face rotations are positive as shown Figure 3 Reference System for Sector Bends The signs of the pole face rotations are positive as shown Elements which do not Change the Local Reference MARKER elements do not affect the reference orbit They are ignored for geometry calculations January 24 1997 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Drift Space label DRIFT L real A DRIFT space has one real attribute L The drift length default 0 m Examples DR1 DRIFT L 1 5 DR2 DRIFT L DR1 L The length of DR2 will always be equal to the length of DR1 The for a drift space is a cartesian coordinate system January 24 1997 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Quadrupole label QUADRUPOLE L real Kl real K1S real TILT real A QUADRUPOLE has four real attributes L The quadrupole length default 0 m K1 The normal quadrupole coefficient K 1B tho 6B 0 x The default is 0 m 2 A positive normal quadrupole strength implies horizontal focussing of positively charged particles K1S The skew quadrupole coefficient K 1 2 B tho B 6 x B y where x y is now a coordinate system rotated by 45 around s with respect to the normal one The default is 0 m 2 A positive skew quadrupole strength implies def
156. ected in madx_ptc_setcavs 90 b_da_arrays_all 90 1 Remove residual left over definition of double precision numbers Should all be in a_scratch_size f90 2 The logical needs to be defined as logical 1p Several instances found updated latest head developements Updated to madX 3_02_16 bug corrected in madx_ptc_setcavs 90 d_lielib 90 Updated to madX 3_02_16 bug corrected in madx_ptc_setcavs 90 f_newda 90 1 Remove residual left over definition of double precision numbers Should all be in a_scratch_size f90 2 The logical needs to be defined as logical 1p Several instances found updated latest head developements h_definition 90 Updated to madX 3_02_16 bug corrected in madx_ptc_setcavs 90 j_tpsalie 90 Fixing initialization problems k_tpsalie_analysis 90 PTC with dvds implemented in the travelling wave cavity The voltage is given by V V0 dvds z Updated to madX 3_02_16 bug corrected in madx_ptc_setcavs 90 madx_ptc_intstate 90 bug correctio Clean up New matching with macros that enables fitting of non linear parameters with PTC always using eternal states instead of current ones 1 Remove residual left over definition of double precision numbers Should all be in a_scratch_size f90 2 The logical needs to be defined as logical lp updated latest head developements Several instances found madx_ptc_module 90 The rest
157. ed detune_1l_end containing five columns 1 multipole order 2 hor ver plane gt 1 2 3 hor or ver detuning 4 order of horizontal invariant 5 order of vertical invariant detune_2_end containing five columns 1 first multipole order 2 second multipole order 3 horizontal detuning 4 order of horizontal invariant 5 order of vertical invariant If the attribute print_all has been set the following two files and the corresponding madx tables are created detune_1_all containing five columns 1 multipole order 2 hor ver plane gt 1 2 3 hor or ver detuning 4 order of horizontal invariant 5 order of vertical invariant detune_2_all containing five columns 1 first multipole order 2 second multipole order 3 horizontal detuning 4 order of horizontal invariant 5 order of vertical invariant 193 Subroutine distort1 launched by the attribute distort1 It calculates the distortion function and the Hamiltonian terms in first order in the strength of the multipoles If the attribute print_at_end has been set the two files and the corresponding madx tables are created distort_I_F_end containing eight columns 1 multipole order 2 cosine part of distortion 3 sine part of distortion 4 amplitude of distortion 5 j 6 K 7 r 8 m
158. ed Fixing Unwanted changes commented The aperture of the collimators was checked before undergoing the possible rotation at the entry of the element Corrected now If collimator has a roll angle tilt coordinates are transformed to the rotated local coordinate system and only after that apertures are checked Add BV flag to the solenoids Some unnecessary changes taken out again by Andres Gomez Alonso Inconsistent variable declarations of z0 encountered by Piotr when using make f Makefile_nag Fixed New tracking feature by Andres Gomez Alonso Using flag recloss in the tracking command creates a table called trackloss which keeps a record of lost particles It can be saved using the write table trackloss command safeguard faulty input change in beambeam command usage of scattering beam with different radial shapes is possible parameters bbshape 1 default Gaussian standard as before 2 flattop or trapezoidal 3 hollow parabolic width for bbshape 2 fractional width of edge region for bbshap fractional width of the parabolic part Changing the conflicting ksl for the integrated solenoid strength to ksi This name is reserved for the vector of the integrated skew multipoles ksl Thick solenoid can now have normal knl and skew ksl multipole errors in PTC ignored in madx proper Thin solenoids are presently not considered in PTC twiss F Closed orbit implemented in the maps for
159. ed strings composed of up to 6 digits Defines moment of the polynomial in PTC nomenclature String ijkImn i j k l m n are digits defines lt x p J y lt py AT Ap p gt For example moments 1000000 defines lt x gt Note that for input we always use MAD X notation where dp p is always the 6th coordinate Internaly PTC dp p is the 5th coordinate We perform automatic conversion that is transparent for the user As the consequence RMS in dp p is always defined as 000002 even in 5D case 256 This notations allows to define more then one moment with one command In this case the corresponding column names are as the passed strings with mu prefix However they are always extended to 6 digits i e the trailing 0 are automatically added For example if specified moments 2 the column name is mu200000 This method does not allow to pass bigger numbers then 9 If you need to define such a moment use the command switch below moment list of up to 6 coma separated integers 2 gt moment 0 0 2 lt y 2 gt moment 0 14 0 2 Defines a moment For example moment 2 defines lt x lt px 4py gt ete table string default moments Specifies name of the table where the calculated moments should be stored column string Ignored if moments is specified Defines name of the column where values should be stored If not specified then it is automatically generated from moment the definition lt x p J y py l AT Ap
160. ed the code to lead all that are needed in ROOT version 2 21 yisun Remove two useless messages zwe use beam_bv flag to change sign for beam two in simultaneous orbit correction 288 Modifications to adapt to beam1 beam2 conventions for two beam orbit correction Resolve problem with RESOUT option Work log between releases madX 3_04_72 and madX 4_00_00 Log report started Mon Feb 16 07 02 11 2009 ended Mon Feb 16 07 03 06 2009 289 frs readtable stops with fatal_error when file with table does not exist courtesy HG production version madX 4_00_00 version madX 3_04_77 Version madX 3_04_76_dev version madX 3_04_75_dev Fix the matching problem and the faulty set up of the twiss_chrom flag courtesy HG Intermediate version with improvement concerning chromaticity including coupling More work concerning a hiccup in the matching of the LHC still under way courtesy HG Initializing ql1_val_p amp q2_val_p clean up to avoid compiler warning Solenoid becomes a marker if the integrated strength is zero otherwise a fake very short is used Take out doogy format for strlen trivial clean up The flag chrom can now be set on demand coutesy HG Fixing small bug concerning undefined deltap courtesy YS hbu keep new parameter mech_sep in slicing jbj BJ 13 02 2009 added check Ix el lt dist_limit removed useless calculations of sqrt made consistent use of dist_limit and min_double BJ 13 02
161. eeded to compile routine dlamcl without optimization in extra file matchlib2 F Otherwise madx gets stuck in matching procedures In all Linux Makefiles matchlib2 F is compiled when using g77 For the Fortran90 compilers 1 95 g95 95 NAG and gfortran an optimized routine is used as provided by Andy Vaught the g95 maintainer For Windows the special compile flag lfe D_G95 was needed special undocumented Fujitsu compile flag of the Lahey 1 95 to compile this special Fortran90 version of dlamcl Replacing the DLAMC1 by an improved Fortran90 one as proposed by Andy Vaught remove Makefile_nag offending code New jacobian routine with svd Option COND added for controlling the SVD Increased number of constraints 5 times smaller 33 gt 10 matchlib2 F Needed to compile routine dlamcl without optimization Otherwise madx gets stuck in matching procedures 295 orbf F no blanks between amp position 6 and the start of the code plot F Add energy label E in routine pegetn I E 69th item of svanno 69 E Safeguard uncontrolled access to unsupported labels like Energy Fixing the plot crash the header is not read if it does not exist courtesy HG 1 Bad memory bug found by RdM Piotr found using valgrind the solution in mymalloc read_table strlen aux_buff gt c 1 the 1 is essential because the character string has a 0 at the end 2 In plot there is still the crash when reading the hea
162. eighted by the length of the element divided by the circumference its contribution to the total loss rate and tlitot the accumulated loss rate adding the rates over all beamline elements through the present position The value of tlitot at the end of the beamline is the inverse of the Touschek lifetime in units of 1 s Also all results can be printed to a file using the command write table touschek file The MADX Touschek module was developed by Catia Milardi and Frank Zimmermann 11 03 2008 204 W7 EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Twiss Module The TWISS command causes computation of the Courant and Snyder and optionally of the chromatic functions The coupled functions are calculated in the sense of Edwards and Teng For the uncoupled cases they reduce to the C and S functions It operates on the working beam line defined in the latest command One can also specify either a SEQUENCE sequence_name or a ILINEE line_name on the TWISS command Moreover one can restrict the TWISS calculation to a desired JRANGE The relative energy error DELTAP may be entered in one of the 2 forms DELTAP real real DELTAP initial final step The first form lists several numbers which may be general expressions separated by commas The second form specifies an initial value a final value and a step which must be constant expressions separated by colons Examples DELTAP 0 001 a single valueDELTAP 0 001 0 005
163. elds see Figure 1 The reference orbit consists of a series of straight line segments and circular arcs It is defined under the assumption that all elements are perfectly aligned The accompanying tripod of the reference orbit spans a local curvilinear right handed coordinate system x y s The local s axis is the tangent to the reference orbit The two other axes are perpendicular to the reference orbit and are labelled x in the bend plane and y perpendicular to the bend plane Closed Orbit Global Reference System Local Reference System e ign Conventions for Magnetic Fields iable O Canonical Variables Describing Orbits O Normalised Variables and other Derived Quantities Physical Units lt Figure 1 Local Reference System May 8 2001 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Closed Orbit Due to various errors like misalignment errors field errors fringe fields etc the closed orbit does not coincide with the reference orbit It also changes with the momentum error The closed orbit is described with respect to the reference orbit using the local reference system x y s It is evaluated including any nonlinear effects MAD also computes the betatron and synchrotron oscillations with respect to the closed orbit Results are given in the local x y s system defined by the reference orbit January 24 1997 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Global Reference Syste
164. elected by name2 Element with namel is replaced by element with name2 If namel is selected then all elements selected by SELECT commands will be replaced by the element name2 ENDEDIT endedit terminates the sequence editing process The nodes in the sequence are renumbered according to their occurrence which might have changed during editing June 17 2002 106 le Al Hil cI 1G oO SJE ea aHa r gt lt 5 lt Q z et n e les W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Elements and Markers Element Input Format Aperture Geometric MARKER Marker Definitioni DRIFT Drift Space ending Magnet RBEND Rectangular Bending Magne BEND Sector Bending Magne ipedge Element UADRUPOL OO 0 Bln Q tr MULTIPOLE OLENOID losed Orbit Corrector KICKER Vertical Orbit Corrector OOO AE alAla ZOHO Fall ll amp AAE E FNE g ian SES gels fale lQ o O p l AoE alela z o lela SEIS S ransverse Kicker RABCAVITY LSEPARATOR Electrostatic Separator eam Position Monitor MONITOR Vertical Monitor ONITOR Combined Monitor NSTRUMENT Other Beam Instrumentation oo0o0o FEIE zZ a Z a am S N 5 S zZ 5 a O RCOLLIMATOR Rectangular Collimator O JECOLLIMATOR Elliptic Collimator oordinate Transformations O O al lt v2 Q gt O zZ o 5 gt lt S lt s
165. en the lattice funcionts largely vary inside single elements In the later case it is advised to slice the elements as shown inJ ALBA Last updated 148 Error Definitions This chapter describes the commands which provide error assignment and output of errors assigned to elements It is possible to assign alignment errors and field errors to single beam elements or to ranges or classes of beam elements Elements classes or ranges of elements are selected by the SELECT command ATTENTION since errors can only be assigned to machine elements it is necessary to FLATTEN a sequence if it includes other sequences Errors can be specified both with a constant or random values Error definitions consist of four types of statements listed below They may be entered after having selected a beam line by means of a command WARNING any further command will destroy the assigned errors Use the ESA VE option to save and reload errors e Field Errors o Werner Herr 18 6 2002 es ti 149 EALIGN Define Misalignments Alignment errors are defined by the EALIGN command The misalignments refer to the system for a perfectly aligned machine Possible misalignments are displacements along the three coordinate axes and rotations about the coordinate axes Alignment errors can be assigned to all beam elements except drift spaces The effect of misalignments is treated in a linear approximation A position monitor can be given
166. er D The second command selects elements beginning with the letter K containing the string QD and ending with the string R1 The two occurrences of each stand for an arbitrary number including zero of any character and the occurrence stands for a literal period May 8 2001 91 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Control Statements MAD X consists of a core program and modules for specific tasks such as twiss parameter calculation matching thin lens tracking and so on The statements listed here are those executed by the program core They deal with the I O element and sequence declaration sequence manipulation statement flow control e g IF WHILE MACRO declaration saving sequences onto files in MAD X or MAD 8 format and so on Program flow control ooo aE OVE a Alle General control Oo Al gt EE WO Z ae mQ ae ml 72 z e lt vu N esl esi gt lt esl Q ies ai S FIF jee fam fo O Z ae ve Z a E z gt J gt ey i tr 4 Gq wv Z lt es COO0O0O0O0 0000 000000 na T gt gt m 7 vu WN lt es BETA 92 gt mjm S Flee a 5 ENC OWA ayaa mle lt AAIAAAIETElDh gt Ie OO0000 RING OO0000 Beam specification PLOT PLOT SPLOT SETPLOT z Sequence editing Elza wm RIE m gt OTR AE IZIEICISIAI2 SPIA RIS ala ge they oz ANE NAHE Ile l
167. er 1 out of 4 possible ones vaxis2 one or several variables from the table to be plotted against the vertical axis number 2 out of 4 possible ones vaxis3 one or several variables from the table to be plotted against the vertical axis number 3 out of 4 possible ones vaxis4 one or several variables from the table to be plotted against the vertical axis number 4 out of 4 possible ones O Important vaxis and vaxisI are exclusive in their application haxis name of the horizontal variable hmin lower horizontal edge hmax upper horizontal edge to be used both hmin and hmax must be given vmin lower edges of vertical axes up to four numbers vmax upper edges of vertical axes up to four numbers both vmin and vmax must be given for an axis to be effective 00000 0 O bars 0 default or 1 in the latter case all curve points coming from the table are connected 190 with the horizontal axis by vertical bars style 1 default 2 3 or 4 curve style being solid dashed dotted and dot dashed a value of 100 makes MAD X use these four styles in turn for successive curves in the same plot If style is 0 no curve is printed between points N B If symbol and style are null at the same time style is forced to its default value 1 colour 1 default 2 3 or 5 colour being black red green blue and magenta a value of 100 makes MAD X use these five colours in turn for successive curves symbol 0
168. erage energy error More precisely the revolution frequency fg is determined for a fictitious particle with constant momentum error DELTAP delta delta E p c which travels along the design orbit The RF frequencies are then set to frr h fo If the machine contains at least one RF cavity and if synchrotron radiation is on the EMIT command computes the equilibrium emittances and other electron beam parameters using the method of In this calculation the effects of quadrupoles sextupoles and octupoles along the closed orbit is also considered Thin multipoles are used only if they have a fictitious length LRAD different from zero If the machine contains no RF cavity if synchrotron radiation is or if the longitudinal motion is not stable it only computes the parameters which are not related to radiation The tolerance is for the distinction static dynamic if for the eigenvalues of the one turn matrix le_val_5 lt tol and le val_6l lt tol then the longitudinal motion is not considered otherwise it is The default for TOL is 1 000001 In the current implementation the BEAM values of the emittances and beam sizes are only updated for deltap zero Example RFC RFCAVITY HARMON VOLT BEAM ENERGY 100 0 RADIATE EMIT DELTAP 0 01 Remark This module assumes nearly constant lattice functions inside elements This assumption works for many machines like LEP see example but it fails wh
169. erated print_at_end logical default false If true the files and internal tables containing results at the end of the position range will be generated nosixtrack logical default false If true the input file fc 34 will not be generated internally by invoking the conversion routine of sixtrack and the user should provide it before the execution of the sodd command A more detailed description can be found in A B note 2004 069 September 10 2004 195 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH GEOMETRIC LAYOUT The SURVEY command computes the coordinates of all machine elements in alglobal reference system These coordinates can be used for installation In order to produce coordinates in a particular system the initial coordinates and angles can be specified The computation results are written on an internal table survey and can be written on an external file Each line contains the coordinates at the end of the element The last USEd sequence is used except if another one is specified WARNING in the case a machine geometry is constructed with thick lenses the circumference will change if the structure is converted into thin lenses via the makethin command This is an unavoidable feature ONLY the structure with thick lenses must be used for practical purposes INFORMATION The skew dipole component of a MULTIPOLE element MULTIPOLE KSL FLOAT is NOT taken into account in the survey calculation You should use
170. ergy RADIATION_ENERGY_LOSS loss for logical radiation _model1 adds the radiation in quadrupoles It supplements either turn on the calculations BEAM_ENVELOPE of the beam logical envelope with PTC RADIATION_QUADR logical turn on the simulations of SPACE_CHARGE the under construction space charge forces between particles logical Remarks 1 RADIATION Has precedence radiation model 2 RADIATION_MODEL1 Additional module by F Zimmermann The model simulates quantum excitation via a random number generator and tables for photon emission It can be used only with the element by element tracking option element by elementh 3 RADIATION_ENERGY_LOSS Of use for 4 BEAM_ENVELOPE It requires the options and 6 5 SPACE_CHARGE This option is under construction and is reserved for future use 225 PTC_TRACK_END Description The PTC_TRACK_END command terminate the command lines related to the PTC_TRACK module TRACKSUMM table The starting and final canonical coordinates are collected in the internal table tracksumm printed to the file with WRITE command Examples Several examples are found on the here The typical tasks The following table facilitates the choice of the correct options for a number of tasks CLOSED_ORBIT ELEMENT_BY_ELEMENT PTC_START X PX PTC_START FX PHIX NORM_NO NORM_OUT PTC_OBSERVE
171. es must come after declarations at least for Windows CL Printouts redirected to prt_file mpar made compiling three functions moved from matchc2 c to madxu c Updated match with knobs Constraints for ranges with match use_macro implemented fix compilation warnings add warning when use_macro option is used with too many variables New jacobian routine with svd Option COND added for controlling the SVD Increased number of constraints Corrected bug in match use_macro in match2_evaluate_exressions change in the print out of match summary when USE_MACRO Redundant printf removed Implemented 1 ptc_setfieldcomp that set any order field strengh to requested value It enables matching of higher order field components 2 Special matching mode use_ptcknob It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner For further details see the comments at the top of matchptcknobs c file 293 3 Minor corrections and protections against segmentation vilation Error flag is monitored in mtcond so if an error occured during macro execution it is handled appropriately matchptcknobs c Functions defined elsewhere should be defined with extern so linker does not complain about multiple definitions Algorithm made more stable Typo corrected introduced correct treatment of magnet families Protection against deletion of NULL pointer added Parametric mat
172. eta del PT beta b del alpha del PT alpha beta del beta del PT PHIX Chromatic phase function Phi 2pi PHIX Phi atan a b DMUX Chromatic derivative of phase function mu 2pi DMUX del mu del PT DDx Chromatic derivative of dispersion D m 36 DDX 1 2 del x del PT DDPX Chromatic derivative of dispersion D px 1 DDPX 1 2 del p del PT p WY Chromatic amplitude function W 1 WY W sqrt a 24 b 2 ay del beta del PT beta by del alpha del PT alpha beta del beta del PT PHIY Chromatic phase function Phi 2pi PHIY Phi atan a b DMUY Chromatic derivative of phase function mu 2pi DMUY del mu del PT DDY Chromatic derivative of dispersion D m DDY 1 2 del y del PT DDPY Chromatic derivative of dispersion D py 1 DDPY 1 2 del p del PT py Variables in the SUMM Table After a successful TWISS command a summary table is created which contains the following variables LENGTH The length of the machine m ORBITS The T c t m component of the closed orbit ALFA The momentum compaction alpha p 1 GAMMATR The transition energy gamma transition 1 Q1 The horizontal tune Q 1 DQI1 The horizontal chromaticity dq 1 37 DQ1 dq del Q del PT BETXMAX The largest horizontal beta m DXMAxX
173. eters 137 Layout of file FOR MADX VERSION 3 XX AND OLDER ONLY reference point magnet namel Ax Bx Cx Ay By Cy magnet name2 Ax Bx Cx Ay By Cy EECa Example of file IThis is the start of the file First we give a reference point The origin of the coordinate system will be at the START of this element mq 12r1l b1 Then we give a list of elements and their displacement w r t the reference point mcbxa 312 0 2 56545 3 0 2 3443666 0 The next nodes use the same reference point Elements offset w r t another point must be given in another file together with the new reference point mcbxa 3r2 0 3323 32 443355 0 84 0 2522 32 554363 0 0 This is the end of the file Layout of file FOR MADX VERSION 4 XX ONWARDS now TFS format note that variable names changes with Ax gt DDX_OFF Bx gt DX_OFF Cx gt X_OFF same for Y The column S_IP is useless but mandatory It results from a misunderstanding Content is ignored In a future version it will be suppressed but will not induce an error if present NAME 06s OFFSET TYPE sQ6s OFFSET REFERENCE 610s mg 12r1 b1 NAME S_IP X_OFF DX_OFF DDX_OFF Y_OFF DY_OFF DDY_OFF mq l2ril bL 0 0 SIRO 2 56545 0 0 0 0 2 3443666 0 0 mcbxa 3r2 0 0 0 84 32 443355 0 3323 0 0 32 554363 0 2022 A python script to convert a file from the old V 3 XX format to the new V4 xx can be found at afs cern ch eng lh
174. f needed updated latest head developements madxn c Reverting to old warning routine Clean up New matching with macros that enables fitting of non linear parameters with PTC The eigenvalue keyword is consistent set to the 2 characters eign eigenvector calculation in ptc_twiss 6D eign in ptc_normal 1 Adding eign to ptc_normal table normal_results 2 Grow table normal_results if needed Merged with version MAD X 3 02 29 updated latest head developements weight paramter in constraint command to be used with use macro madxp c option no_fatal_stop to not let a fatal error kill madx Reverting to old warning routine fmt can not be register variable Clean up New matching with macros that enables fitting of non linear parameters with PTC Merged with version MAD X 3 02 29 weight paramter in constraint command to be used with use macro madxu c Clean up New matching with macros that enables fitting of non linear parameters with PTC weight paramter in constraint command to be used with use macro matche c Clean up New matching with macros that enables fitting of non linear parameters with PTC output fix weight paramter in constraint command to be used with use macro matchc2 c New match library needed for non linear matching readded due to dead revision clean up fix compiler complain output fix weight paramter in constraint command to be used with use macro match
175. file align ip2 bl tfs mesured alignment readtable table offset file offset ip2 bl tfs nominal offsets n_elem table offset tablelength create table align_offset column _name s_ip x_off dx_off ddx_off y_off dy_off ddy_off calcul elem_name macro x_off table align elem_name x_ali x_off y_off table align elem_name y_ali y_off one_elem j_elem macro setvars table offset row j_elem exec calcul tabstring offset name j_elem fill table align_offset i_elem 0 while i_elem lt n_elem i_elem i_elem 1 exec one_elem Si_elem write table align_offset file align_offset tfs stop May 8 2001 53 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Range and Class Selection Format RANGE A range can be defined starting at a given element and ending at another element both elements included Two forms exist range position range positionl position2 In the first case only one element is selected in the second case one or several elements are selected NOTE position1 must not be behind position2 in the sequence position is composed of the element name and an optional occurrence count in the sequence mq 25 16 1 no occurrence count given mb 17 occurrence count given There are two predefined MAD indices O S The start of the beam line expanded by USE O E The end of the beam line expanded by USE If in the USE statement o
176. file_gdb Makefile_gfortran Makefile_nag Makeonline Changes moved aperture code from madxn c to new file aperture c corrections more apex in halo polygon corrected the construction of rectellipse in the general case secured potentially dangerous division by zero Cleaned code so NAG warnings are minimized now mainly unused variables PTC May 2007 madx_ptc_normal_module PTC version including spin Changes needed to compile routine dlamcl without optimization in extra file matchlib2 F Otherwise madx gets stuck in matching procedures In all Linux Makefiles matchlib2 F is compiled when using g77 For the Fortran90 compilers 1 95 995 95 NAG and gfortran an optimized routine is used as provided by Andy Vaught the g95 maintainer For Windows the special compile flag lfe D_G95 was needed special undocumented Fujitsu compile flag of the Lahey 1 95 to compile this special Fortran90 version of dlamcl Adjustments to produce 32bit executables on AMD64 not complete yet New PTC 2007 mod to Makefile due to filename change plugin support off New ptc_twiss so A_ is tracked This makes possible tracking of moments to be completed New gino PTC version Take out fno second underscore from the gcc flags Add LIBX for FCS 301 as a comment change in the print out of match summary when USE_MACRO Implemented 1 ptc_setfieldcomp that set any order field strengh to requeste
177. finition statement It gives a name to the stored command e A keywordlidentifies the action desired Thelattributes are normally entered in the form attribute name attribute value and serve to define data for the command where O attribute name selects the attribute O attribute value gives it a value If a value has to be assigned to an attribute the attribute name is mandatory For logical attributes it is sufficient to enter the name only The attribute is then given a default value taken from the command dictionary Example TILT attribute for various magnets The command attributes can have one of the following types 42 tring attribute ogical attribute nteger attribute Real attribute xpression Range selection Any integer or real attribute can be replaced by a expressions are normally deferred see except in the definition of constants where they are evaluated immediately When a command has a MAD X keeps it in memory This allows repeated execution of the same command by just entering EXEC label This construct may be nested For an exhaustive list of valid declarations of constants or variables see declarations May 8 2001 43 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Identifiers or Labels A keyword begins with a letter and consists of letters and digits The MAD X keywords are protected using one of them as a label results in a fatal error May 8 2001 44 W EUROPEAN ORGANIZATION F
178. from ipnn inr xx nn cc macro macro installing bb and markers for right side parasitic beam beam print text install element xxipnnprcc at cc b_h_dist from ipnn bbl nn cc macro macro defining parasitic beam beam elements nn IP number print text bbipnnplcc beambeam sigx sqrt rnnipnnplcc gt betx epsx print text sigy sqrt rnnipnnplcc gt bety epsy print text xma rnnipnnplcc gt x yma rnnipnnplcc gt y print text charge on_lrnnl bbr nn cc macro macro defining parasitic beam beam elements nn IP number print text bbipnnprcc beambeam sigx sqrt rnnipnnprcc gt betx epsx print text sigy sqrt rnnipnnprcec gt bety epsy j print text xma rnnipnnprec gt x yma rnnipnnprec gt y print text charge on_lrnnr June 17 2002 86 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Parameter Statements Relations between Variable Parameters A relation is established between variables by the statement parameter name expression or parameter name expression The first form evaluates the expression at the right immediately and assigns its value to the parameter The second form assigns the value by evaluating the expression at right every time the parameter is actually used This holds as well for element parameters beware If you want to modify e g the strength of a quadrupo
179. fter correction printed to file RESOUT This command outputs the results for all monitors and all correctors in a computer readable format if its integer argument is larger than 0 The argument is added to the output Useful to analyze runs with loops to produce large statistics ATTENTION May produce gigantic outputs for large machines TWISSUM If the argument of twissum is larger than 0 it prints maximum orbit and r m s for both planes taken from the Twiss summary table in computer readable form Allows to analyze orbits etc at elements that are not monitors or correctors The argument is added to the output Only for output no correction is made all other commands are ignored 185 Obsolete commands or options ITERATE ITERMAX Done with loop feature in MAD commands THREADER HRTOL WRORBIT Not part of orbit correction module MILIST M2LIST Replaced by MLIST C1LIST C2LIST Replaced by CLIST GETORBIT PUTORBIT Replaced by generic TFS access GETKICK PUTKICK Replaced by generic TFS access EXAMPLES for complete MAD input files see section on examples Example 1 correct orbit in horizontal plane taken from most recent Twiss table using default algorithm MICADO CORRECT PLANE x Example 2 no correction only output of Twiss summary CORRECT TWISSUM 1 Example 3 correct orbit in horizontal plane corrector and monitor outp
180. g on the format ps or eps see below the plots will either all be written into one file file_name ps or one per plot into file_name01 eps file_name02 eps etc ptc logical default false If set true the data to be plotted are taken from the table defined by 191 the attribute ptc_table which is expected to be generated previously by the ptc package The data belong to the column identified by one of the names set in the definition of the ptc twiss table Interpolation is not available and the attribute interpolate has no effect ptc_table name of the ptc twiss table to be plotted from default ptc_twiss trackfile first part of the name of the files containing tracking data for each particle default track SETPLOT setplot post integer font integer lwidth real xsize real ysize real ascale real lscale real sscale real rscale real where the parameters have the following meaning post default 1 If 1 makes one PostScript file ps with all plots if 2 makes one Encapsulated PostSscript file eps per plot font there are two defaults 1 for screen plotting this uses characters made from polygons 1 for PostScript files this is Times Italic There are various fonts available for positive and negative integers best to be tried out since they will look different on different systems anyway GhostView will show strange vertical axis annotations but the printed versions are normally OK Iwidth
181. g detailed lattice geometry in PTC Several small bug corrections and some code cosmetics Change logical dp to the correct logical lp Error flag implemented that signals that error code occured Option for track position given in global coordinate system added debug level 9 removed completely madx_ptc_twiss 90 v mad xX_3_66 bugs found by EK Problems 299 1 pt not displayed in table 2 deltap not in ptc_twiss header unless a twiss command was done before ptc_twiss Solution 1 Set up y properly 2 Put deltap into header of the ptc_twiss table permanently Fix routine readrematrix by exchanging x 5 and x 6 Adding deltap to ptc_twiss in case of initial conditions 1 madx_ptc_module without the ptc_normal stuff 2 fixing the savemaps bug Don t display orbit in debug 0 mode 1 Se_status preliminary fix of uninitialized variable RADIATION_NEW 2 madx_ptc_module Fix of ptc_normal by fixing the string comparison 3 madx_ptc_module amp madx_ptc_twiss write amp read traditional DA map format Type twiss becomes public to overcome problem with g95 Probably okay in g95 but may be overly picky Bug corrected p0c was written to twiss table instead of energy Bug Corrected Parametric twiss results where not scaled with energy Few protections agains seg faults added Redundant debug info available only in high level debug mode Knobs for Initial parameters Moments updated i
182. g nl supressed the memory crash when aperture called twice with the same offsetlem in tfs format nougaret further prevent output mixup through forced flush when crossing the border in the other direction i e Fortran calling C which is more rare than the reverse handle flushing unit 6 on Intel ifort compiler invoke call flush 6 as flush 6 with Intel compiler suppress compilation warnings skowron Added filling of track summ table for ptc_trackline Now the user can check what were the final coordinates of tracking If plugin support link dynamically if debug do not put 04 optimization g95 option add proper debug flags Work log between releases madX 4_00_09 and madX 4_00_19 Log report started Mon May 4 20 02 18 2009 ended Mon May 4 20 03 41 2009 elaface Fixed argument of wrong type passed to the mtlmdl Fortran subroutine warning fixed Now the check for OSTYPE works with darwin9 0 frs 1 New TPSA package by lingyun yang gmail com 2 General clean up 283 Preliminary fix of memory crash courtesy JBJ Some rearrangements by Etienne and final clean up of PTC GET_C_J routine no longer needed Missing general public statements which creates pseudo bugs More clean up for the TPSA upgrade Fortran Clean up indenting remove potentially uninitialized variable and also remove unused variables Minor clean up concerning character strings possibly uninitialized variables and unused variables ON
183. ge are considered not to be a simply connex Since all MAD X apertypes are simply connex this is only possible if an input file with beam screen coordinates are given See below for a graphical example Default false trueprofile A file containing a list of magnets and for each magnet a list of horizontal and vertical deviations from the ideal magnet axis These values may come from measurements done on the magnet See below for example Default none offsetelem A file containing a reference point in the machine and a list of magnets with their offsets from this point described as a parabola See below for example Default none Not simply connex beam pipes Methodically the algorithm for finding the largest possible halo is fairly simple The distance from halo centre to the first apex i 0 in the halo is calculated I_i and the equation for a line going through these points is derived This line is then compared with all lines making the pipe polygon to find their respective intersection coordinates The distance h_i between halo centre and intersection 133 are then divided by _i to find the maximal ratio of enlargement as seen below This procedure is then repeated for all apexes i in the halo polygon and the smallest ratio of all apexes is the maximal enlargement ratio for this halo to just touch the pipe at this particular longitudinal position There is one complication to this solution polygons which are not simple
184. gy spread and the bunch length are sigma E po c 2 pi Q E ETAC c sigma t ETA CE 2 piQ C is the machine circumference and ETA GAMMA 2 GAMMA transition 2 The order of precedence in the parameter evaluation is given below particle gt mass charge nergy gt pc gt gamma gt beta ex gt exn ey gt eyn current gt npart t gt sigt gt sig where any item to the left takes precendence over the others Finally the BEAM command accepts KBUNCH The number of particle bunches in the machine default 1 NPART The number of particles per bunch default 0 BCURRENT The bunch current default 0 A BUNCHED A logical flag If set the beam is treated as bunched whenever this makes sense RADIATE A logical flag If set synchrotron radiation is considered in all bipolar magnets BV an integer specifying the direction of the particle movement in a beam line either 1 default or 1 For a detailed explanation see under bv flag SEQUENCE this attaches the beam command to a specific sequence if the name is omitted the BEAM command refers to the default beam always present Sequences without attached beam use this default beam When updating a beam the corresponding sequence name if any must always be mentioned The BEAM command changes only the parameters entered The command RESBEAM resets all beam data to their beam value defaults
185. h help of ptc_eplacement Command parameters and switches file string Specifies name of the file format string default text Format of geometry Currently two formats are accepted text Prints a simple text file rootmacro Creates acro that produces 3D display of the geometry 252 253 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH PTC_SELECT USER MANUAL SYNOPSIS PTC_SELECT table s none none column s none none polynomial i none monomial s none parametric l false true quantity s none Description Selects map elements to be a Stored in a user specified table and column Table and column must be specified than and such table with such column must exists b Stored as a function taylor series of if any is defined Than parametric should be set to true Both a and b can be joined in one command Examples strength of quads is matched to obtain required T112 value postion of quads is matched to obtain required T566 value dipols and quads strengths are matched with the help of knobs to obtain required momentum compaction and Twiss functions Command parameters and switches table string 254 Specifies name of the table where values should be stored column string Specifies name of the table where values should be stored polynomial integer Specifies row of the map monomial string composed of digits Defines monomial of the p
186. he particle arrives ahead of the reference particle PT Energy error divided by the reference momentum times the velocity of light PT delta E p c 1 This value is only non zero when synchrotron motion is present It describes the deviation of the particle from the orbit of a particle with the momentum error DELTAP DELTAP Difference of the reference momentum and the design momentum divided by the reference momentum DELTAP delta p pg 1 This quantity is used tofnormalize all element strengths The independent variable is S Arc length s along the reference orbit m In the limit of fully relativistic particles gamma gt gt 1 v c p c E the variables T PT used here agree with the longitudinal variables used in TRANSPORT This means that T becomes the negative path length difference while PT becomes the fractional momentum error The reference momentum p must be constant in order to keep the system canonical Normalised Variables and other Derived Quantities XN The normalised horizontal displacement XN x Re E T S Z sqrt m 33 PXN The normalised horizontal transverse momentum PXN x Im E S Z sqrt m Wx The horizontal Courant Snyder invariant WX sqrt x Pan m PHIX The horizontal phase PHIX atan p yn x 2 pi 1 YN The normalised vertical displacement YN x Re E gt S Z sqrt m PYN The normalised vertical transverse momentum PY
187. he voltage is given by V V0 dvds z updated latest head developements Updated to madX 3_02_16 bug corrected in madx_ptc_setcavs 90 Several instances found Sp_keywords 90 Adapting Makefiles for non linear matching and PTC upgrade PTC upgrade Proper Thin Lens Lattice a_def_all_kind inc Adapting Makefiles for non linear matching and PTC upgrade PTC upgrade Proper Thin Lens Lattice PTC with dvds implemented in the travelling wave cavity The voltage is given by V V0 dvds z Updated to madX 3_02_16 bug corrected in madx_ptc_setcavs 90 a_def_element_fibre_layout inc Adapting Makefiles for non linear matching and PTC upgrade PTC upgrade Proper Thin Lens Lattice PTC with dvds implemented in the travelling wave cavity The voltage is given by V V0 dvds z Updated to madX 3_02_16 bug corrected in madx_ptc_setcavs 90 a_def_userl inc 303 No longer needed after PTC upgrade 25 04 2005 a_def_user2 inc No longer needed after PTC upgrade 25 04 2005 a_scratch_size 90 logical must be without lp when going into INQUIRE function Adapting Makefiles for non linear matching and PTC upgrade PTC upgrade Proper Thin Lens Lattice A11 constants collected here Carefully checked and reordered PTC with dvds implemented in the travelling wave cavity The voltage is given by V V0 dvds z updated latest head developements Updated to madX 3_02_16 bug corr
188. hen a particle is lost on the aperture this information is written to stdout To allow more flexible tracking studies the lost particles coordinates and further information can also be saved in a table in memory Usually one would save this table to a file using the WRITE command after the tracking run has finished The following information is available in the TFS table trackloss Particle ID number Turn number Particle coordinates x px y py t pt Longitudinal position in the machine s Beam energy Element name where the particle is lost UPDATE Changed behaviour for time variation in tracking Use track command option update e g track onepass update to use the following additions Introduced special variable tr turni that can be used in expressions like KICK sin tr turni and is updated at each turn during tracking Introduced special macro tr macro that can be user defined tr macro turn macro whatever depending on turnnumber and is executed updated at each turn during tracking Macro is necessary e g for table access 218 START x double px double y double py double t double pt double START fx double phix double fy double phiy double ft double phit double Description After the TRACK command a series of initial trajectory coordinates has to be given by means of a START command as many commands as trajectories The coordinates can be
189. her restmass nor charge can be modified for these predefined particles On the other hand for ions and all other user defined particles the name restmass and charge can be entered independently By default the total particle energy is 1 GeV A different value can be defined by one of the following ENERGY The total energy per particle in GeV If given it must be greater then the particle restmass PC The momentum per particle in GeV c If given it must be greater than zero GAMMA The ratio between total energy and rest energy of the particles GAMMA E m If given it must be greater than one If the restmass is changed a new value for the energy should be entered Otherwise the energy remains unchanged and the momentum PC and the quantity GAMMA are recalculated The emittances are defined by EX The horizontal emittance E default 1 m EY The vertical emittance E default 1 m ET The longitudinal emittance E default 1 m The emittances can be replaced by the normalised emittances and the energy spread EXN The normalised horizontal emittance m E 4 GAMMA 1 E ignored if E is given EYN The normalised vertical emittance m En 4 GAMMA 1 7 E y Ggnored if E is given SIGT The bunch length c sigma t in m SIGE The relative energy spread sigma E in 1 Certain commands compute the synchrotron tune Q from the RF cavities If Q is non zero the relative ener
190. i zi A gt Nn ROTATION Rotation Around the Longitudinal Axis EAMBEAM Beam Beam Interaction MATRIX Arbitrary Elemen diting Element Definitions oa Element Class January 24 1997 108 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Element Input Format All physical elements are defined by statements of the form label keyword attribute Example QF QUADRUPOLE L 1 8 K1 0 015832 where e is aname to be given to the element in the example QF e keywordlis an element type keyword in the example QUADRUPOLE e attribute normally has the form attribute name attribute value or attribute name attribute value except for multipoles e attribute namelselects the attribute as defined for the element type keyword in the example L and K1 gives it a value in the example 1 8 and 0 015832 The value may be specified by an expression The assigns the value on the right to the attribute at the time of definition regardless of any further change of the right hand side the re evaluates the expression at the right every time the attribute is being used For constant right hand sides and are of course equivalent Omitted attributes are assigned a default value normally zero A special format is used for a m multipole kn kn0 knl kn2 knmax ks ks0 ksl ks2 ksmax where kn and ks give the integrated normal and skew strengths respectively The commas
191. iable in subr photon is removed Unused variables detected with Makefile_nag are removed the re initialization of NaN flags ICASE 56 created a fatal bug fixed by setting ICASE 5 ICASE other than 4 5 56 gt 5 6 throws a fatal error For safety a implicit none statement plugged into every subroutine and also every function independent if strictly needed or not PTC_Track tables The last element is END not START NaN tracks by TRACK of PTC are blocked and tracking is terminated Serious crash in ptc_track for unstable particles due to unitialized PTC aperture check variable Converted from windows to unix encoding Bug in madx_ptc_track_run f90 for ICASE 5 is fixed Numb of Eigens gt 4 Debug output only at debuglevel 4 madx_ptc_trackcavs 90 Removed bug in node tracking making impossible tracking for closed layouts First step for node layout tracking in ptc_trackline New ptc_twiss so A_ is tracked This makes possible tracking of moments to be completed Track Global Coordinates corrected gt position is given with respect to fibre not magnet Turn number added in rplot Added switch to ptc_trackline command so user can choose if tracks shall be written to a ROOT ntuple The feature is only accessible if rplot plugin is installed and madx is compiled with plugin support Sceleton for knobs and arbitrary element placement implemented Lattice visualization via ROOT macro Printin
192. icle trajectories stays within the aperture limits The Normal Form calculations required option is controlled by fnorm_noland fnorm_out are used Basic Options 223 ICASE DELTAP CLOSED_ORBIT ELEMENT_BY_ELEMENT ONETABLE MAXAPER NORM_NO NORM_OUT EXTENSION FFILE Remarks ICASE has a highest priority over other options a RF cavity with non zero voltage will be ignored for licase 4 5 b A non zero deltap wi11 be ignored for ficasek4 6 However if RF cavity has the voltage set to zero and for 6 the code sets 4 DELTAP is ignored for icase 6 but the option of the command PTC_CREATE_LAYOUT may be used if the reference particle should have an momentum off set as specified by foffset_deltap CLOSED_ORBIT It must be used for closed rings only This option allows to switch ON the Normal Form analysis if required If CLOSED_ORBIT is off the sequence is treated as a transfer line NORM_NO 1 makes the Normal Form linear always true for MAD8 X FILE The output file endings are obsnnnn observation point followed by pnnnn particle number 224 if the option is not used Special Switches Default Meaning Value turn on the synchrotron radiation RADIATION calculated by an logical internal procedure of PTC switch to turn on the radiation RADIATION_MODEL1 according to the logical method given in the Ref ah adds the en
193. ified for the following physical elements sbend rbend quadrupole sextupole octupole and solenoid Multipole coefficients are specified as the integrated value IK ds of the field components along the magnet axis see the table below These multipole components in PTC are spread over a whole element if gt 0 This is a considerable advantage of PTC input compare to MAD X which allows only 2 To preserve the reference orbit of straight elements dipole components for those elements are ignored knl 0 0 ksl 0 0 3 Individual NST values for a particular thick element l gt 0 can be specified For example in MAD X any RF cavity is represented by a single kick while PTC splits the RF cavity into global NST segments In this way PTC considers properly transit time effects of the cavity In case one wants to reproduce the approximate results of MAD X one can use NST 1 for RF cavity in PTC Multipoles on Bench PTC only 212 Default Meaning Value The normal multipole coefficient The skew multipole 0 m coefficient 0 m1 Remarks Length l Bending magnets sbend rbend are treated as markers if l 0 Additional Field Errors A full range of multipole field errors can be additionally specified with EFCOMP commanad Errors are added to the above multipole fields on the bench Caution A user has to understand that PTC exists inside of MAD X as a library MAD X offers the interface to PTC
194. ile see ASSIGN above The text can be edited with the help of a For more details see there QUIT quit ends the program execution READTABLE readtable file filename reads a TFS file containing a MAD X table back into memory This table can then be manipulated as any other table i e its values can be accessed it can be plotted written out again etc READMYTABLE readmytable file filename table internalname reads a TFS file containing a MAD X table back into memory This table can then be manipulated as any other table i e its values can be accessed it can be plotted written out again etc An internal name for the table can be freely assigned while for the command READTABLE it is taken from the information section of the table itself This feature allows to store multiple tables of the same type in memory without overwriting existing ones RESBEAM resbeam sequence s_name resets the default values of the beam belonging to sequence s_name or of the default beam if no sequence is given 97 RETURN return ends reading from a called file if encountered in the standard input file it ends the program execution SAVE save beam sequence sequl sequ2 file filename beam bare saves the sequence s specified with all variables and elements needed for their expansion onto the file filename If quotes are used for the filename capital and low characters are kept as specified if
195. ing of moments to be completed Initial orbit NOT closed orbit for initial betax In case of instabilility in normal form the code sets the global error flag and returns to the main command loop instead of fatal fulfilled formalistic request for a change of the definition of numenclature of the ptc_twiss variables beta alfa and gama Making unstable behavior in NormalForm a fatal error All PTC track commands and NormalForm executions are checked for unstable behavior gt ks for tilt lt 0 298 First fill user tables and at the end TWISS table Implemented 1 ptc_setfieldcomp that set any order field strengh to requested value It enables matching of higher order field components 2 Special matching mode use_ptcknob It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner For further details see the comments at the top of matchptcknobs c file 3 Minor corrections and protections against segmentation vilation PTC knobs pol_blocks almost completely interfaced to MAD X User sets a knob with ptc_knob command Twiss parameters and user specified with ptc_select map components are buffered in memory after every element in form of taylor series They can be dumped to text file in two formats with ptc_printparametric command They can be also visualized and further studied with rviewer from rplot plugin Further user can set numeric values of knobs with ptc_se
196. ing spin O tone Etienne Therefore I included this Zip file which contains the newest PTC There are a few minor bugs related to patches in the present CVS version of PTC This could affect the CHANGEREF command of Frank It is fixed in this new PTC In addition I included some routines in pointers 90 and the script file for the example Etienne s clean up Change faulty print out of Totalpath 1 Se_status preliminary fix of uninitialized variable RADIATION_NEW 2 madx_ptc_module Fix of ptc_normal by fixing the string comparison 3 madx_ptc_module amp madx_ptc_twiss write amp read traditional DA map format PTC first changes stay October 2006 thinlens cutting Introducing TRUERBEND and WEDGRBEND in PTC To this end 2 flags have been introduced in the NAD X dictionary madxdict h 1 pterbend if true it uses a PTC type RBEND 2 truerbend if true it uses TRUERBEND if false it uses WEDGRBEND Etienne O tone I fixed a bug in the exit patches part of the backward survey This bug was noticed while doing the Daphne backward ring Patching was done correctly but the survey command was moving the layout This reflects a bug in either patching or survey dangerous The definition is integer pointer CAVITY_TOTALPATH REAL PILL BOX 1 FAKE 0 default Accidentally it was set CAVITY_TOTALPATH 0 Big bug in GETMAT7R and GETMAT7d DH wrong basically model 2 method 4 is messed up New PTC Etienne end of visit
197. ize 90 i_tpsa 90 j_tpsalie 90 Replace double precision by real dp Merged newmatch 060411 with recent HEAD developement madx_pte_intstate 90 global debuglevel integer added 0 completely silent 1 normal printout 2 most important debug information 3 everything madx_pte_module 90 AP and cav 1 Fix priority order between ICASE and DE 2 Convert DELTAP to PT 3 Proper conversion between variables for 5D 4 Clean Up Replace double precision by generic real dp MAD X version 3 02 05 22 03 2006 gs revealed a couple of subtle Fortran bugs like alized variabl Examples including Documen and out of bound usage of arrays tion brought up to date 306 All changes for each file makefile New functionality for PTC track linac pte_twiss with acceleration pte_select ptc_script pte_dumpmaps Take out Sg_0_fitted 90 since no longer needed for PTC upgrade Maketile bat Fixes needed to get it to run on Windows Missing file added New functionality for PTC track linac pte_twise with acceleration pte_select pte_script pte_dumpmapa Take out q_0_fitted 90 since no longer needed for PTC upgrade updated to include matehje Default location for checked out files changed comment added Makefile develop More interesting flags chk a e 2 u chkglobal info Adapting to Piotr s new PIC additions Switching to 1f95 with very ugh compile f
198. jc F Clean up Jacobian fix Avoid twiss or macro to be called before a check on the variables limits New matching with macros that enables fitting of non linear parameters with PTC weight paramter in constraint command to be used with use macro matchlib F New match library needed for non linear matching readded due to dead revision o_tree_element 90 Updated to madX 3_02_16 bug corrected in madx_ptc_setcavs 90 pointers 90 put pointers to the end on request of Etienne Fix write statement that was changed by automatic clean up IE replacing pause statements Needed for PTC upgrade 25 04 2005 track fi Cleaned version of thintrack No delta_p dependence internally any more 305 Only radiation part of code still contains delta Full 6D equations Ripken used Some further improvements Closed orbit still computed by twiss Merged with version MAD X 3 02 29 trrun F Change the definition x y AK ES the kicker The acting on px py now instead of Cleaned version of thintrack No delta_p dependence internally any more Only radiation part of code still contains delta Full 6D equations Ripken used Some further improvements Closed orbit still computed by twiss Merged with version MAD X 3 02 29 twiss F ake out debug printing of eigen remove bug division by zero due to dipole errors user2_photon 90 1 Remove residual left over definition of do
199. kew octupole coefficient K3s 1 2 B rho B dx gt 6 B dy where x y is now a coordinate system rotated by 22 5 around s with respect to the normal one default 0 m 4 A positive skew octupole strength implies defocussing of positively charged particles in the x s plane rotated by 22 5 around s particles in this plane have x gt 0 y gt 0 TILT The roll angle about the longitudinal axis default 0 rad i e a normal octupole A positive angle represents a clockwise rotation A TILT pi 8 turns a positive normal octupole into a negative skew octupole Please note that contrary to MADS one has to specify the desired TILT angle otherwise it is taken as 0 rad This was needed to avoid the confusion in MAD8 about the actual meaning of the TILT attribute for various elements Note also that K3 K3 can be considered as the normal or skew quadrupole components of the magnet on the bench while the TILT attribute can be considered as an tilt alignment error in the machine In fact a positive K3 with a tilt 0 is equivalent to a positive K3 with positive tilt pi 8 Example 03 OCTUPOLE L 0 3 K3 0 543 The straight reference system for a octupole is a cartesian coordinate system Octupoles are normally treated as thin lenses except when tracking by Lie algebraic methods August 28 2003 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Solenoid label SOLENOID L real KS real thick ver
200. kline in madx_ptc_trackline f90 The key routine that enables appropriate calculation of beam and track parameters in the presence of traveling wave cavities is setcavities Firstly the ptc_trackline routine finds out which are the observation points For this purpose array of integers observedelements is allocated Its length is equal to the number of elements in the sequence All elements are zero by default If an element with an index n is an observation point then observedelements n is equal to 1 This solution enables fast checking if track parameters should be sent to a table after a given element Further setcavities subroutinelis called if it was not executed yet before PTC_TRACKLINE reads the track initial parameters from the table with the help of gettrack function implemented in C in file madxn c For the performance reasons gettrack creates a two dimensional array and buffers there all the initial track parameters upon first call The array is destroyed with a call of deletetrackstrarpositions function that is performed at the very end of ptc_trackline subroutine Tracking itself is implemented in a doubly nested loop The external one goes over all initiated tracks and the internal one performs tracking of a given track element by element The key PTC routine is called TRACK It propagates a track described by an array of 6 real numbers denoted as X in equations below The important issue is that they are the canonical variables
201. kn ks list of integers Defines which order exactmatch logical default true if value explicitly not specified then true Normally a knob is a property of a single element in a layout The specified name must match 1 1 to an element name This is the case when exactmatch is true Knobs might be alos set to all family of elements In such case the exactmatch switch must be false A given order field component of all the elements that name starts with the name specified by the user become a single knob initial 247 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH PTC_SETKNOBVALUE USER MANUAL SYNOPSIS PTC_SETKNOBVALUE elementname s none kn y Lbly ks 1l l value r Description With this command the user set a given knob value In its effect all the values in the twiss table used by the last ptc_twiss command the columns specified with parametric true are reevaluated using the buffered parametric results The parameters of the command basically contains the fields that allow to identify uniquely the knob and the value to be set Example strength of dipol field component in quads is matched to obtain required R56 value Command parameters and switches elementname string in range format Specifies name of the element containing the knob to be set kn ks list of integers Defines the knob 248 value real default 0 if value explicitly not specified then 0 Specifies
202. l Coupled Motion FN 229 FNAL 1971 34 U Volkel Particle loss by Touschek effect in a storage ring DESY 67 5 DESY 1967 35 R P Walker Calculation of the Touschek lifetime in electron storage rings 1987 Also SERC Daresbury Laboratory preprint DL SCI P542A 36 P B Wilson Proc 8th Int Conf on High Energy Accelerators Stanford 1974 319 37 A Wrulich and H Meyer Life time due to the beam beam bremsstrahlung effect PET 75 2 DESY 1975 38 H Grote J Holt N Malitsky F Pilat R Talman C G Trahern SXF Standard eXchange Format definition syntax examples RHIC AP 155 August 1998 39 F Schmidt SixTrack User s Reference Manual CERN SL 94 56 AP 40 M Hayes and F Schmidt Run Environment for SixTrack Physics Note 53 unpublished amp LHC Project Note 300 4 F Schmidt SODD A computer code to calculate detuning and distortion function terms in first and second order CERN SL Note 99 009 AP 42 R Talman and L Schachinger TEAPOT A Thin Element Accelerator Program for Optics and Tracking SSC 52 43 J D Bjorken and S K Mtingwa Intrabeam Scattering FERMILAB Pub 82 47 THY July 1982 May 01 2003 320
203. lags New functionality for PTC track linac ptc_twise with acceleration pte_select ptc_script ptc_dumpmape Take out g_0_fitted 90 since no longer needed for PTC upgrade Maketile_g95 New functionality for PTC track linac pte_twise with acceleration pte select ptc_seript pte dumpmaps take out Sg 0_fitted f90 since no longer needed for PTC upgrade madxp c indenting Fixing of madyp c 396 warning 150 C90 forbids mixed declarations and code Reduntant debug printout removed madxn e indenting compiler warnings removed Fix a menory leak in pro_pte_twise madxreg c madxu c indenting makethin e Warning on inconsistent child parent slicing removed as this has become an allowed feature clean up of old now rather obsolete comments madxd h Compiler warnings removed madx_pte_setcava 90 the variable givendene was uninitialized madxdict h In ptc_create_layout by default it is closed now fix defaults for matching with chrom este 1 In case drifts are combined at the end of the machine the end marker in fc 34 input file for sodd came with erroneous values for position beta functions and phase advances 2 For various reasons the minber of elements with field errors and or alignment errors may vary between SixTrack and MAD X Obviously the physics is identical ynap F Various bug fixes write out of distance in phase space into file lyapunov data F
204. late 90 No longer needed after PTC upgrade 25 04 2005 Sb_2_pol_template 90 No longer needed after PTC upgrade 25 04 2005 Sd_frame 90 Updated to energybefore ntenergy 1000 Se_status 90 Drop the printing of NO 10 in curvbend Adapting Makefiles for non linear matching and PTC upgrade PTC upgrade Proper Thin Lens Lattice 302 Sf_def_all_kinds 90 Adapting Makefiles for non linear matching and PTC upgrade PTC upgrade Proper Thin Lens Lattice 1 Remove residual left over definition of double precision numbers Should all be in a_scratch_size f90 2 The logical needs to be defined as logical lp updated latest head developements Several instances found Sg_1_fitted 90 No longer needed after PTC upgrade 25 04 2005 1 Remove residual left over definition of double precision numbers Should all be in a_scratch_size f90 2 The logical needs to be defined as logical 1p Several instances found updated latest head developements Updated to energybefore nfentenergy 1000 Sgq_l_template_my_kind 90 No longer needed after PTC upgrade 25 04 2005 Sgq_2_template_my_kind 90 No longer needed after PTC upgrade 25 04 2005 Sg_sagan_wiggler 90 Adapting Makefiles for non linear matching and PTC upgrade PTC upgrade Proper Thin Lens Lattice 1 Remove residual left over definition of double precision numbers Should all be in a_scratch_size f90 2 The l
205. lattice parameters As entered the initial conditions cannot depend on DELTAP and can thus be correct only for one such value Tolerance This value defines the maximum closed orbit error of all six orbit components during the closed orbit search The default value is 1 e 6 The value is only valid for the current twiss command a permanent value can be entered via the COGUESS command SAVEBETA Save Lattice Parameters Initial lattice parameters can be transfered for later commands in particular for twiss or the match module by using the savebeta command sequence 207 It should be mentioned that parameters can be also accessed from tables using the nction USE period SAVEBETA LABEL name PLACE place SEQUENCE s_name TWISS When one the sequence s_name during execution of TWISS MAD X will save a beta0 label block with the label name This block is filled with the values of all lattice parameters in place Example 1 USE period CELL SAVEBETA LABEL END PLACE E SEQUENCE CELL TWISS USE period INSERT TWISS BETAO END This first example calculates the periodic solution of the line CELL and then track lattice parameters through INSERT using all end conditions including orbit in CELL to start Example 2 USE period CELL SAVEBETA LABEL END PLACE E SEQUENCE CELL TWISS USE period INSERT TWISS BETX END gt BETY BETY END gt BETX This is similar to the fir
206. le one finds the cosine sine and amplitude coefficients as denoted by GNFC GNFS and GNFA respectively Similarily the Hamiltonian terms can be specified by n 0 0 The positive and negative values of n define the order of upright or skew resonances respectively For example haml 3 0 0 will calculate all Hamiltonian terms for upright sextupoles In the output table one finds the cosine sine and amplitude coefficients as denoted by HAMC HAMS and HAMA respectively Parameters Notation Meaning DX DPX dispersions D Dp DY DPY Dy Dyy px horizontal and vertical tunes q1 0 q2 0 Q1 Q2 derivatives of horizontal DQ1 DQ2 and vertical tunes 041 08 n aqd n n 1 n 2 n 8 GNFU Generating Function n 0 0 ANHX ANHY Anharmonicities Hamiltonian n 0 0 Eigenvector the nz th component nin of the n th eigenvector i 242 PTC_NORMAL icase integer normal closed_orbit no integer map_table deltap double Description The calculation of the parameters specified by the preceding SELECT_PTC_NORMAL commands is initiated by the PTC_NORMAL command which operates on the working beam line defined in the latest USE command The options for PTC_NORMAL command are described in the table below Options Default Meaning Value the user defined dimensionality of the phase space 4 5 or 6 the order of the map th
207. le later e g in a match or by entering a new value for a parameter on which it depends then the defition has to be qd quadrupole k1 ak1 and not qd quadrupole k1 ak1 In the latter case k1 will be set to the current value of ak1 and will not change when ak1 changes Parameters not yet defined have the value zero Example gev 100 beam energy gev the parameter on the left may appear on the right as well x xt1 Increases the value of x by 1 As a result the SET statement of MAD 8 is no longer necessary and is not implemented Circular definitions are allowed in the first form a b b 2 a b However circular definitions in the second form are forbidden 87 a r b 2 b a b will result in an error VALUE Output of Parameters The VALUE statement VALUE expression or VALUE expressionl expression2 valuates the current value of expression resp result on the standard output file Example pl 5 p2 7 value pl p2 3 After echoing the command this prints pl p2 3 32 Another example option warn while x lt 100 x x 1 value x x 2 10g10 x After echoing the command this prints x 100 i x 2 10000 i log10 x 2 11 9 2000 88 expressionl etc and prints the W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Constraints In matching it is desired to specify equality constraints as well as lowe
208. le mac compatible jbj made more robust the capture of the Twiss data of the drift preceeding the current element solving the 1st slice wrong nl supressed the memory crash when aperture called twice with the same offsetlem in tfs format nougaret further prevent output mixup through forced flush when crossing the border in the other direction i e Fortran calling C which is more rare than the reverse handle flushing unit 6 on Intel ifort compiler invoke call flush 6 as flush 6 with Intel compiler suppress compilation warnings skowron Added filling of track summ table for ptc_trackline Now the user can check what were the final coordinates of tracking If plugin support link dynamically if debug do not put 04 optimization g95 option add proper debug flags Work log between releases madX 4_00_09 and madX 4_00_19 Log report started Tue May 5 20 01 26 2009 ended Tue May 5 20 02 49 2009 elaface Fixed argument of wrong type passed to the mtlmdl Fortran subroutine warning fixed Now the check for OSTYPE works with darwin9 0 frs 1 New TPSA package by lingyun yang gmail com 2 General clean up Preliminary fix of memory crash courtesy JBJ Some rearrangements by Etienne and final clean up of PTC GET_C_J routine no longer needed Missing general public statements which creates pseudo bugs 280 More clean up for the TPSA upgrade Fortran Clean up indenting remove potentially uninitialized
209. lens tracking in agreement with Ripken theory and PTC 4 Non linear matching via encapsulated ptc_normal commands All changes for each file replacing madxdev by madxp put pointers to the end on request of Etienne Adapting Makefiles for non linear matching and PTC upgrade PTC upgrade Proper Thin Lens Lattice Makefile bat replacing madxdev by madxp put pointers to the end on request of Etienne Take out old Sb_1 and Sb_1 obj files some misplaced commands Adapting Makefiles for non linear matching and PTC upgrade PTC upgrade Proper Thin Lens Lattice madX Makefile prof replacing madxdev by madxp put pointers to the end on request of Etienne Makefile for profiling courtesy PS Mak replacing madxdev by madxp put pointers to the end on request of Etienne Adapting Makefiles for non linear matching and PTC upgrade le_develop PTC upgrade Proper Thin Lens Lattice Makef replacing madxdev by madxp put pointers to the end on request of Etienne ile_g95 Adapting Makefiles for non linear matching and PTC upgrade PTC upgrade Proper Thin Lens Lattice Merged with version MAD X 3 02 29 Makef le_nag Makefile for the NAG compiler for the moment not operational Sa_extend_poly 90 PTC with dvds implemented in the travelling wave cavity The voltage is given by V v0 dvds z Updated to energybefore nfentenergy 1000 Sb_1_pol_temp
210. lled by a combination of the SA VEBETA and TWISS commands of a preceding ring or beam line Note that this case is limited to uncoupled motion of the preceding machine Example An example is found in the PTC_TWISS Examples in the folder 239 Initial Values from the Given Twiss Parameters PTC_TWISS icase integer deltap double closed_orbit range string file string table string betx double alfx double mux double bety double alfy double muy double dx double dpx double dy double dpy double x double px double y double py double t double pt double Description PTC_TWISS calculates a solution with initial conditions given by the Twiss parameters which are explicitly typed on the command line Note that this case is also limited to uncoupled motion of the preceding ring or beam line Example An example is found in the PTC_TWISS Examples in the folder References for PTC_TWISS a F Schmidt JMAD X PTC Integration Proc of the 2005 PAC Conference in Knoxville USA pp 1272 b G Ripken and F Willeke Methods of Beam Optics DESY 88114 1988 c K Zhang PTC twiss with initial TWISS parameters JMAD X Meeting 13 04 07 2005 slides in d V A Lebedev and S A Bogacsz Betatron motion with coupling of horizontal and vertical degrees of motion Thomas Jefferson National Accelerator Facility 2010 See Also TWISS PTC_TWISS Examples V Kapin ITEP and F Schmidt March 2006 240 W
211. longer necessary HGAP half gap height of the associated SBEND TILT The roll angle about the longitudinal axis default 0 rad i e a horizontal bend A positive angle represents a clockwise rotation February 27 2005 111 MULTIPOLE General Thin Multipole label MULTIPOLE LRAD real TILT real BNLG 1 ee sety Kobe peepee PS A MULTIPOLE is a thin lens magnet of arbitrary order including a dipole e LRAD A fictitious length which was originally just used to compute synchrotron radiation effects A non zero LRAD in conjunction with the OPTION thin _foc set to a true logical value takes into account of the weak focussing of bending magnets TILT The roll angle about the longitudinal axis default 0 rad A positive angle represents a clockwise rotation of the multipole element Please note that contrary to MAD8 one has to specify the desired TILT angle otherwise it is taken as 0 rad We believe that the MAD8 concept of having individual TILT values for each component and on top with default values led to considerable confusion and allowed for excessive and unphysical freedom Instead in MAD X the KNL KSL components can be considered as the normal or skew multipole components of the magnet on the bench while the TILT attribute can be considered as an tilt alignment error in the machine KNL The normal multipole coefficients from order zero to the maximum the parameters are positional therefore zeros
212. losed orbit Particle coordinates are then given with respect to this new closed orbit unless the option onepass is used 217 ONEPASS If the option onepass is used no closed orbit is searched which also means that no stability test is done Use this option if you want to get the particles coordinates with respect to the reference orbit rather than the closed orbit Unfortunately the name is misleading but for backwards compatibility it is kept onepass does NOT restrict the tracking to one turn only APERTURE If the aperture option is applied the apertype and aperture information of each element in the sequence is used to check whether the particle is lost or not For further information on the definition of apertures and different aperture types see the documentation of the APERTURE module Incase no aperture information was specified for an element the following procedure will currently take place No aperture definition for element Default apertype aperture assigned currently this is apertype circle aperture 0 If tracking with aperture is used and an element with apertype circle AND aperture 0 is encountered then the first value of the maxaper vector is assigned as the circle s radius no permanent assignment See option for the default values Hence even if no aperture information is specified by the user for certain elements default values will be used RECLOSS Traditionally w
213. m The global reference orbitjof the accelerator is uniquely defined by the sequence of physical elements The local reference system x y s may thus be referred to a global Cartesian coordinate system X Y Z see Figure 1 The positions between beam elements are numbered 0 1 n The local reference system x Yi Si at position i i e the displacement and direction of the reference orbit with respect to the system X Y Z are defined by three displacements X Y Z and three angles Theta Phi Psi The above quantities are defined more precisely as follows X Displacement of the local origin in X direction Y Displacement of the local origin in Y direction Z Displacement of the local origin in Z direction THETA Angle of rotation azimuth about the global Y axis between the global Z axis and the projection of the reference orbit onto the Z X plane A positive angle THETA forms a right hand screw with the Y axis PHI Elevation angle i e the angle between the reference orbit and its projection onto the Z X plane A positive angle PHI correspond to increasing Y If only horizontal bends are present the reference orbit remains in the Z X plane In this case PHI is always zero PSI Roll angle about the local s axis i e the angle between the intersection x y and Z X planes and the local x axis A positive angle PSI forms a right hand screw with the s axis The angles THETA PHI PSI are n
214. m fh 0 0 where we see the n1 beta functions and the hardware symbolized by on_elem 540 560 580 Momentum offset By 600 620 0 00 640 Ivar Waarum 24 02 05 Mark Hayes 19 06 02 141 MAD X 2 12 22 11 04 11 31 18 yy 660 680 700 720 250 200 150 100 0 0 740 s m B m B m W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH SixTrack Produce input files for tracking in SixTrack In dynamic aperture studies SixTrack lis often used because of its speed and controllability However the input files are notoriously difficult to produce by hand This command may be used to produce SixTrack files from a sequence in MAD X s memory N B The files contain all information concerning optics field errors and misalignments Hence these should all be set and a TWISS SAVE command should always be issued beforehand The generation of the SixTrack input files is then done by the command SIXTRACK CAVALL MULT_AUTO_OFF MAX_MULT_ORD SPLIT APERTURE RADIUS ref radius of magnets The parameters are defined as CAVALL optional flag This puts a cavity element SixTrack identifier 12 with Volt Harmonic Number and Lag attributes at each location in the machine Since for large hadron machines the cavities are typically all located at one particular spot in the machine and since many cavities slow down the tracking simulations considera
215. madxp c madxu c moved aperture code from madxn c to new file aperture c corrections more apex in halo polygon corrected the construction of rectellipse in the general case secured potentially dangerous division by zero Avoid divisions by zero in the aperture module minor C inconsistencies and some clean up mad X_3_66 bugs found by EK Array overflow reported from valgrind removed Special non existing End marker has been dropped courtesy HG mpar made compiling three functions moved from matchc2 c to madxu c current in table_list initialized to 0 add warning when use_macro option is used with too many variables Introducing aptol_ 1 2 3 rtol xtol ytol to be available in MAD X input and e g to be added to a TWISS table Courtesy H G Now table2 x y or stable a b c or things like that will not be modified First step for node layout tracking in ptc_trackline fix a bug when you use a macro which define another macro for matching madX 3_03_48 Final fix of the TILT saga Tilt is calculated exclusively in twiss F following the strategy 0 These changes concern quad sext oct elec separator but NOT dipole or multipole 1 TILT input is the external tilt k 2 k amp ks represent an internal tilt 3 at each element the total tilt amp sqrt k 2 ks 2 is calculated including field errors i e the correct way which might cause differences with MAD8 4 PTC has been adjusted ap
216. mber of constraints Adding gino command following madx_ptc_script_module Suppressing imax in favor of calib request by Thys Risselada Adding node value kmax maximum K value and imax maximum Current value drop useless lcavity since ywcavity has same mad 8 element code Implemented 1 ptc_setfieldcomp that set any order field strengh to requested value It enables matching of higher order field components 294 2 Special matching mode use_ptcknob It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner For further details see the comments at the top of matchptcknobs c file 3 Minor corrections and protections against segmentation vilation PTC knobs pol_blocks almost completely interfaced to MAD X User sets a knob with ptc_knob command Twiss parameters and user specified with ptc_select map components are buffered in memory after every element in form of taylor series They can be dumped to text file in two formats with ptc_printparametric command They can be also visualized and further studied with rviewer from rplot plugin Further user can set numeric values of knobs with ptc_setknobvalue what updates all numeric values of the parameters in the tables This way knobs can be used in matching New tracking feature by Andres Gomez Alonso Using flag recloss in the tracking command creates a table called trackloss which keeps a record of lost particles
217. ments set format sequence The set command allows 2 actions 1 Format The first command lets you vary the output precision parameter format sl s2 s3 up to three strings defining the integer floating and string output format for the save show value and table output The formats can be given in any order and stay valid until replaced The defaults are Toa 18 10g 18s They follow the C convention The quotes are mandatory The allowed formats are nd for integer with n field width mnf or m ng or m ne for floating m field width n precision ns for string output The default is right adjusted a changes it to left adjusted Example set format 22 14e changes the current floating point format to 22 14e the other formats remain untouched set format s d g sets all formats to automatic adjustment according to C conventions 2 Sequence The second command lets you choose the current sequence without having to use the USE command which would bring you back to a bare lattice without errors The command only works if the chosen sequence had been activated before with the USE command otherwise a warning will be issued and MAD X will continue with the unmodified current sequence This command is particularly useful for commands that do not have the sequence as an argument like EMIT or IBS June 18 2003 102 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH
218. mmand The two options can be entered as MATCH sequence namel name2 name n BETAO beta0l1 beta02 beta0n or MATCH SEQUENCE sequence name X real ALFX real MUX real Y real ALFY real MUY real real PX real Y real PY real X real DY real DPX real DPY real ELTAP real ry ry oox ww gt Examples Example 1 163 CE LL SEQUE NCE al USE SAVEBE SERT SE QUE ERIOD P cel TA ABE TWISS USE SEQUE NCE PE MATCH CO NCE bini cell RIOD insert SEQUE CES aia 1 place e insert BETA0O bini STRAINT SEQ UENCE insert RANGE e MUX 9 345 MUY 9 876 This matches the sequence INSERT with initial conditions to a new phase advance The initial conditions are given by the periodic solution for the sequence CELL1 Example 2 USE PERIOD INSERT MATCH SEQUENCE insert CONSTRAINT SEQUENCE insert RANGE e MUX 9 345 MUY 9 876 This matches the beam line INSERT with periodic boundary conditions to a new phase advance The initial conditions can also be transmitted by a combination of a SAVEBETA command and explicit optic function specifications
219. mple showing the full power of macros is to be found under macro usage for the usage and under macro definition for the definition Beware of the following rules Generally speaking special constructs like IF WHILE MACRO will only allow one level of inclusion of another special construct Macros must not be called with numbers but with strings i e variable names in case of numerical values i e NOT exec thismacro 99 129 BUT nl 99 n2 219 exec thismacro nl1 n2 June 17 2002 73 EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Real life example for IF statements and MACRO usage Creates a footprint for head on parasitic collisions at IP1 5 of lhe 6 5 both lhcb1l for tracking and lhcb2 to define the beam beam elements i e weak strong are used there are flags to select head on left and right parasitic separately at all IPs The bunch spacing can be given in nanosec and automatically creates the beam beam interaction points at the correct positions It is important to set the correct BEAM parameters i e number of particles emittances bunch length energy For completeness all files needed by this job are copied to the local directory ldb The links to the the originals in offdb official database are commented out Option warn info echo System In fns afs cern ch eng sl MAD X dev test_suite foot V3 01 01 ldb l system
220. mrad RF power MW Megawatts Higher mode loss factor 40 V pc Table 1 Physical Units W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Command Format e Comments Identifiers or Label e Integer Attribute built from operator and A is evaluated every time it is used Constraint O Variable Name Wild Card Pattern May 8 2001 OO0O0000 41 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Statements and Comments Input for MAD X follows in broad lines the new MAD 9 format i e free format with commas as separators however outside enclosures blanks may be used as separators Blank input lines do not n affect program execution The input is not case sensitive except for strings enclosed in The input file consists of a sequence of commands also known as statements A statement may occupy any number of input lines It must be terminated by a semicolon except if it contains a block of statements itself like in if a lt 3 a b 2 b 2 b 4 Several statements may be placed on the same line When a or is found on an input line the remaining characters of the line are skipped A line starts a comment region it ends with a line The general format for a command is items enclosed in rep rep can be repeated any number of times including zero label keyword rep attribute rep It has three parts A is required for a de
221. must be filled in for components that do not exist Example of a thin lens sextupole ms multipole knl 0 0 k21 KSL The skew multipole coefficients from order zero to the maximum the parameters are positional therefore zeros must be filled in for components that do not exist Example of a thin lens skew octupole ms multipole ksl 0 0 0 k3sl1 Both KNL and KSL may be specified for the same multipole A multipole with no dipole component has no effect on the reference orbit i e the reference system at its exit is the same as at its entrance If it includes a dipole component it has the same effect on the reference orbit as a dipole with zero length and deflection angle KOL being the first component of KNL above Frank Schmidi August 28 2003 112 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Transverse Kicker The type TKICKER should be used to create horizontal vertical or combined transverse kickers physically equivalent to elements of type KICKER but not used by the closed orbit correction module see CORRECT command Examples of elements that may use the type TKICKER Fast kickers for injection dump amp tune Magnetic septa towards beam dump Dampers of transverse beam oscillations Undulator amp Wiggler magnets For further information on element type TKICKER and its attributes look at the documentation of the orbit corrector type KICKER madx team September 15 2011 113 W
222. n IP number print text bbipnnl2 beambeam sigx sqrt rnnipnnl2 gt betx epsx print text sigy sqrt rnnipnnl2 gt bety epsy print text xma rnnipnnl2 gt x yma rnnipnnl2 gt y print text charge on_honn print text bbipnnll beambeam sigx sqrt rnnipnnll gt betx epsx print text sigy sqrt rnnipnnll gt bety epsy print text xma rnnipnnll gt x yma rnnipnnll gt y print text charge on_honn print text bbipnn beambeam sigx sqrt rnnipnn gt betx epsx print text sigy sqrt rnnipnn gt bety epsy print text xma rnnipnn gt x yma rnnipnn gt y print text charge on_honn print text bbipnnrl beambeam sigx sqrt rnnipnnrl gt betx epsx print text sigy sqrt rnnipnnrl gt bety epsy print text xma rnnipnnrl gt x yma rnnipnnrl gt y print text charge on_honn print text bbipnnr2 beambeam sigx sqrt rnnipnnr2 gt betx epsx print text sigy sqrt rnnipnnr2 gt bety epsy print text xma rnnipnnr2 gt x yma rnnipnnr2 gt y print text charge on_honn mkho nn macro macro defining head on markers nn IP number print text mkipnnl2 bbmarker print text mkipnnll bbmarker print text mkipnn bbmarker print text mkipnnrl bbmarker print text mkipnnr2 bbmarker inho xx nn macro macro installing bb or markers for head on beam
223. n by the user is followed by obsnnnn observation point followed by pnnnn particle number Hence filenames look like track obs0001 p0001 Options Meaning Default Value Value Type PLACE name of the observation point 219 Remarks If no OBSERVE command is given but the dump option in the TRACK command is used the particles trajectory coordinates are still recorded The observation point is then the starting point of the sequence RUN maxaper double array turns integer ffile integer Description The actual tracking itself is launched by the RUN command Via the option turns the user can specify how many turns will be tracked Options Meaning Default Value Value Type upper limits for the six 0 1 0 01 0 1 0 01 1 0 double coordinates 0 1 array number of turns 1 interger periodicity for printing coordinates interger Remarks The limits defined by the maxaper option are only being taken into account if the aperture option of the TRACK command is used Remarks Plotting is possible in MAD X however it can also be done externally by using the files created by TRACK The following internal tables are created while tracking tracksumm trackloss and trackone or track obs pS SS depending on option onetable These internal tables can be accessed via the lrable access functions See Also February 2007 220 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Thick
224. n set explicitly Once it was set with EOPTION it is NOT reset to the default when the ADD option is omitted in subsequent calls to EOPTION Example EOPTION SEED 987456321 Werner Herr 18 6 2002 70 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Program Flow Statements IF if logical_expression statement 1 statement 2 statement n where logical_expression is one of exprl oper expr2 exprll operl exprl2 amp amp expr21 oper2 expr22 exprll operl exprl1l2 expr21 oper2 expr22 and oper one of equal not equal less than gt greater than less than or equal greater than or equal The expressions are arithmetic expressions of type real The statements in the curly brackets are executed if the logical expression is true ELSEIF elseif logical_expression statement 1 statement 2 statement n Only possible in any number behind an IF or another ELSEIF is executed if logical_expression is true and if none of the preceding IF or ELSEIF logical conditions was true ELSE else statement 1 statement 2 statement n Only possible once behind an IF or an ELSEIF is executed if logical_expression is true and if none of the preceding IF or ELSEIF logical conditions was true 71 For a real life example see ELSE example e WHILE while logical_condition statement 1 statement 2 statement n executes the statements in curly brackets while
225. nate system September 2010 17 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH BEAM Set Beam Parameters Many commands in MAD X require the setting of various quantities related to the beam in the machine Therefore which no MAD X will stop with a fatal error if an attempt is made to expand USE a sequence for BEAM command has been issued before The quantities are entered by a BEAM command BEAM PARTICLE name MASS real CHARGE real ENERGY real PC real GAMMA real EX real EXN real EY real EYN real ET real SIGT real SIGE real KBUNCH integer NPART real BCURRENT real BUNCHED logical RADIATE logical BV integer SEQUENCE name Warning BEAM updates i e it replaces attributes explicitely mentioned but does not return to default values for others To reset to beam value defaults use RESBEAM The particle restmass and charge are defined by PARTICLE The name of particles in the machine MAD knows the restmass and the charge for the following particles O O00 0 0 Therefore POSITRON The particles are positrons MASS m CHARGE 1 ELECTRON The particles are electrons MASS m CHARGE 1 PROTON The particles are protons MASS m CHARGE 1 ANTIPROTON The particles are anti protons MASS m CHARGE 1 POSMUON The particles are positive muons MASS m mu CHARGE 1 NEGMUON The particles are negative muons MASS m nu CHARGE 1 neit
226. nd twiss or normal Run a runtime created script that performs a standard matching all the user defined knobs are variables of this matching 8 Evaluate constraints expressions to get the matching function vector I 9 Add the matched values to TCVV 10 End PTC session run ptc_end 11 If the matched values are not close enough to zeroes then goto 3 12 Prepare PTC environment ptc_createuniverse ptc_createlayout 13 Set TCVV using ptc_setfieldcomp command please note that knobs are not set in this case 14 Run a PTC command twiss or normal NYDN BW 262 15 Evaluate constraints expressions to get the matching function vector ID 16 Evaluate a penalty function that compares matching function vectors I and ID See points 7 and 14 17 If the matching function vectors are not similar to each other within requested precision then goto 3 18 Print TCVV which are the matched values SYNOPSIS MATCH use_ptcknobs true PTC_VARYKNOB initial s none element s none kn i 1 ks ios Ll exactmatch l true true trustrange r 0 1 step r 0 0 lower r 1 e20 upper r 1 e20 END_MATCH For the user convenience the limits are specified in the MAD X units k1 k2 etc This also applies to dipolar field where the user must specify limits of kO angle path_lengh This guarantees concistency in treatment of normal and skew dipol components Important N
227. nd X and Y must be given in meters The magnet name must be identical to how it appears in the sequence The displacements are only valid for this particular magnet and cannot be assigned to a family of magnets n1 is calculated for a number of slices determinated by the number of Si 136 Layout of file magnet namel So X Y Si X Y Si X 4 Sn X Y magnet name2 So X Y Si xXx Y Si xXx Y Sn X Y etc Example of file This is the start of the file Comments are made with exclamation marks mb al4rl1l bl 0 0 0002 0 000004 7 15 1 4e 5 0 3e 3 14 3 0 0000000032 4e 6 further comments can of course be added mq 22r1l b1 0 0 3e 5 1 332e 4 1 033 0 00034 0 3e 9 2 066 0 0 00e 2 Biel 4 232e 4 0 00000003 This is the end of the file Offsetelem file syntax This file contains coordinates describing how certain elements are displaced w r t a given reference point in the machine It might be used with elements in insertions or other special purpose elements that has a magnet axis which does not coincide with the reference trajectory We operate with two coordinate system s x and s y where the reference point is the origin and the actual element axis is described as a parabola with coefficients A B and C For each element we give two sets of coefficients one for horizontal displacement and one for vertical X_offs s Ax s 2 Bx s Cx and Y_offs s Ay s 2 By s Cy The coordinate systems are in m
228. nd its energy gain is known This energy becomes the reference one for all the elements downstream of the cavity The particle is tracked further to the next cavity for which the procedure described above is repeated Parameters of the cavities are dumped to the file named twcavsettings txt At the end patches at the ends of the cavities are set so the parameters after them are calculated taking to the account reference energy increase The exact program behavior depends on the PTC switches settings Please note that in PTC phase velocity of a cavities wave is always equal to speed of light Hence if PTC internal state TIME is TRUE what is the most correct setting then voltage seen by a particle is varying along the structure If TIME is FALSE track is assumed to fly with speed of light and in such case a particle moves together with the wave front 234 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH PTC_TWISS Module Ripken Optics Parameters The PTC_TWISS module of MAD X fal is based on the PTC code It is a supplementary to the TWISS module The Twiss parameters are calculated in Ripken s style invented by G Ripken in 1970 31 and most accessible in Ref fbh These parameters were available in MAD8 using the TWISS3 command This module is a typical example of the advantages when using PTC and its Normal Form technique and of course the object oriented Fortran90 coding once the rather modest programming has been performed th
229. nd some code cosmetics Sodd table names usinf small letters only closing unit 34 to allow multiple SODD runs changing table entries to more logical names print out clean up Proper initialization of pointers to NULL s added function for deleting command_list structures string function tabstring count start at 1 courtesy Hans Grote New function exist courtesy Hans Grote Add a to the error message for a not found variable in the show command Error flag implemented that signals that error code occured If a user table is used by ptc_select then org_cols num_cols Otherwise all values are overwritten by add_vars_to_table function PTC_Enforce6D implemented table xx yy zz ingvar table xx yy zz madxsdds c Add SDDS module makethin c Fixing TILT in multipole kick and make TILT proper in thick octupole Courtesy HG Changing the conflicting ksl for the integrated solenoid strength to ksi This name is reserved for the vector of the integrated skew multipoles ksl Thick solenoid can now have normal knl and skew ksl multipole errors in PTC ignored in madx proper Thin solenoids are presently not considered in PTC matche c matchce2 c knobs better definition knobs file defines with Experimental knob file generation fix a bug when you use a macro which define another macro for matching Comment corrected Syntax error at 405 code lin
230. ndows Modification for c_tpsa_interface F90 Added new tpsa package Fixing the passing of a double array instead of an integer array Etienne s clean up of AF Fix C C nonstandard features fix pseudo bug in c_tpsa_interface F90 found by NAG f95 Integer shall not be defined as an array of dimension 1 Latest cleanup of Lingyun s TPSA including tpsa dll needed for Windows Clean up gfortran broken in gcc4 4 Therefore back to g95 however the LIBX flags must be fixed according to gcc being used Fix the exclusion of f90 amp F90 files with and without NTPSA Yet another upgrade for MAC using g95 Clean up for MAC Generalization for f90 F90 Compiler preprocessing for c_tpsa_interface to drop DLL for LINUX Add new tpsa missing fno range check flag for gfortran in particular for MAC Back to standard LF95 Further adjustments to safeguard running with gfortran which can be steered with the new SLC4 flag Fix further gfortran for SLC4 Default compiler oh lxplus 1f95 gfortran with Wall pedantic DEBUG flags even for Fortran gfortran explanation for SLC4 Darwin fixes 282 no ONLINE as standard More small fixes 04 off for 1f95 proper libraries for ONLINE Fix gfortran Home link use proper LINK options for MAC hbu using semi automatic object file list Makefile mac compatible jbj made more robust the capture of the Twiss data of the drift preceeding the current element solving the 1st slice wron
231. ne cavtousch for that ring The arguments have the following meaning FILE The name of the output file default touschek Example BEAM PARTICLE PROTON ENERGY 450 NPART 1 15e11 EX 7 82E 9 EY 7 82E 9 ET 5 302e 5 SIGE 7 164e 4 SIGT 0 1124 RADIATE TRUE USE PERIOD FODO 203 VRF 400 SELECT FLAG TWISS CLEAR TWISS CHROM TABLE FILE OUSCHEK FILE The first command defines the beam parameters It is essential that the longitudinal emittances and bunch length are set The command use selects the beam line or sequence The next command assign a value to the cavity rf voltage vrf example name The select clear previous assignments to the twiss module twiss calculates and saves the values of all twiss parameters for all elements in the ring the touschek command computes the Touschek lifetime and writes it to the file touschek default name The results are stored in the TOUSCHEK tables and can be written to a file with the default name touschek in the example above or values can be extracted from the table using the value command as follows value table touschek name table touschek s table touschek tli table touschek tliw table touschek tlitot where name denotes the name of a beamline element s the position of the center of the element tli the instanteneous Touschek loss rate within the element and tliw the instantaneous rate w
232. ngitudinal component of the vector potential to order 4 is A Bo 2 za B 3 27 y e Elet y4 B b 2 Say 2t y Bs Alet bety Taking curl A in curvilinear coordinates the field components can be computed as 31 Bz y Bil yt By aeng Jake B z y Bo By z hy Bay By 3 2 y Bey B Le Say o It can be easily verified that both curl B and div B are zero to the order of the B3 term Introducing the magnetic rigidity Brho the multipole coefficients are computed as K eB p B B rho June 17 2002 32 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Variables For each variable the physical units are listed in square brackets Canonical Variables Describing Orbits MAD uses the following canonical variables to describe the motion of particles X Horizontal position x of the closed orbit referred to the ideal orbit m PX Horizontal canonical momentum p of the closed orbit referred to the ideal orbit divided by the reference momentum PX p po 1 Y Vertical position y of the closed orbit referred to the ideal orbit m PY Vertical canonical momentum p of the closed orbit referred to the ideal orbit divided by the reference momentum PY p po 1 T Velocity of light times the negative time difference with respect to the reference particle T c t m A positive T means that t
233. ngth in one table including the element name DELETE delete sequence s_name table t_name deletes a sequence with name s_name or a table with name t_name from memory The sequence deletion is done without influence on other sequences that may have elements that were in the deleted sequence DUMPSEQU dumpsequ sequence s_name level integer Actually a debug statement but it may come handy at certain occasions Here s_name is the name of an expanded i e USEd sequence The amount of detail is controlled by level level 0 print only the cumulative node length sequence length a4 print all node element names except drifts gt 2 print all nodes with their attached parameters gt 2 print all nodes and their elements with all parameters EXEC exec label Each statement may be preceded by a label it is then stored and can be executed again with exec label any number of times the executed statement may be another exec etc however the major usage of this statement is the execution of a macro EXIT exit ends the program execution 95 FILL Every command fill table table adds a new line with the current values of all column variables into the user table beforehand This table one can then write in TFS format See as well the user tablelexample HELP help statement_name prints all parameters and their defaults of the statement given this includes basic element type
234. nitialization for 5D in twiss moments not available in 5D due to a bug and few others Removed charge setting to the my_ring layout to make ptc_twiss running redundant printouts removed Moments calculation fully imlemented map buffering in ptc_twiss Few bugs corrected f g map initialized to nd2 instead of npara when initial twiss provided Moments seem to work to be tested yet New ptc_twiss so A_ is tracked This makes possible tracking of moments to be completed wrap 90 needed changes to accept new madx_ptc_normal_module First step for node layout tracking in ptc_trackline Clean up Added feature that allows to set values of several knobs and only at the end recalculate values in tables Normally all tables are recalculated after setting a new value However it slows dows parametric matching New command ptc_refreshtable Updated match with knobs In addmoment t and delta swapped so the MADX input corresponds to the MADX nomenclature Moments calculation fully imlemented map buffering in ptc_twiss New ptc_twiss so A_ is tracked This makes possible tracking of moments to be completed Etienne s Gino stuff Adding gino command following madx_ptc_script_module Implemented 1 ptc_setfieldcomp that set any order field strengh to requested value It enables matching of higher order field components 2 Special matching mode use_ptcknob It implements kind of macro that emply
235. nly a range is selected use period lLhcbl range irl ir5 then s and e refer to the start and end of the expanded range of course Examples for ranges first element full expansion range from mb 5 to end first occurrence of element mq ir5 16 1 cvange s cange s e range mb 5 e vange mq ir5 16 1 CLASS The single name of a class no occurrence counts A class is the name of an element or basic type from which other elements have been derived Example mq quadrupole ql mq q2 mq ql a ql Gaagbrq2 makes classes from mq q1 and q2 Selection class mq will actually select q1 q2 ql a and q2 b in the above example June 17 2002 54 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Sectormap output The flag sectormap on the Twiss command together with an element selection via select flag sectormap causes a file sectormap to be written For each user selected element it contains the user selected coefficients of the kick vector K 6 values of the first order map R 6 x 6 values and of the second order map T 6 x 6 x 6 values The sector file is the output of a standard TFS table which means that the set of columns of interest may be selected through a MAD X command such as the following select flag my_sect_table column name pos k1 r11 r66 t111 Each line of the sectormap file contains for each selected element the set of chosen K R T matrix
236. ns can be specified the most important being dump deltap and aperture Inside the block TRACK ENDTRACK a series of initial trajectory coordinates can be specified by the START command as many commands as trajectories This will be usually done in a while loop Note that the coordinates are either canonical coordinates or action angle variables For usual tracking single multi turn all coordinates are specified with respect to the actual closed orbit possibly off momentum with magnet errors and NOT with respect to the reference orbit Ifthe option onepass is used the coordinates are specified with respect to the reference orbit The name onepass might be misleading Still tracking can be single or multi turn The tracking is actually started with the RUN command where the option turns defines for how many turns the particles will be tracked in the given sequence If the option dump is used the particle coordinates are written to files at each turn The 216 output files are named automatically The name given by the user is followed by obsnnnn observation point followed by pnnnn particle number Hence filenames look like track obs0001 p0001 Tracking is terminated by the command ENDTRACK Options Value Meaning Default Value Type relative momentum offset for reference closed orbit switched off for onepass oe double the sequence is treated as transfer line no FALSE stability test ie no closed orbi
237. nsertion IR8 with initial conditions to given values of the optics functions at the IP and the end of the insertion while limiting the maximum acceptable beta functions over the whole insertion IR8 insertion matching for beaml of the LHC with upper limits for all beta functions inside the insertion Simultaneous orbit matching at IP8 for beam1 and beam2 of the LHC Match simultaneously the orbit of beam1 and beam of the LHC at IP8 with initial conditions to the same given values at the IP 181 Orbit matching at IP8 for beaml and beam2 of the LHC IR8 beta squeeze for beam1 using JACOBIAN matching routine Try to find a beta squeeze for IR8 starting from 10 meters Beta squeeze for IR8 Mathching first and second order chromaticity of the LHC using USE_MACRO option Match simultaneously the first and second order chromaticity by defining macros which compute them using the TWISS command or PTC Second order chromaticity Mathching s position using VLENGTH flag match the positions of elements and the total sequence length for a simple sample sequence s position matching Mathching s position using USE_MACRO match the positions of elements and the total sequence length for a simple sample sequence using USE_MACRO s position matching Oliver Briining June 2002 Riccardo de Maria August 2007 182 Orbit Correction This chapter describes the commands which can be used to correct the closed orbit or a trajectory
238. nstandard features fix pseudo bug in c_tpsa_interface F90 found by NAG f95 Integer shall not be defined as an array of dimension 1 Latest cleanup of Lingyun s TPSA including tpsa dll needed for Windows Clean up gfortran broken in gcc4 4 Therefore back to g95 however the LIBX flags must be fixed according to gcc being used Fix the exclusion of f90 amp F90 files with and without NTPSA Yet another upgrade for MAC using g95 Clean up for MAC Generalization for f90 F90 Compiler preprocessing for c_tpsa_interface to drop DLL for LINUX Add new tpsa missing fno range check flag for gfortran in particular for MAC Back to standard LF95 Further adjustments to safeguard running with gfortran which can be steered with the new SLC4 flag Fix further gfortran for SLC4 285 Default compiler oh lxplus 1f95 gfortran with Wall pedantic DEBUG flags even for Fortran gfortran explanation for SLC4 Darwin fixes no ONLINE as standard More small fixes 04 off for 1f95 proper libraries for ONLINE Fix gfortran Home link use proper LINK options for MAC hbu using semi automatic object file list Makefile mac compatible jbj made more robust the capture of the Twiss data of the drift preceeding the current element solving the 1st slice wrong nl supressed the memory crash when aperture called twice with the same offsetlem in tfs format nougaret further prevent output mixup through forced flush when crossing the
239. nuary 24 1997 123 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Beam Line Sequences MAD X accepts two forms of an accelerator definition sequences and lines However the sequence definition is the only one used internally lines are converted into sequences when they are USEd Consequently only sequences can be saved written onto a file by MAD X The corresponding sequence of statements defining a sequence is name SEQUENCE REFER keyword REFPOS name LENGTH real label class AT real attributes class AT real sequ_name AT real ENDSEQUENCE where real means a real number variable or expression The first line gives the sequence name a REFER flag entry centre or exit which specifies at which part of the element its position along the beam line will be given default centre a REFPOS argument used for sequence insertion and the total length Inside the sequence endsequence bracket three types of commands may be placed an element declaration as usual with an additional at attribute giving the element position relative to the start of the sequence CAUTION an existing definition for an element with the same name will be replaced however defining the same element twice inside the same sequence results in a fatal error since a unique object this element would be placed at two different positions aclass name with a position this causes an instance of the
240. o ptc_create_universe such that these global parameters can be set early enough Internally in PTC the parameter lda_used is incremented where needed from 1500 to 3000 and set back Moreover Etienne has done the following modifications to make this possible The modification I made in the new PTC I sent you are as follows You first select SECTOR_NMUL and SECTOR_NMUL_MAX For all multipole lt SECTOR_NMUL then maxwell s is solved to order SECTOR_NMUL_MAX For multipole above SECTOR_NMUL they are treated a la Sixtrack So for example it you have errors to order 20 you may bother with maxwells only to order nmul 4 and nmul_max 10 as far as Maxwell s is concerned Multipole higher will be sixtrack multipoles Updated match with knobs Fix duml dum2 definition Missing declarations of duml and dum2 added Debugging a madxp Wrong sign of TILT when calculated from k amp KS b madx_ptc_module Total rewrite of TILT stuff Corrected state for 56D In 4D before setting in internal state only_4D we remove delta otherwise delta stays replacing asin by atan2 thereby fixing the sign for quad sext oct set my_ring charge 1 preliminary fix Removed charge setting to the my_ring layout to make ptc_twiss running redundant printouts removed Moments calculation fully imlemented map buffering in ptc_twiss Initialize mass pma and charge of MY_RING before set_madx New ptc_twiss so A_ is tracked This makes possible track
241. o the array In case the user requested an element to be stored in the paramteric format and column in the array of parametric results is reserved and the index of the column is remembered in index field of tablepush_poly type is filled In the other case this field is equal to zero The routine ptc_twiss defined in file madx_ptc_twiss f90 after tracking each of magnets in the sequence calls putusertable routine This routine loops over selected elemetns defined in the pushes table For each of them it extracts the requested element from the map using sub operator of PTC and stores it in the defined table and column If index field is not zero and any knob is defined it extracts the polynomial using par operator and stores it in the 2D array called results in the row corresponding to the number of the magnet or integration step and column defined by the index field 255 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH PTC_SELECT_MOMENT USER MANUAL SYNOPSIS PTC_SELECT_MOMENT table s none none column s none none moments s none moments i 0 parametric l false true Description Selects a moment to be a Stored in a user specified table and column b Stored as a function taylor series of if any is defined Than parametric switch should be set to true Both a and b can be joined in one command Examples ATF2 Command parameters and switches moment_s list of coma separat
242. ocussing of positively charged particles in the x s plane rotated by 45 around s particles in this plane have x y gt 0 TILT The roll angle about the longitudinal axis default 0 rad i e a normal quadrupole A positive angle represents a clockwise rotation A TILT pi 4 turns a positive normal quadrupole into a negative skew quadrupole Please note that contrary to MAD8 one has to specify the desired TILT angle otherwise it is taken as 0 rad This was needed to avoid the confusion in MAD8 about the actual meaning of the TILT attribute for various elements Note also that K K can be considered as the normal or skew quadrupole components of the magnet on the bench while the TILT attribute can be considered as an tilt alignment error in the machine In fact a positive K with a tilt 0 is equivalent to a positive K with positive tilt pi 4 Example OF QUADRUPOLE L 1 5 K1 0 001 The straight reference system for a quadrupole is a cartesian coordinate system August 28 2003 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Sextupole label SEXTUPOLE L real K2 real K2S real TILT real A SEXTUPOLE has four real attributes L The sextupole length default 0 m K2 The normal sextupole coefficient K3 1 B tho B x default 0 m 3 K2S The skew sextupole coefficient Kas 1 2 B rho 67B 3 x 0 B y where x y is now a coordinate system
243. ogical needs to be defined as logical 1p Several instances found updated latest head developements Updated to madX 3_02_16 bug corrected in madx_ptc_setcavs 90 Sh_def_kind 90 Adapting Makefiles for non linear matching and PTC upgrade PTC upgrade Proper Thin Lens Lattice PTC with dvds implemented in the travelling wave cavity The voltage is given by V V0 dvds z Updated to madX 3_02_16 bug corrected in madx_ptc_setcavs 90 Si_def_element 90 Adapting Makefiles for non linear matching and PTC upgrade PTC upgrade Proper Thin Lens Lattice PTC with dvds implemented in the travelling wave cavity The voltage is given by V V0 dvds z Updated to madX 3_02_16 bug corrected in madx_ptc_setcavs 90 Sk_link_list 90 Adapting Makefiles for non linear matching and PTC upgrade PTC upgrade Proper Thin Lens Lattice 1 Remove residual left over definition of double precision numbers Should all be in a_scratch_size f90 2 The logical needs to be defined as logical 1p Several instances found updated latest head developements S1_family 90 Adapting Makefiles for non linear matching and PTC upgrade PTC upgrade Proper Thin Lens Lattice 1 Remove residual left over definition of double precision numbers Should all be in a_scratch_size f90 2 The logical needs to be defined as logical 1p Several instances found updated latest head developements Updated to m
244. ollows via the ibs command The logical follow up of the MAD X commands is illustrated in the two examples provided with the IBS module Input of the beam parameters This section briefly describes the parameters which have to be present in the beam command in order to run the IBS module Type of particle The parameter particle is mandatory It can take one of the following three values proton electron or ion For proton and electron the parameter particle is the only one to be defined In case ion is used two additional parameters have to be defined namely mass which is typically the number of nucleons for the corresponding ion 158 multiplied by nmass the unified atomic mass unit 0 931494013 GeV c 2 and charge for the number of charges The energy The definition of the energy total kinetic total energy of the ions or energy per nucleon is a difficult one In the present approach the energy is the total energy of the particle For ions the expected input is the proton equivalent energy i e the total energy a proton would have when circulating in the defined machine As an illustration in the LHC protons will be injected with an energy of 450 GeV Consequently to evaluate the growth times for Lead ions at injection in the LHC one has to input energy 450 charge Therefore the above example of Lead at the LHC injection energy may look as follows in
245. olynomial in PTC nomenclature Its lengh should be equal to number of variables Each of digits corresponds to the exponent of a variable Monomial ijkImn defines x p J py l AT Ap p For example element 2 and monomial 1000000 defines coefficient of the second polynomial that defines px close to x in the other words it is R21 parametric logical default false if value explicitly not specified then true If it is true and any knobs are defined the map element is stored as the parametric result PROGRAMMERS MANUAL The command is implemented pro_ptc_select function in madxn c and by subroutine addpush in madx_ptc_knobs f90 that is part of madx_ptc_knobs_module On the very beginning the existance of the table and within column is checked In the case of failure error message is printed and the function is abandoned The command parameters are passed as the arguments of addpush Fortran routine A selection is stored in a type called tablepush_poly defined madx_ptc_knobs inc A newly created object is added to array named pushes More then one element might be stored in a single table so the module must assure that each of tables is augmented only ones for each magnet or integration slice For that purpose array of tables to be augmented named tables is stored separately and we assure that a table is listed here only ones This is simply done by checking if a table name is not already listed before adding a new element t
246. ons requires evaluation of expressions containing random functions These are evaluated like any other expression when the expression is used i e only once if a assignment refers to it or every time if the assignment is this latter case is used by the error generation routines 68 Example a 3 ranf Every time a is used it gets a random value assigned from a uniform distribution between 0 and 3 error ealign range dx sigma gauss All elements in range are assigned independent random displacements sampled from a Gaussian distribution with standard deviation sigma May 8 2001 69 EOPTION Set Error Options The random generator for MAD is taken from Knuth The error option command specifies different seeds for random values EOPTION SEED real ADD logical SEED Selects a particular sequence of random values A SEED value is an integer in the range 0 999999999 default 123456789 SEED alone continues with the current sequence See also SEED may be an expression e ADD If this logical flag is set an EALIGN or EFCOMP causes the errors to be added on top of existing ones If it is not set new errors overwrite any previous definitions The default value is TRUE if it is omitted in the EOPTION command The default value is false if no EOPTION command is used Please note a recent modification the default value for the ADD option is only applied as long as the ADD option has not bee
247. osition User Defined Matching Constraints In addition to the nominal TWISS variables the user can define a limited set of user defined variables in the constrint statement This allows for example the matching of the nromalized dispersion or the mechanical aperture The MATCH module allows four user defined variables called mvar1 mvar2 mvar3 and mvar4 The variables can be defined according to the general variable declaration rules of For example in order to match the normalized dispersion at a certain location in the sequence one would first define a variable mvarl table twiss dx sqrt table twiss betx After that the user has to select the variable for output in the TWISS statement see TWISS modulejand SELECT for more details on the TWISS module and SELECTION statements select flag twiss clear select flag twiss column keyword name s betx dx mvarl twiss sequence sequence name file twiss file The variable can now be referenced like any other TWISS variable in the constraint command constraint sequence sequence name range location mvarl target value Matching Weights The matching procedures try to fulfil the constraints in a least square sense A penalty function is constructed which is the sum of the squares of all errors each multiplied by the specified weight The larger the weight the more important a constraint becomes The weights are taken from a t
248. ot the Euler angles The reference orbit starts at the origin and points by default in the direction of the positive Z axis The initial local axes x y s coincide with the global axes X Y Z in this order The six quantities Xo Y0 Zo THETAg PHIo PSI thus all have zero initial values by default The program user may however specify different initial conditions Internally the displacement is described by a vector V and the orientation by a unitary matrix W The column vectors of W are the unit vectors spanning the local coordinate axes in the order x y s Vand W have the values xX Z where cos O0 sin 1 0 0 cosy siny 0 0 1 0 0 cosd sind B sind cosy 0 sin 0 cos 0 sing coso 0 0 1 The reference orbit should be closed and it should not be twisted This means that the displacement of the local reference system must be periodic with the revolution frequency of the accelerator while the position angles must be periodic modulo 2 pi with the revolution frequency If PSI is not periodic module 2 pi coupling effects are introduced When advancing through a beam element MAD computes V and W by the recurrence relations Vi Wi Ri Vig Wi wis Sj The vector R is the displacement and the matrix S is the rotation of the local reference system at the exit of the element i with respect to the entrance of the same element The values of R and S are listed in the straight reference system for ea
249. ote that inside the code skew magnets are represented only by normal component and tilt so the nominal skew component is always zero Inside PTC tilt can not become a knob while skew component can Remember about this fact when setting the limits of skew components in the matching When the final results are exported back to MAD X they are converted back to the normal state so the nominal skew compoment is zero and tilt and normal component are modified accordingly trustrange defines the range the expansion is trusted Description Example dog leg chicane 263 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH PTC_MOMENTS USER MANUAL SYNOPSIS PTC_MOMENTS no i 1 xdistr s gauss gauss ydistr s gauss gauss zdistr s gauss gauss Description Calculates moments previously selected with the ptc_select_moment command It uses maps saved by the ptc_twiss command hence the savemaps switch of ptc_twiss must be set to true default to be able to calculate moments Examples ATF2 Command parameters and switches no integer order of the calculation maximally twise the order of the last twiss xdistr ydistr zdistr string defining type of distribution for x y z dimension respectively 1 gauss Gaussian 2 flat5 flat distribution in the first of variables dp over p of a given dimension and Delta Dirac in the second one T 3 flatS6 flat rectangular distribution 264 W EURO
250. pken s style It operates on the working beam line defined in the latest USE command Several options can be specified the most important being icase deltap closed_orbit slice_magnets no and file table see the table below Other options should be specified for particular tasks Applications for the PTC_TWISS command are similar to the TWISS command The PTC_TWISS can be applied to two basic tasks It can calculate either alperiodical solutionjor a solution with initial conditions Options DELTAP CLOSED_ORBIT DELTAP_DEPENDENCY SLICE_MAGNETS CENTER_MAGNETS FILE TABLE SUMMARY FILE SUMMARY_TABLE INITIAL_MATRIX_TABLE INITIAL_MATRIX_MANUAL INITIAL_MAP_MANUAL RE11 RE66 BETAO betx alfx mux bety alfy muy dx dpx dy dpy X PX y py t pt Remarks ICASE It can be internally corrected by the code For example if RF cavity has the voltage set to zero and for icase 6 the code sets 4 237 Periodical Solution PTC_TWISS icase integer deltap double closed_orbit range string file string table string Description This is the simplest form of the PTC_TWISS command which computes the periodic solution for a specified beam line It may accept all basic options described in the above table Evaluation of Twiss parameters inside magnets PTC_TWISS icase integer deltap double closed_orbit slice_magnets range string file
251. propriate 5 Possible effects on survey and emit will be tested 6 Many Thanks for HG for his help Bug corrected replaced abs with fabs Updated match with knobs Constraints for ranges with match use_macro implemented Debugging a madxp Wrong sign of TILT when calculated from k amp KS b madx_ptc_module Total rewrite of TILT stuff tilt clean up coutesy HG Moments calculation fully imlemented map buffering in ptc_twiss New ptc_twiss so A_ is tracked This makes possible tracking of moments to be completed Introducing aptol_ 1 2 3 rtol xtol ytol to be available in MAD X gt ks for tilt lt 0 input and e g to be added to a TWISS table Courtesy H G Adding gino command following madx_ptc_script_module Problems 1 pt not displayed in table 2 deltap not in ptc_twiss header unless a twiss command was done before ptc_twiss Solution 1 Set up y properly 2 Put deltap into header of the ptc_twiss table permanently Fix routine readrematrix by exchanging x 5 and x 6 Fixing the plot crash the header is not read if it does not exist courtesy HG 1 Stefan Sorge new module keeper 2 Second order detuning with proper hor and ver names In fact vertical terms were missing 1 Bad memory bug found by RdM Piotr found using valgrind the solution in mymalloc read_table strlen aux_buff gt c 1 the 1 is essential because the character string has a 0 a
252. r Ol y r 0 Zz r 0 phi lE 0 theta r 0 onlyposition l false true onlyorientation l false true autoplacedownstream l true true refframe s gcs Description Places a given element at required position and orientation All rotations are made around the front face of the element Example postion of quads is matched to obtain required R566 value Command parameters and switches range string in range format Specifies name of the element to be moved X Y5Z real Coordinate of the front face of the magnet phi theta real 259 polar in xz plane around z axis and azimuthal around x axis angles respectively refframe string default gcs Defines the coordinate system with respect to which coordinates and angles are specified Possible values are gcs global coordinate system current current position previouselement end face of the previous element onlyposition logical default false if value explicitly not specified then true If true only translation are performed and orientation of the element is not changed onlyorientation logical default false if value explicitly not specified then true If true only rotations are performed and position of the element is not changed autoplacedownstream logical default true if true all the elements downstream are placed at default positions in respect to the moved element if false the rest of the layout stays untouche
253. r and upper limits for a quantity MAD accepts the following forms of constraints equality constraint name expression upper limit name lt expression lower limit name gt expression both upper and lower limit for the same name name lt expression name gt expression May 8 2001 89 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Variable Names A variable name can have one of the formats parameter name element name gt attribute name command name gt attribute name beam Ssequence name gt attribute name table table name The first format refers to the value of the global parameter parameter name the second and third formats refer to the real attribute attribute name of the element element name or the command command name NUmber four is specific to beams belonging to a particular sequence for details see sequences and beams Number five allows extraction of variables from existing tables as specified in table access May 8 2001 OO AUNE 90 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Regular Expressions Some commands allow selection of items via regular expression strings Such a pattern string must be enclosed in single or double quotes MAD X follows regexp Unix regular expression patterns for matching The following features are implemented A search string below is the string containing the pattern a target string is the string being searched for a pos
254. re well defined MadX expressions Other set of macro and constraints can be defined afterwards Examples The following example the USE_LMACRO mode can emulate a matching script which uses the normal syntax Normal syntax MATCH SEQUENCE LHCB1 LHCB2 VARY NAME KSF B1 STEP 0 00001 VARY NAME KSD Bl STEP 0 00001 VARY NAME KSF B2 STEP 0 00001 VARY NAME KSD B2 STEP 0 00001 GLOBAL SEQUENCE LHCB1 DQ1 QPRIME GLOBAL SEQUENCE LHCB1 DQ2 QPRIME GLOBAL SEQUENCE LHCB2 DQ1 QPRIME GLOBAL SEQUENCE LHCB2 DQ2 QPRIME LMDIF CALLS 10 TOLERANCE 1 0E 21 ENDMATCH USE_MACRO syntax MATCH USE_MACRO VARY NAME KSF B1 STEP 0 00001 VARY NAME KSD Bl STEP 0 00001 VARY NAME KSF B2 STEP 0 00001 VARY NAME KSD B2 STEP 0 00001 Ml MACRO TWISS SEQUENCE LHCB1 CONSTRAINT EXPR TABLE SUMM DQ1 QPRIME CONSTRAINT EXPR TABLE SUMM DQ2 QPRIME M2 MACRO TWISS SEQUENCE LHCB2 178 CONSTRAINT EXPR TABLI CONSTRAINT EXPR LMDIF CALLS 10 ENDMATCH TABLI E SUMM DQ1 OPRIM E SUMM DQ2 OPRIM eS ee TOLERA G E 1 0 E 2 1 Oliver Briining October 2003 Riccardo de Mariaj February 2006 179 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Matching E
255. rection term is computed and added to the relative error The correction term is parametrized as a 3rd order polynomial in the reference strength k according to Delta sum c ki yer f OPiS The coefficients c for the polynominal must be supplied in the command Two additional parameters and options are required HYSTER if it is set to 1 applies the correction term derived from the reference strength and the coefficients HCOEFEN and HCOEFFFS coefficients normal and skew for the computation of the correction term The 4 coefficients are specified in increasing order starting with the Oth order Each group of four coefficients is valid for one order of the field errors Trailing zeros can be omitted preceding zeros must be given Examples Example 1 assign relative errors to quadrupoles select flag error pattern q efcomp order 1 radius 0 010 dknr 0 4e 1 1le 1 2e 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 dksr 0 4e 1 1le 1 2e 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 r Ai t i dl Sadi al d a Ad e a A Example 2 add time memory effect to relative errors select flag error pattern q efcomp order 1 radius 0 020 hyster 1 hcoeffn 0 000 0 000 0 000 0 000 coefficients multipole order 0 0 001 0 000 0 000 0 000 coefficients multipole order 1 0 000 0 000 0 002 0 000 coefficients multipole order 2 dknr 0 1le 2 2e 4 4e 5 le 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 dksr 0 1le 2
256. ria February 2006 162 W7 EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Enter and Leave Matching Mode Before matching at least one SEQUENCE jmust be selected by means of a command The matching module can act on more than one sequence simultaneously by specifying more than one sequence when INITIATING the matching mode Initiating the Matching Module The match command can be either used for matching a periodic cell or for matching an insertion to another part of the machine Both matching modes are initiated by the MATCH command Cell matching In the first mode the matching routine is initiated only with one attribute specifying the sequence s the matching module will work on In this matching mode the periodicity of the optics functions is enforced at the beginning and end of the selected range MATCH SEQUENCE namel name2 nema n Insertion matching In the second mode called insertion matching the matching routine is initiated with two attributes one specifying the sequence s the matching module will work on and one specifying the initial conditions of the optic functions for each sequence In this case the initial values are assumed as exact Specification of Initial Values The initial values of the optical functions for the insertion matching can either be specified in form of a SAVEBETA command or by explicitly stating the individual optic function values after the MATCH co
257. rictions IF 1 ne 0 are removed gt bug correction always using eternal states instead of current ones Drop useless make_states call in my_state if requested dimensionality 6 and there are cavities enforce dalta and only_4d to false Fixing division by l zero in the multipole block f icase 6 then only_4d false Reduntant debug printouts present only in debug mode Fine tuning debug print out Fixing eigen print out the screw up was due to 5D versus 6D Clean up New matching with macros that enables fitting of non linear parameters with PTC output of eigen have proper row column swap from pt t to t pt Fix the i2 variable bug of eigen in equaltwiss found Piotr thanks bugs in subr SUMM_MULTIPOLES INTENT INOUT for key amp normal_0123 initialized eigenvector calculation in ptc_twiss 6D eign in ptc_normal 1 Adding eigenvectors to ptc_normal 2 Suppress debug printing to unit 18 19 remove bug division by zero due to dipole errors Finishing multipoles in thick elements Multipoles and Errors of any order are added to thick elements for MADX PTC only 1 State time is default and can be set in create_layout 2 C routines that write or read from TFS tables only operate with double precision numbers This will ensure a proper operation when PTC is calculating in four fold precision Merged with version MAD X 3 02 29 Updated to head bug corrected in equaltwiss compilation problem
258. rmats ommand and Statement Format ommand Attribute omments oan constrain ONSTRAIN ONSTRAINT User ontrol Statements onventions onversion to Sixtrack Input Format onversion to Thin Lens Q 4 oordinate Transformations OPTION Global Correction Options ORRECT Correction commands and parameters create Q Q lt Q a tr eclarations eferred exressions Define Variable Parameter DELET Descriptor Lines Dipedge Elemen DRIFT Drift Space Drift space DUMPSEQU Dynap Module ssl fea ae gt Q Z es COLLIMATOR Elliptic Collimator diting Element Definitions FCOMP Components lectrostatic separator ti element class lement Input Format mim tes mj in Nn es LSE example LSEIF ti 268 ve mit Module NDEDI NDMATCH NERGY nter and Leave Matching Mode OPTION Set Error Options PRINT List Machine Imperfections rror Assignment Module SAVE Save Machine Imperfections xample TFS Twiss table es tH xpression xpression Matching with USE MACRO XTRAC Hmmm EE WO es 7 Q an ui 3 a 1 m ootprint example PP PTC Documentation Given Matrix PTC global parameter Q lt to Q T lt Q n cj Q oO Q n a Nn G QIQ TH fagi fes Eye T o Olla gt SH J gt 4 Ale Ells s Ne WE WQS JAPE IS aE A la ARE oO 3 4 S zi Nn HELP z lt O Z j O ve ae S N 5
259. rotated by 30 around s with respect to the normal one default 0 m 3 A positive skew sextupole strength implies defocussing of positively charged particles in the x s plane rotated by 30 around s particles in this plane have x gt 0 y gt 0 TILT The roll angle about the longitudinal axis default 0 rad i e a normal sextupole A positive angle represents a clockwise rotation A TILT pi 6 turns a positive normal sextupole into a negative skew sextupole Please note that contrary to MADS one has to specify the desired TILT angle otherwise it is taken as 0 rad This was needed to avoid the confusion in MAD8 about the actual meaning of the TILT attribute for various elements Note also that K K gt can be considered as the normal or skew sextupole components of the magnet on the bench while the TILT attribute can be considered as an tilt alignment error in the machine In fact a positive K with a tilt 0 is equivalent to a positive K2 with positive tilt pi 6 Example S The straight reference system for a sextupole is a cartesian coordinate system August 28 2003 S EXTUPOLE L 0 4 K2 0 00134 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Octupole label OCTUPOLE L real K3 real K3S real TILT real An OCTUPOLE has four real attributes L The octupole length default 0 m K3 The normal octupole coefficient K3 1 B tho 6 B dx default 0 m 4 K3S The s
260. run TIME The wall clock time of the MAD X run TYPE The type of the table e g TWISS Additional descriptors exist in the as well as the Track tables June 17 2002 200 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Twiss TFS file header The format of the twiss table is best illustrated with an TFS file example It should be mentioned that MAD X allows to access parameters from twiss and other tables using the table access function June 17 2002 201 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Column Formats The column formats used are listed in the TFS columns table Table 1Column Formats used in TFS Tables C format Meaning C format hd Short integer 8d le Long float 18 10g ks String of length k 18s Table 1Column Formats used in TFS Tables Control lines begin with the TFS control character followed by a blank Data lines begin with two blanks Columns are also separated by one blank character The column width is chosen such as to accommodate the large of the column name and the data values of the column June 17 2002 202 W7 EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH TOUSCHEK Touschek Lifetime and Scattering Rates The TOUSCHEK module computes the Touschek lifetime and the scattering rates around a lepton or hadron storage ring based on the formalism of Piwinski A Piwinski The Touschek Effect in Strong Focusing Storage Rings
261. s OPTION option flag true false option flag flag sets an option as given in flag the part in curly brackets is optional if only the name of the option is given then the option will be set true see second line a sign preceding the name sets it to false Example option echo true option echo are identical ditto option echo false option echo The available options are name default meaning if true bborbit false the closed orbit is modified by beam beam kicks sympl false all element matrices are symplectified in Twiss echo true echoes the input on the standard output file trace false prints the system time after each command verify false issues a warning if an undefined variable is used warn true issues warnings info true issues informations tell false prints the current value of all options reset false resets all options to their defaults rbarc true converts the RBEND straight length into the arc length thin_foc true if false suppresses the 1 rho 2 focusing of thin dipoles no_fatal_stop false Prevents madx from stopping in case of a fatal error Use at your own risk The option rbarc is implemented for backwards compatibility with MAD 8 up to version 8 23 06 included in this version the RBEND length was just taken as the arc length of an SBEND with 96 inclined pole faces contrary to the MAD 8 manual PRINT print text prints the text to the current output f
262. s Overview of MAD X Tracking Modules y gt es S hysical Elements and Markers hysical Units place LOTcommand Plug ins for MAD X extensions lac fac Sie ojo ojo aj a ere ayo Dn Dn oR e cic onic OVO 5 y gt pa Q J 271 amp POW OH roy roy ro feiss Q Q j delle ILLS gt 7 Q TC Introduction TC Auxiliary Commands TC_CREATE_UNIVERSE and PTC_CREATE_LAYOUT commands TC_DumpMaps TC_EPlacement TC_KNOB html TC_NORMAL html TC_OBSERVE command TC_PrintFrames htm TC_SELECT html TC_SELECT_MOMENT html TC_SetCavities html TC_SetKnobValue html TC_SETSWITCH command TC Set up Parameters TC_START J J J TC_TRACK TC_TRACK_LINE uad RADIATION PTC Random Generators Range selection RBEND Rectangular Bending Magnet rbend reference system RCOLLIMATOR Rectangular Collimator READTABL real attribute tr real expression References REFLEC REMOV REPLAC EREE zo ES Z2 s 272 alaaa ZAA Alls Olle Ui 5 3 co nN e RESBEAM RESPLO RETU RFCAVITY Ripken Optics Parameters PTC_TWISS RPLO Z savebeta AVE with SELECT sbend reference system BEND Sector Bending Magne sector ben et sectormap selec segedi equence editing NAAN N N n I oO oO ies 2 oll 5 P e DH tH ETCAVITIES PTC setplo extupole lt Fg to X Simplex Minimisation Nn
263. s not needed by SixTrack but may be used as input to SODD For a full description of these files see SixTrack and for information on running SixTrack see Environment Mark Hayes 20 06 02 143 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH MAKETHIN Slice a sequence into thin lenses This module converts a sequence with thick elements into one composed entirely of thin elemtens as required by the default MAD X tracking Slicing is done by the MAKETHIN command MAKETHIN SEQUENCE sequence name STYLE slicing style The parameters are defined as SEQUENCE chooses the sequence you wish to slice STYLE optional chooses the slicing style The options are O SIMPLE this is a simplified slicing algorithm which produces any number of equal strength slices at equidistant positions with the kick in the middle of each slice COLLIM this is the default slicing for collimators If only one slice is chosen it is placed in the middle of the old element If two slices are chosen they are placed at either end Three slices or more are treated as one slice O TEAPOT default this is the standard slicing as used by MAD9 N B This has a maximum of four slices for any one object By default all elements are converted to one thin element positioned at the center of the thick element To get a greater slicing for certain elements use a standard SELECT command with FLAG MAKETHIN and CLASS RANGE or PATTERN
264. s pol_blocks almost completely interfaced to MAD X User sets a knob with ptc_knob command Twiss parameters and user specified with ptc_select map components are buffered in memory after every element in form of taylor series The problem with table and tabstring replacement was correctly stated only in this case did simple string replacement take place bad implememtation my mistake It has been corrected the files concerned are madxd h madxp c and madxu h in hansg public tmp Now table2 x y or stable a b c or things like that will not be modified In new_command_parameter_list pointer array of parameters initized with NULLs Write only long in TFS tables string function tabstring count start at 1 courtesy Hans Grote Now alos ptc_normal accepted in matching with ptcknobs bug corrections Implemented 1 ptc_setfieldcomp that set any order field strengh to requested value It enables matching of higher order field components 2 Special matching mode use_ptcknob It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner For further details see the comments at the top of matchptcknobs c file 3 Minor corrections and protections against segmentation vilation Implemented Problem 1 Macro names and clashes with internal names OK mycrap xx yy zz macro ingvar table xx yy ZZ somenamesarelong xx yy zz macro ingvar table xx yy zz
265. s function with 3 entries table x z N_row accesses the value of the named table column z at the N_row number of rows of table x row numbers start at 1 example table twiss betx 370 returns the beta_x at row number 370 of the Twiss table twiss The return value is zero if N_row is outside of the allowed range Note that N_row has to be a number and not a variable However the Macro facilityjin MAD X allows one to use a variable instead A typical example could look like this in fact the square root of betx user defined variable myvar is added to the twiss table myvar sqrt table twiss betx select flag twiss column name s myvar betx twiss file 65 Or another arbitrary test case of adding k11 taken from the Twiss table Define macro mycrap xx yy ZZ macro myval table xx yy Zz Use macro in loop i 0 incval 0 while i lt 100 value i exec mycrap twiss k1l1l i incval incval myval value i myval incval i i 1 Features as of Version 3_03_ 50 FILL TABLE t ROW n fill a table row with the present variable values If ROW is negative or missing a new row is created If ROW is greater than the number of rows the last row is selected without creating a new row SETVARS TABLE t ROW n set variables according to the column names of the given table and the values of the given row if ROW is negative missing or greater than the number of rows the last row is
266. s parametric PTC calculations to perform matching in a faster manner For further details see the comments at the top of matchptcknobs c file 3 Minor corrections and protections against segmentation violation PTC knobs pol_blocks almost completely interfaced to MAD X User sets a knob with ptc_knob command Twiss parameters and user specified with ptc_select map components are buffered in memory after every element in form of taylor series They can be dumped to text file in two formats with ptc_printparametric command They can be also visualized and further studied with rviewer from rplot plugin Further user can set numeric values of knobs with ptc_setknobvalue what updates all numeric values of the parameters in the tables This way knobs can be used in matching knobs implemented with PTC with pol_blocks command to dump parametric results to file or stdout content of ptc_madx_tablepush 90 moved to ptc_madx_knobs 90 the former one removed Sceleton for knobs and arbitrary element placement implemented Lattice visualization via ROOT macro Printing detailed lattice geometry in PTC Several small bug corrections and some code cosmetics PTC_Enforce6D implemented PTC proper Sa_extend_poly f90 Sb_sagan_pol_arbitrary f 90 Sc_euclidean 90 Sd_frame f90 Se_status 90 Sf_def_all_kinds 90 Sh_def_kind 90 Si_def_element 90 Si_def_element 90 Sj_elements 90 Sk_link_list 90 Sl_family f 90 Sm_
267. s possible to track the lattice functions starting with the periodic solution for another beam line If this is desired the TWISS command takes the form TWISS DELTAP real value LINE beam line MUX real MUY real TABLE table_name No other attributes should appear in the command For each value of DELTAP MAD X first searches for the periodic solution for the beam line mentioned in LINE beam line The result is used as an initial condition for the lattice function tracking Example CELL LINE INSERT LINE USE period INSERT TWISS LINE CELL DELTAP 0 0 0 003 0 001 CHROM FILE For four values of DELTAP the following happens First MAD X finds the periodic solution for the beam line CELL Then it uses this solution as initial conditions for tracking the lattice functions of the beam line CELL Output is also written on the file TWISS If any of the beam lines was defined with formal arguments actual arguments must be provided CELL SF SD LINE INSERT X LINE USE period INSERT TWISS LINE CELL SF1 SD1 Given Initial Values Initial values for and may also be numerical Initial values can be specified on the TWISS command All initial values for and chromatic functions are permitted but BETX and BETY are required Moreover a beta0 block can be added as filled by the lsavebetalcommand or see below The lattice parameters are taken from this block but will be overwritten by explicitly stated
268. s reflected together with the outer sub line S Replaceable Arguments A beam line definition may contain a formal argument list consisting of labels separated by commas and enclosed in parentheses Such a line can be expanded for different values of its arguments When this line is referred to its label must be followed by a list of actual arguments separated by commas and enclosed in parentheses These arguments must be beam line or element names The number of actual arguments must agree with the number of formal arguments All occurrences of a formal argument on the right hand side of the line definition are replaced by the corresponding actual argument Example Se line a b c 1 x y line d x e 3 y 14f line S lm2s line res line ae 1m2s Proceeding step by step this example generates the expansion da fr Eptp iy ey Op Oy ar cy Dypa eC Dp Gy Cp bare Op Sy Cy Dra Second example cel sf sd line qf d sf d b d qd d sd d b d arc line cel sf1 sdl1 cel sf2 sd2 cel sfl1l sdl use period arc This example generates the expansion 1 Replace the line CEL and its formal arguments qf d sf1 d b d qd d sdl d b d qf d sf2 d b d qd d sd2 d b d qf d sf1 d b d qd d sdl d b q 2 Omit parentheses gf d sf1 d b d qd d sdl d b d gf d sf2 d b d qd d sd2 d b d gf d sf1 d b d qd d sdl d b d Warning Line Depreciation MADX has been devolopped using sequences in fact internally the
269. s to a file one can use SELECT FLAG ERROR FULL ESAVE FILE err file Please note in case of field errors the absolute errors are saved and not relative errors Setting errors from a table or file To assign errors from a file is not a priori straightforward It may be required to re assign existing errors after a USE command was executed which deletes all errors attached to a sequence Errors stored in the form of an internal table errtab can be directly attached to the appropriate positions in the sequence with the command SETERR TABLE errtab The table errtab can be generated internally or from an external file errfile with the generic command READMYTABLE The command sequence READMYTABLE file errfile table errtab SETERR TABLE errtab reads the file errfile into the table errtab and the command SETERR attaches the errors to the elements in the active sequence The file errfile can be produced by a preceding ESAVE command or any other utility It should follow the format of a file generated with ESAVE see example program Please note 1 To assign correctly the errors from the file to the elements in the sequence all elements must have individual names otherwise an identification is not possible Elements in the file not identified in the active sequence are ignored 2 Errors are assigned to ALL elements found in the file and the FLAG ERROR
270. se all characters are converted to lower at reading On the other hand strings that do not contain blanks do not need to be enclosed in quotes Example call file my file call file my file call file MY FILE call file MY FILE call file MY FILE In the first three cases MAD X will try to read a file my file in the last two it will try to read MY FILE May 8 2001 61 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Logical Attributes Many commands in MAD require the setting of logical values flags to represent the on off state of an option A logical value flag can be set in two ways flag flag true It can be reset by flag flag false Example option echo switch off copying the input to the standard output The default for a logical flag is normally false but can be found e g for options by the command help option May 8 2001 62 EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Integer Attributes An integer attribute usually denotes a count Example myline line 3 a b c In this case a litteral integer is requested however in the following rfc rfcavity harmon 12345 or rfc rfcavity harmon num num may be an integer variable a real variable or an expression in the two latter cases the value is truncated May 8 2001 63 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Real Expressions To facilitate the definition of interdependent quantities an
271. setswitch C function in file madxn c It call an appropriate routines of the Fortran module to set each of the switches ptc_setdebuglevel ptc_setaccel_method ptc_setexactmis ptc_setradiation ptc_settotalpath ptc_settime ptc_setfringe 233 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH PTC_SetCavities 90 routine that adjusts cavities and sets appropriate reference momenta for a layout containing traveling wave cavities PROGRAMMERS MANUAL CAUTION For the time being cavities MUST not be placed one after another and at least a marker must be inserted between two neighboring accelerating structures Otherwise program will stop with the error message Description This routine sets up the properties of a layout and traveling wave cavities The main goal is to update reference beam energy for the elements that follow a traveling wave cavity It traces the synchronous particle i e one that has all its parameters set to zero at the beginning of the layout under study At the point it arrives to a cavity the parameters of the latter one are adjusted according to the switches defined by the user There are 2 cases 1 Leaves all parameters untouched 2 Phase of cavity is adjusted so it gives the maximum acceleration Afterwards to the calculated phase the lag is added This setting is acquired using set_switch command setting maxaccel parameter to true Afterwards the synchronous particle is tracked through traveling wave cavity a
272. sible match with the pattern e at the start of the search string Match following search string at the start of the target string otherwise the search string can start anywhere in the target string To search for a genuine anywhere use e at the end of the search string Match preceding search string at the end of the target string otherwise the search string can end anywhere in the target string To search for a genuine anywhere use e Stands for an arbitrary character to search for a genuine use xyz Stands for one character belonging to the string contained in brackets example abc means one of a b c a ex z Stands for ranges of characters example a zA Z means any letter Axyz i e a as first character in a square bracket Stands for exclusion of all characters in the list i e 4a z means any character but a lower case letter Allows zero or more repetitions of the preceding character either specified directly or from a list examples a means zero or more occurrences of a A Z means zero or more upper case letters backslash c e g Removes the special meaning of character c All other characters stand for themselves Example select flag twiss pattern d select flag twiss pattern k qd r1S The first command selects all elements whose names have exactly three characters and begin with the lett
273. sion label SOLENOID L 0 KS real KSI real thin version A SOLENOID has two three real attributes L The length of the solenoid default 0 m KS The solenoid strength K default 0 rad m For positive KS and positive particle charge the solenoid field points in the direction of increasing s KSI The solenoid integrated strength K L default 0 rad This additional attribute is needed only when using the thin solenoid where L 0 KNL amp KSL Take note that one can specify multipole coefficients but they have no effect in MAD X proper but are used for solenoids with multipoles in PTC Example SOLO SOLENOID L 2 KS 0 001 THINSOLO SOLENOID L 0 KS 0 001 KSI 0 002 The straight reference system for a solenoid is a cartesian coordinate system January 27 1977 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH CRAB Cavity label CRABCAVITY L real VOLT real LAG real FREQ real rvl integer rv2 integer rv3 integer rv4 integer rphi integer rph2 integer lagf real An CRABCAVITY has ten real attributes and seven integer attributes L The length of the cavity default 0 m VOLT The peak RF voltage default 0 MV The effect of the cavity is delta px VOLT sin t delta E VOLT x cos t where 6 sin 2 m LAG HARMON f LAG The initial phase lag 2pi default 0 FREQ The frequency MH
274. sitic on 0 for off on_hol 1 ho_charge ho_charge depends on split on_ho2 0 ho_charge because of the by hand splitting on_ho5 1 ho_charge on_ho8 0 ho_charge set CHARGE in the parasitic beam beam elements set 1 for parasitic on 0 for off on_lr1l 1 on_lrir 1 on_lr21 0 on_lr2r 0 on_lr5l 1 on_lr5r 1 on_lr81l 0 on_lr8r 0 1 1 define markers and savebetas assign echo temp bb install te TOT if on_hol lt gt 0 exec mkho 1 exec sbhomk 1 if on Iriri lt gt 0 on lrir lt gt 0 n 1 counter while n lt npara_1 76 exec mk1 1 n exec sbl 1 n n n 1 if on_lrlr lt gt 0 on_lrll lt gt 0 n 1 counter while n lt npara_1 exec mkr 1 n exec sbr 1 n n n 1 r 2S po if on_ho5 lt gt 0 exec mkho 5 exec sbhomk 5 if on_lr5l lt gt 0 on_lr5r lt gt 0 n 1 counter while n lt npara_5 exec mk1 5 n exec sbl 5 n n n 1 if on_lr5r lt gt 0 con Lr51 lt gt 0 n 1 counter while n lt npara_5 exec mkr 5 n exec sbr 5 n n n 1 se e192 if on_ho2 lt gt 0 exec mkho 2 exec sbhomk 2 if on_lr21 lt gt 0 on_lr2r lt gt 0 n 1 counter while n lt npara_2 exec mk1 2 n exec sbl 2 n n n 1 77 if on_lr2r lt gt
275. ssions To initialize the MAD X random generator use the table access functions Wom table x z accesses value of the named table column z of table x example table summ q1 returns the hor tune of the Twiss summary table summ table x y z accesses value of the named table column z for element y first table row with that name of table x example table twiss mb 12 betx returns the beta_x at element mb 12 from the Twiss table twiss When the element is called with its proper name as in the example above the value is returned at the first occurrence of the element of this name If the value is needed at a occurrence number NNN then NNN has to be appended to the name e g in the above example one obtains the betx of the 23th occurrence of the element mb 12 by changing the example to table twiss mb 12 23 betx Mind you that the old but little known form table twiss mb 12 gt 23 betx continues to work Lastly if NNN exceeds the maximum occurrence number the return value is arbitrarily small Beware Unnamed Drifts are not included in the table name database so as to speed up the search for real elements Therefore those unnamed drifts cannot be found However named drifts can be searched for Due to the importance of finding elements in the table for a proper functioning of the MAD X runs the programs throws a fatal_error if an element cannot be found in the table There is a second option of thi
276. st example but the beta functions are interchanged overwritten 06 Apr 2003 Revised in February 2007 208 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH PTC Set up Parameters The E Forest s Polymorphic Tracking Code is a kick code allowing a symplectic integration through all accelerator elements giving the user full control over the precision number of steps and integration type and exactness full or extended Hamiltonian of the results The degree of exactness is determined by the user and the speed of his computer The main advantage is that the code is inherently based on the map formalism and provides users with all associated tools The PTC code is actually a library that can be used in many different ways to create an actual module that calculates some property of interest Several modules using the PTC code have been presently implemented in MAD X These MADX PTC modules bl are executed by the following commands To perform calculations with these MADX PTC commands the PTC environment must be initialized handled and turned off by the special commands within the MAD X input script Synopsis PTC_CREATE_UNIVERSE sector_nmul_max integer sector_nmul integer ntpsa logical symprint logical PTC_CREATE_LAYOUT time logical model integer method integer nst integer exact logical offset_deltap double errors_out logical magnet_name string resplit logical thin double xbend double even logical
277. string table string Description This computes the periodic solution for a specified beam line and evaluates the Twiss parameters at each thin slice a k a integration node inside magnets The number of such integration nodes is given by the number of steps nst selected when creating the PTC layout All other basic options described in the above table may be selected Example An example is found in the PTC_TWISS Examples repository Solution with Initial Conditions Code Logic IF initial_matrix_table ON AND amp the map table exists THEN from a Map Tablel ELSEIF initial_map_manual ON THEN from a Given Map File ELSEIF initial_matrix_manual ON THEN from a Given Matrix ELSEIF BETAO block ON THEN from Twiss Parameters via BETAO block ELSE from Given Twiss Parameters ENDIF Initial Values from a Map Table obtainable by a preceding PTC_NORMAL command PTC_TWISS icase integer deltap double closed_orbit range string file string table string initial_matrix_table 238 Description PTC_TWISS calculates a solution with initial conditions given as a map table of preceding ring or beam line It requires the input option initial_matrix_table and an existence of the map table in memory which was generated by a preceding IPTC_NORMAL command Example An example is found in the PTC_TWISS Examples in the folder Initial Values from a Map File obtainable by a prece
278. t 0 on_1lr21 lt gt 0 n 1 counter while n lt npara_2 exec inr mk 2 n n n 1 ip8 if on_ho8 lt gt 0 79 exec inho mk 8 if on_lr81 lt gt 0 on_lr8r lt gt 0 n 1 counter while n lt npara_8 exec inl mk 8 n n n 1 if on_lr8r lt gt 0 on_lr81 lt gt 0 n 1 counter while n lt npara_8 exec inr mk 8 n n n 1 assign echo terminal seqedit sequence lLhcb2 call file temp bb install endedit system rm temp bb install 1 1 get beta functions at bb in all four IPs use period lhcb2 select flag twiss class bbmarker column name S X Y twiss sequence lhcb2 file separation for halo collisions at IP2 on_sep2 2 118 sqrt epsx r2ip2 gt betx 0 0007999979093 value on_sep2 1 define bb elements assign echo temp bb install Less apd if on_hol lt gt 0 exec bbho 1 if ton lrir lt gt 0 n 1 counter while n lt npara_1 exec bbl 1 n n n 1 if on_lrir lt gt 0 n 1 counter while n lt npara_1 80 exec bbr 1 n n n 1 Pese ip5 if on_ho5 lt gt 0 exec bbho 5 if on_lr5l lt gt 0 n 1 counter while n lt npara_5 exec bb1 5 n n n 1 if on_lr5r lt gt 0 n 1 counter while n lt npara_5 exec bbr 5 n n n 1 ip2 if
279. t 2 71 mo mb at 2 799200e4 mb mb at 2 955800e mo mb at 3 112400e4 bph bph gf 4 qf 4 mscbh mscbh cbh 4 cbh 4 mb mb at 3 333800e1 mo mb at 3 490400e4 mb mb at 3 647000e1 at 3 2231 at 2 182050e 02 at 2 264600e 02 at 2 421200e 02 at 2 577800e 02 at 2 663000e 02 at 2 688500e 02 11150e 02 16650e 02 02 02 02 at 3 197600e 02 LO0e 02 at 3 245750e 02 at 3 251250e 02 02 02 02 bpv bpv qd 4 qd 4 at 3 732200e 02 at 3 757700e 02 mscbv mscbv cbhv 4 cbhv 4 mb mb at 3 868400e1 mo mb at 4 025000e14 mo mb at 4 181600e1 bph bph Gf Of 9 mscbh mscbh cbh 5 cbh 5 mo mb at 4 403000e14 mo mb at 4 559600e4 mo mb at 4 716200e4 at 4 3 at 3 780350e 02 at 3 785850e 02 02 02 02 at 4 266800e 02 at 4 292300e 02 L4950e 02 at 4 320450e 02 02 02 02 bpv bpv qd 5 qd 5 at 4 801400e 02 at 4 826900e 02 mscbv mscbv chv 5 cbv 5 mb mb at 4 937600e1 mb mb at 5 094200e1 at 4 849550e 02 at 4 855050e 02 02 FOZ mb mb bph bph end marker endsequence at 5 250800e 02 at 5 336000e 02 at 5 346000e 02 51 forces and other constants l bpm 3 bang 509998807401le 2 kqf 872651312e 2 kqd 872777242e 2 ks 0198492943 ksd 039621283 acbvl 1 e 4 acbhl 1 e 4 save sequence fivecell file mad8 s table twiss bpv 5 betx myvar
280. t search closed orbit search ee introduce synchrotron damping needs RF FALSE no cavity RADIATE in BEAM damping logical introduce quantum excitation via random QUANTUM number generator and tables for photon emission FALSE no ous logical excitation write the particle coordinates in files names FALSE no file SUE generated automatically generated logical particle is lost if its trajectory is outside the FALSE no aperture of the current element aperture check FALSE one file per particle APERTURE logical ONETABLE write all particle coordinates in a single file logical create a table named trackloss in memory RECLOSS with lost particles coordinates FALSE no table logical FILE name for the track table track trackone string FALSE no update UPDATE parameter update per turn string Remarks IMPORTANT If an RF cavity has a no zero voltage synchrotron oscillations are automatically included If tracking with constant momentum is desired then the voltage of the RF cavities has to be set to zero If an RF cavity has a no zero voltage and DELTAP is non zero tracking is done with synchrotron oscillations around an off momentum closed orbit DELTAP Defining a non zero deltap results in a change of the beam momentum energy without changing the magnetic properties in the sequence This leads to a new closed orbit the off momentum c
281. t the end 2 In plot there is still the crash when reading the header temporary solution applied Fix the headvalue routine which stumbled over a blank line courtesy HG First step for node layout tracking in ptc_trackline Adding a C routine to read headers of TFS tables courtesy HG Taking deltap from table header both for TWISS and ptc_twiss but NOT in case of a SUMM table and place on the plot Move the set_variable routine from madxn c to madxu c Needed to compile mpars new setvar command fixed readtable bug Removed redundant debug printout Exact name matching implemented now passing name with x VORNAME assigned the same as name of node in MADX but with capital letters Updated match with knobs Constraints for ranges with match use_macro implemented Adding el e2 hl h2 hgap fint fintx to the twiss table Removed charge setting to the my_ring layout to make ptc_twiss running redundant printouts removed Moments calculation fully imlemented map buffering in ptc_twiss Few bugs corrected f g map initialized to nd2 instead of npara when initial twiss provided Moments seem to work to be tested yet 292 New ptc_twiss so A_ is tracked This makes possible tracking of moments to be completed Not enough memory for buffers gt FODO LINE 36 CELL failed when cell was a line itself clean up of gino Adding gino command following madx_ptc_script_module PTC knob
282. tal axis table name of the table to be plotted from default twiss If it is track the data to be plotted are taken from the tracking files generated for each required particle as defined by the attribute particle The name of this file has the following format file name as defined by the attribute trackfile the observation point fixed to 1 and the particle number e g testtrack obs0001 p0003 If the required file has not been generated by the previous MAD X command track no plot is done for that particle The plot is obtained through the gnuplot package N B the previous track command should contain the attribute dump The tracking plots appends the plots to an existing file specified via filename appended by ps The user should make sure that this file does not exist before starting a MAD X run particle one or several numbers associated to the tracked particles for which the specified plot has to be displayed multiple logical default false If true all the curves generated for each tracked particle are put on one plot Otherwise there will be one plot for each particle title plot title string if absent the last overall title is used if no such overall title as well the sequence name is used range horizontal plot range given by elements file_name start of the file name for the Postscript file s Only the first occurrence of such a name will be used Default is madx or madx_track if the table attribute is track Dependin
283. tandard as before 2 flattop or trapezoidal 3 hollow parabolic width for bbshape 2 fractional width of edge region for bbshape fractional width of the parabolic part Changing the conflicting ksl for the integrated solenoid strength to ksi This name is reserved for the vector of the integrated skew multipoles ksl Thick solenoid can now have normal knl and skew ksl multipole errors in PTC ignored in madx proper Thin solenoids are presently not considered in PTC user2_photon 90 unnused dummy variable DMASS in subr photon is removed util F Added seterrorflag routine that sets the error flag in c part if an error occured FORTRAN Include Files plot fi touschek fi twiss0 fi twissc fi win32calls fi Clean up of fi files Momentum compaction alfa included into TWISS table for matching Add polarity parameter to the twiss table Adding node value kmax maximum K value and imax maximum Current value Throw out unused variables Cleaned code so NAG warnings are minimized now mainly unused variables Fortran Clean Up madx_ptc_distrib inc New ptc_twiss so A_ is tracked This makes possible tracking of moments to be completed madx_ptc_knobs inc Bug Corrected Parametric twiss results where not scaled with energy Moments calculation fully imlemented map buffering in ptc_twiss New ptc_twiss so A_ is tracked This makes possible tracking of moments to be comple
284. te of the j th coordinate in phase space whereas Tijk stands for combined effect on the i th coordinate of both the j th and k th coordinates in phase space along the lattice The maps are the accumulated maps between the selected elements They contain both the alignment and field errors present Together with the starting value of the closed orbit which can be obtained from the standard twiss file this allows the user to track particles over larger sectors rather than element per element A typical usage therefore lies in the interface to other programs such as TRAIN May 8 2001 57 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Variable Declarations In the following means that the variable at the left receives the current value of the expression at right but does not depend on it any further whereas makes it depend on this expression i e every time the expression changes the variable is re evaluated except for const variables var expression var expression real var expression identical real var expression to above int var expression truncated if expression is real int var expression const var expression const var expression const real var expression identical const real var expression to above const int var expression truncated if expression is real const int var expression May 8 2001 58 W EUROPEAN ORGANIZATION FOR NUCLEAR R
285. ted Implemented 1 ptc_setfieldcomp that set any order field strengh to requested value It enables matching of higher order field components 2 Special matching mode use_ptcknob It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner For further details see the comments at the top of matchptcknobs c file 3 Minor corrections and protections against segmentation vilation knobs implemented with PTC with pol_blocks command to dump parametric results to file or stdout content of ptc_madx_tablepush 90 moved to ptc_madx_knobs 90 the former one removed madx_ptc_distrib 90 Moving from DAmap to Gmap Fortran Clean Up Moments updated initialization for 5D in twiss moments not available in 5D due to a bug and few others Removed charge setting to the my_ring layout to make ptc_twiss running redundant printouts removed Moments calculation fully imlemented map buffering in ptc_twiss Few bugs corrected f g map initialized to nd2 instead of npara when initial twiss provided Moments seem to work to be tested yet New ptc_twiss so A_ is tracked This makes possible tracking of moments to be completed madx_ptc_eplacement 90 Root display support for new elements serious memory leak removed Added sextupoles octupoles and not powered elements Corrected RBEND drawing Set of kinds added to drawing in root In root macro generation adde
286. tep in thintracking_ptc txt file Storage of parameters in a table for each step might be very memory consuming To switch it off use tableallsteps Collective effects can be taken to the account only using this mode this feature of PTC is not interfaced into MAD X Instructs the code to store track parameters in Global Coordinate System normally it starts at the entrance phase of the first element 229 Description This MAD X command performs ray tracking that takes to the account acceleration in traveling wave cavities It must be invoked in the scope of correctly initialized i e after PTC_CREATE_UNIVERSE and PTC_CREATE_LAYOUT commands hind before corresponding All tracks that are spawned with ommands beforehand PTC_TRACKLINE command is issued are tracked Track parameters are dumped at every defined observation point see PTC_OBSERVE command Please note that MAD X always creates observation point at the end of a sequence Depending on value of onetable switch all output information is stored in one table and also file or in one table per track per observation point is written if the switch is false The user must note that track parameters plotting see is only possible if onetable switch is set to false status as for Feb 2006 This unfortunate solution is the legacy of the regular MAD X track command that is designed for circular machines where the user usually tracks a few particles for many turns rather then many particles
287. the logical_expression is true A simple example in case you have forgotten the first ten factorials would be option info otherwise you get redifiniton warnings n 1 m 1 while n lt 10 m m n value m n n 1 For a real life example see WHILE example e MACRO label macro statement 1 statement 2 statement n label argl argn macro statement 1 statement 2 statement n The first form allows the execution of a group of statements via a single command exec label will execute the statements in curly brackets exactly once This command can be issued any number of times The second form allows to replace strings anywhere inside the statements in curly brackets by other strings or integer numbers prior to execution This is a powerful construct and should be handled with care Simple example option echo info otherwise the output is somewhat confusing simple xx yy macro XX yy 2 xx value xx a 3 b 5 exec simple a b Somewhat more tricky a in front of an argument means that the truncated integer value of this argument is used for replacement rather than the argument string itself 72 tricky xx yy zz macro mzz yy xx l l yy kzz k yy n 0 while n lt 3 n ntl exec tricky quadrupole n 1 exec tricky sextupole n 2 j Whereas the actual use of the preceding example is NOT recommended a real life exa
288. the value the knob is set to 249 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH PTC_KNOB USER MANUAL SYNOPSIS PTC_KNOB elementname kn i ks i exactmatch l true true Description Sets knobs in PTC calculations currently ony in PTC_TWISS PTC_NORMAL will follow Knobs appear as the additional parameters of the phase space Twiss functions are then obtained as functions of these parameters taylor series Also map elements might Example postion of quads is matched to obtain required R566 value Command parameters and switches elementname string in range format Specifies name of the element containing the knob s to be set kn ks list of integers Defines which order exactmatch logical default true if value explicitly not specified then true Normally a knob is a property of a single element in a layout The specified name must match 1 1 to an element name This is the case when exactmatch is true 250 Knobs might be alos set to all family of elements In such case the exactmatch switch must be false Filed components of all the elements that name starts with the name specified by the user become a single knob 251 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH PTC_PRINTFRAMES USER MANUAL SYNOPSIS PTC_PRINTFRAMES file s none format s text Description Print to a specified file PTC geometry of a layout Example ith some elements displaced wit
289. tinue if the no_fatal_stop flag enforces program continuation Harmon no longer ignored courtesy HG Fix lethal bug in DELETE command courtesy HG suppress forbidden TAB character reorganize twbtin more logically 287 The chromatic functions wx phix wy phiy could not be initialized properly for lines simplifying length fix proper fix of doubling of the length of the machine with chrom amp centre suppress double length in summ table for chrom amp currpos option preparation for SLC5 in 32 amp 64 bits nougaret Compute derivatives of the dispersion w r t deltap to scale from 32 to 64 bits platforms obtain pointers size with sizeof uintptr_t one turn parameters such as the tune should now depend on deltap merged Frank and Piotr s modifications skowron Removed one line from generated ROOT macros for plotting since the ROOT command disapeared in the new versions protection against seg fault in case the command is executed before ptc_create_universe Bug in knobs corrected Twiss table was extended definitions for new new columns were added in ptc_madx_knobs inc but the code was not modified apropriately and uninitialized univ taylors were left in the results array Swapped putusertable with puttwisstable so we values from the user table are copied properly to the twiss table if requested See ptc_secordmatch example in the testsuite With modern versions of ROOT libraries were splitted to more files Updat
290. tions provided by the user on imput PTC_Enforce6D implemented If 6D TWISS calculation is performed with initial conditions beta0 block then non zero betz is required Fix writing 5 5 components of closed_orbit to twiss table Bug corrected writing maps should not be only in debug mode madx_ptc_normal f90 Pulled out the stuff for the ptc_normal module since madx_ptc_module is already very large madx_ptc_script 90 Adding gino command following madx_ptc_script_module madx_ptc_setcavs 90 Cleaned code so NAG warnings are minimized now mainly unused variables RF cavity treated as TW cavity now bug correction temporary fix of non existing cav21 member RF cavity treated as TW cavity now Error flag implemented that signals that error code occured madx_ptc_tablepush 90 knobs implemented with PTC with pol_blocks command to dump parametric results to file or stdout content of ptc_madx_tablepush f 90 moved to ptc_madx_knobs 90 the former one removed Sceleton for knobs and arbitrary element placement implemented Lattice visualization via ROOT macro Printing detailed lattice geometry in PTC Several small bug corrections and some code cosmetics Proper handling of 6D 5th column and row are swapped with 6th ones Bug corrected Added support for 6D case 5th column and row is swapped with the 6th one then debug level 9 removed completely madx_ptc_track_run f90 unnused dummy var
291. tknobvalue what updates all numeric values of the parameters in the tables This way knobs can be used in matching Severe bug in knobs corrected attempt to delete not properly assocoated taylors in case no knobs are set by the user knobs implemented with PTC with pol_blocks command to dump parametric results to file or stdout content of ptc_madx_tablepush f 90 moved to ptc_madx_knobs 90 the former one removed Corrected twiss with parameters Sceleton for knobs and arbitrary element placement implemented Lattice visualization via ROOT macro Printing detailed lattice geometry in PTC Several small bug corrections and some code cosmetics Introducing TRUERBEND and WEDGRBEND in PTC To this end 2 flags have been introduced in the NAD X dictionary madxdict h 1 pterbend if true it uses a PTC type RBEND 2 truerbend if true it uses TRUERBEND if false it uses WEDGRBEND logical lp gt 4 and vice versa so NAG does not cry problem causing compiler warning removed open and close of unit 21 only for getdebug gt 2 Error flag implemented that signals that error code occured Changing the conflicting ksl for the integrated solenoid strength to ksi This name is reserved for the vector of the integrated skew multipoles ksl Thick solenoid can now have normal knl and skew ksl multipole errors in PTC ignored in madx proper Thin solenoids are presently not considered in PTC Check of initial condi
292. tly not specified then true Switch saying to set cavities phases so the reference orbit is always on the crest i e gains max energy exact_mis logical default false true if value explicitly specified Switch ensures exact misalignment treatment totalpath logical default false true if value explicitly specified 232 If true the 6th variable of PTC i e 5th of MAD X is the total path If false it is deviation from the reference particle which is normally the closed orbit for closed layouts radiation logical default false if value explicitly not specified then true Sets the radiation switch internal state of PTC fringe logical default false true if value explicitly specified Sets the fringe switch internal state of PTC If true the influence of the fringe fields is evaluated for all the elements Please note that currently fringe fields are always taken to the account for some elements f g traveling wave cavities even if this flag is set to false The more detailed list of the elements will be provided later when the situation in this matter will be definitely settled time logical default true if value explicitly not specified then true If true Selects time of flight rather than path length cT to be precise as the 6th variable of PTC i e Sth of MAD X PROGRAMMERS MANUAL Values of the switches are stored in Fortran 90 module mad_ptc_intstate mad_ptc_intstate f90 The command is processed by pro_ptc_
293. to choose which columns to print in the output file Column names name nl nlx_m nly_m apertype aper_1 aper_2 aper_3 aper_4 rtol xtol ytol s betx bety dx dy x y on_ap on_elem spec nl is the maximum beam size in sigma while n1x_m and nly_m is the n1 values in si units in the x and y direction aper_ means for all apertypes but racetrack aper_1 half width rectangle aper_2 half heigth rectangle aper_3 half horizontal axis ellipse or radius if circle aper_4 half vertical axis ellipse For racetrack the aperture parameters will have the same meaning as the tolerances aper_1 and xtol horizontal displacement of radial part aper_2 and ytol vertical displacement of radial part aper_3 and rtol radius aper_4 not used On_elem indicates whether the node is an element or a drift and on_ap whether it has a valid aperture The Twiss parameters are the interpolated values used for aperture computation When one wants to plot the aperture the table aperture parameter is necessary The normal line of hardware symbols along the top is not compatible with the aperture table so it is best to include noline Plot instead the column on_elem along the vaxis to have a simple picture of the hardware Spec can be used for giving a limit value for n1 to have something to compare with on the plot This example provides a plot 140 30 nl onelem 20 15 10 V6 5 IR2 mb al4rl bI jnb al7r1 bl onele
294. tracking 90 Sma_multiparticle 90 Sn_mad_like 90 So_fitting f 90 Sp_keywords 90 Spb_fake_gino_sub 90 Sq_orbit_ptc 90 Sqa_beam_beam_ptc 90 Sqb_accel_ptc 90 Sr_spin 90 St_pointers f90 Changes PTC May 2007 VORNAME assigned the same as name of node in MADX but with capital letters Fixing the crash for sbend exact multipoles larger than 10 This set up requires to solve Maxwell s equation up to SECTOR_NMUL_MAX The default is set to 10 to avoid excessive computing time This is now safeguarded in madxp To this end the parameters SECTOR_NMUL and SECTOR_NMUL_MAX are transfered from ptc_create_layout to ptc_create_universe such that these global parameters can be set early enough Internally in PTC the parameter lda_used is incremented where needed from 1500 to 3000 and set back Moreover Etienne has done the following modifications to make this possible The modification I made in the new PTC I sent you are as follows You first select SECTOR_NMUL and SECTOR_NMUL_MAX For all multipole lt SECTOR_NMUL then maxwell s is solved to order SECTOR_NMUL_MAX For multipole above SECTOR_NMUL they are treated a la Sixtrack So for example it you have errors to order 20 you may bother with maxwells only to order nmul 4 and nmul_max 10 as far as Maxwell s is concerned Multipole higher will be sixtrack multipoles New PTC 2007 PTC with crash security 300 First BB PTC version includ
295. ts A beam beam element requires the particle energy ENERGY and the particle charge CHARGE as well as the number of particles per bunch NPART to be set by aIBEAM command before any calculations are performed Examples of a four dimensional beam beam element definition Collider regime example beam particle positron npart 1 e12 energy 50 0 bb beambeam Sigx 1 3 Sigy 5 4 charge 1 Electron cooler example gamma0 1 032 relativistic factors beta0 sqrt 1 0 1 0 gamm0 gamma0 i_e 0 2 electron current re_cool 0 01 electron beam radius 1_cool 5 0 cooling length i nelect i_e l_cool beta0 clight qelect electron number in e cooler beam particle antiproton gamma gamma0 npart nelect bb_ecool beambeam sigx re_cool sigy re_cool bbshape 2 width 0 01 charge 1 bbdir 1 For the definition of the LHC head on and parasitic beam beam elements see ssorge July 13 2007 120 MATRIX Arbitrary Element label MATRIX TYPE name L real KICK1l real KICK6 real RM11 real RM66 real TM111 real TM666 real The MATRIX permits the definition of an arbitrary transfer matrix It has four real array attributes L Length of the element which may be zero KICKi Defines the kick of the element acting on the six phase space coordinates RMik Defines the linear transfer matrix 6 6 of the element TMik1 Defines the second order terms 6 6 6 of the element Data values not entere
296. ts The options used in the CORRECT command are FLAG FLAG can be ring or line either a circular machine or a trajectory is corrected Default flag is ring MODE MODE defines the method to be used for corrections Available modes are LSQ MICADO and SVD The first performs a least squares minimization using all available correctors The mode SVD uses a Singular Value Decomposition to compute a correction using all available correctors The latter can also be used to condition the response matrix for the modes LSQ or MICADO using COND 1 It is highly recommended to precede a LSQ correction by aS VD conditioning set COND 1 The mode MICADO is a best kick algorithm Naive use or using it with a large number of correctors see option NCORR can give unexpected results To avoid the creation of local bumps it is recommended to precede a MICADO correction by a SVD conditioning set COND 1 Default mode is MICADO PLANE If this attribute is x only the horizontal correction is made if it is y only the vertical correction is made This differs from the MAD8 implementation Default plane is horizontal COND When COND is 1 a Singular Value Decomposition is performed and the response matrix CONDitioned to avoid linearly dependent correctors This can be used to avoid creation of artificial bumps during a LSQ or MICADO correction requires some computing time Please note this option is not robust since it depends on parameters whi
297. ts or particular components of the eigenvectors can be selected with eign or eignij respectively j number of eigenvector i number of coordinate x p y Py t P For ring lattices PTC_TWISS computes momentum compaction transition energy as well as other one turn characteristics such as the tunes Q1 Q2 and if icase 6 with cavity Qs and chromaticities for no gt 2 Synopsis PTC_CREATE_UNIVERSE PTC_CREATE_LAYOUT model integer method integer nst integer exact SELECT flag ptc_twiss clear SELECT flag ptc_twiss column name s betall beta33 alfall alfa33 gamall gama33 betallp beta33p alfallp alfa33p gamallp gama33p mul MUS displ disp4 displp disp4p displp2 disp4p2 displp3 disp4p3 eign eignll eignl6 eign6l eign66 PTC_END Commands PTC_TWISS icase integer deltap double closed_orbit slice_magnets range string file string table string initial_matrix_table initial_matrix_manual initial_map_manual beta0 string betx double alfx double mux double bety double alfy double muy double dx double dpx double dy double dpy double x double px double y double py double t double pt double rel1 double re12 double re16 double 236 re61 double re62 double re66 double Description The PTC_TWISS command causes computation of the Twiss parameters in the Ri
298. ual value of all its parameters STOP stop ends the program execution SYSTEM system transfers the string in quotes to the system for execution Example system 1n s afs cern ch user u user public some directory short TABSTRING tabstring argl arg2 arg3 The string function tabstring arg1 arg2 arg3 with exactly three arguments arg1 is a table name string arg2 is a column name string arg3 is a row number integer count starts at 0 The function can be used in any context where a string appears in case there is no match it returns _void_ 100 TITLE title NG inserts the string in quotes as title in various tables and plots USE use period s_name range range expands the sequence with name s_name or a part of it as specified in the range VALUE value expl exp2 prints the actual values of the expressions given Example a clight 1000 value a pmass exp sqrt 2 results in a 299792 458 pmass 0 938271998 exp sqrt 2 4 113250379 A o WRITE write table table file file_name writes the table table onto the file file_name only the rows and columns of a preceding select flag table are written If no select has been issued for this table the file will only contain the header If the FILE argument is omitted the table is written to standard output June 17 2002 101 W EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH Set State
299. uble precision numbers Should all be in a_scratch_size f90 2 The logical needs to be de ned as logical lp Several instances found updated latest head developements wrap 90 clean up 1 Remove residual left over definition of double precision numbers Should all be in a_scratch_size f90 al needs to be defined as logical lp Several instances found updated latest head developements MAD X version 3 02 14 12 04 2006 1 PIC modules have been cleaned up and are all documented by now 2 New PTC_TRACK_LINE for tracking lines including acceleration written and maintained by Piotr Skowronski 3 Numerous bug fixes and clean ups All changes for each file Makefile Reverting to the previous version Temporal work around implemented there is some problem with internal state settings in setcaenforcing preparing to merge with the recent HEAD hoping that the problem was alread solved over there new match mode developemen Makefile_develop new match mode Makefile_gab file Makefile_gdb was initially added on branch newmatch Temporal work around implemented there is some problem with internal state tings in setcaenforcing preparing to merge with the recent HEAD velopements hoping that the problem was alread solved over there Dependences corrected so it can be made with j N option new match mode Sh_def_kind 90 So_fitting 90 a_scratch_s
300. ublic statements which creates pseudo bugs More clean up for the TPSA upgrade Fortran Clean up indenting remove potentially uninitialized variable and also remove unused variables Minor clean up concerning character strings possibly uninitialized variables and unused variables 277 ONLINE needs libmdblib a libmdbmth a librpnlib a libSDDS1 a libSDDSIc a libz a SLC5 needed libX11 a MAD X production version 4 00 19 version madX 4_00_18_dev Version 4 00 17 add LRAD to kickers Version 4 00 16 Version 4 00 15 MAD X version 4 00 14 MAD X version madX 4_00_12 dev version madX 4_00_12_dev version madX 4_00_11_dev version 4 00 10 version Add attribute range_plot to allow range also for user defined horizontal axis courtesy HG Allowing plotting at markers using the marker_plot attribute Courtesy HG Add ntpsa flag if present the new C TPSA package by lingyun yang gmail com in invoked and the symprint flag pronts the symplecticity flag by default Remove harmless occurrence dipole_bv by the more obvious one other_bv remove tabs Clean up unused variables Take out Unused external reference RESULT_FROM_ NORMAL found with latest NAG Fortran Compiler Release 5 2 668 Minor clean up Get the compiler directives like ifdef _WIN32_DLL working in F90 files using the Lahey compiler Special Fujitsi flags for 1f95 invoked e g 1f95 c o1 tp lfe Cpp Ife D_WIN32_DLL FPP c_tpsa_interface F90
301. upling since it is plain wrong First MAD X LHC commissioning version 3 04 09 07 2007 1 All eading and writing of SDDS data sets for th the LHC control system t of medium size and smaller code changes commun velopment for CLIC purposes matching method Non linear and parametric matching inconsistencies and some clean up atized variables 291 corrected the construction of rectellipse in the general case secured potentially dangerous division by zero c t c The brute force quick and dirty fix of frs has been reverted for a proper fixing at the source of the problem IE assigning different names for different multipoles It has been shown that SixTrack gives identical results for the brute force and the proper solution Courtesy Hans Grote honorable ABP group member Fixing the problem of using the same name for very different multipoles This is a quick fix and a more rigorous solution is needed R E COLLIMATORs were treated as thick elements in the single element list but later treated as thin elements leading to skrewed up linear optics in SixTrack They are kept as distinct elements and are not joined with surrounding drifts gxxllc c gxxllpsc c Fix the month number in the ps files madxc c Added commands to allow reading of external orbit files Correct read_my_table for long data elements madxe c compiler warnings removed Changed default behaviour of ADD option madxn c
302. ussing quadrupoles and the skewed quadrupoles MQF QUADRUPOLE L LQM K1 KQD Focussing quadrupoles MQD QUADRUPOLE L LOM K1 KQOF Defocussing quadrupoles MOT QUADRUPOLE L LOQT Skewed quadrupoles These classes can be thought of as new keywords which define elements with specified default attributes We now use theses classes to define the real quadrupoles QD1 MQD Defocussing quadrupoles QD2 MQD QD3 MQD QF1 MQF Focussing quadrupoles QF2 MQF QF3 MOF QT1 M T K1S KQT1 Skewed quadrupoles T2 QT K1S KQT2 These quadrupoles inherit all unspecified attributes from their class This allows to build up a hierarchy of objects with a rather economic input structure The full power of the class concept is revealed when object classes are used to select instances of elements for various purposes Example select flag twiss class QUADRUPOLE Select all quadrupoles for the Twiss TFS file More formally for each element keyword MAD maintains a class of elements with the same name A defined element becomes itself a class which can be used to define new objects which will become members of this class A new object inherits all attributes from its class but its definition may override some of those values by new ones All class and object names can be used in range selections providing a powerful mechanism to specify positions for matching constraints and printing Ja
303. ut on table CORRECT PLANE x MODE Isq CLIST corr out MLIST mon out Example 4 correct orbit in horizontal plane use alignment and scaling errors 15 of orbit correctors faulty CORRECT PLANE x MONERROR 1 MONSCALE 1 MONONZ 0 85 Last updated 22 10 2008 Werner Herr 14 06 2006 186 Activate Deactivate Correctors or Monitors To provide more flexibility with orbit correction two commands are provided USEMONITOR S US flag US flag A S USEKICK STA aS EQUENCE sequence RANGE range CLASS class PATTERN regex EQUENCE sequence RANGE range CLASS class PATTERN regex The purpose of the two commands is USEMONITOR Activates or deactivates a selection of beam position monitor This command affects elements of types MONITOR HMONITOR or VMONITOR USEKICK Activates or deactivates a selection of orbit correctors This command affects elements of types KICKER HKICKER or VKICKER Both commands have the same attributes STATUS If this flag is true on the selected elements are activated Active orbit monitor readings will be considered and active correctors can change their strengths in subsequent correction commands Inactive elements will be ignored subsequently SEQUENCE The sequence can be specified otherwise the currect sequence is used for this operation RANGE CLASS PATTERN The usual selection
304. variable and also remove unused variables Minor clean up concerning character strings possibly uninitialized variables and unused variables ONLINE needs libmdblib a libmdbmth a librpnlib a libSDDS1 a libSDDSIc a libz a SLC5 needed libX11 a MAD X production version 4 00 19 version madX 4_00_18_dev Version 4 00 17 add LRAD to kickers Version 4 00 16 Version 4 00 15 MAD X version 4 00 14 MAD X version madX 4_00_12 dev version madX 4_00_12_dev version madX 4_00_11_dev version 4 00 10 version Add attribute range_plot to allow range also for user defined horizontal axis courtesy HG Allowing plotting at markers using the marker_plot attribute Courtesy HG Add ntpsa flag if present the new C TPSA package by lingyun yang gmail com in invoked and the symprint flag pronts the symplecticity flag by default Remove harmless occurrence dipole_bv by the more obvious one other_bv remove tabs Clean up unused variables Take out Unused external reference RESULT_FROM_ NORMAL found with latest NAG Fortran Compiler Release 5 2 668 Minor clean up 281 Get the compiler directives like ifdef _WIN32_DLL working in F90 files using the Lahey compiler Special Fujitsi flags for 1f95 invoked e g 1f95 c o1 tp lfe Cpp Ife D_WIN32_DLL FPP c_tpsa_interface F90 winconsole ml msvc These compiler flags can be found at http www lahey com docs fujitsu 20compiler 20option 20list pdf To wrap up for Wi
305. ve sequence d1t13 file tl bare new parameter bare only sequ saved call file tl sequence is read in and is now a real sequence if the two preceding lines are suppressed seqedit will print a warning and else do nothing use period d1t13 twiss save betx bxa alfx alfxa bety bya alfy alfya plot vaxis betx bety haxis s colour 100 SEQEDIT SEQUENCE d1t13 remove element cx bhe0330 remove element cd bhe0330 98 ENDEDIT use period d1t13 twiss save betx bxa alfx alfxa bety bya alfy alfya SAVEBETA savebeta label label place place sequence s_name marks a place place in an expanded sequence s_name at the next TWISS command execution a beta0 block will be saved at that place with the label label This is done only once in order to get a new betaO block there one has to re issue the command The contents of the beta0 block can then be used in other commands e g TWISS and MATCH Example after sequence expansion savebeta label sb1 place mb 5 sequence fivecell twiss show sbl will save and show the beta0 block parameters at the end of the fifth element mb in the sequence SELECT select flag flag range range class class pattern pattern slice integer column s1 s2 s3 sn sequence s_name full clear selects one or several elements for special treatment in a subsequent command All selections for a given comm
306. xamples All matching examples and the related files for executing the MADX sample jobs can be found on the afs directory under afs cern ch group si slap share mad X test_suite match V3 02 03 Simple Periodic Cell Match a simple cell to given phase advances FIVE CELL Simple Periodic Cell Match the matrix elements of the linear transfer matrix at the end of a sequence 5 periodic cells RMATRIX Transfer line with initial conditions Match a sequence of 5 periodic cells with initial conditions to given beta functions at the end of the sequence Transfer line Global tune matching in a sequence of 5 periodic cells Match the global tune of a sequence of 5 periodic cells Global tune 180 Global tune matching for the LHC Match the global tune for beam1 of the LHC Global tune for the LHC Global chromaticity matching for the LHC Match the global chromaticity for beam1 of the LHC Global chromaticity for the LHC Global chromaticity matching for both beams of the LHC Match the global chromaticity for beam1 and beam2 of the LHC Global chromaticity for both beams of the LHC IR8 insertion matching for beam1 of the LHC Match the insertion IR8 with initial conditions to given values of the optics functions at the IP and the end of the insertion IR8 insertion matching for beaml of the LHC IR8 insertion matching for beam1 of the LHC with upper limits on the optics functions Match the i
307. xt file in two formats with ptc_printparametric command They can be also visualized and further studied with rviewer from rplot plugin Further user can set numeric values of knobs with ptc_setknobvalue what updates all numeric values of the parameters in the tables This way knobs can be used in matching knobs implemented with PTC with pol_blocks command to dump parametric results to file or stdout content of ptc_madx_tablepush f 90 moved to ptc_madx_knobs 90 the former one removed Sceleton for knobs and arbitrary element placement implemented Lattice visualization via ROOT macro Printing detailed lattice geometry in PTC Several small bug corrections and some code cosmetics PTC_Enforce6D implemented sodd F Suppression of excessive printing courtesy SS 1 Stefan Sorge new module keeper 2 Second order detuning with proper hor and ver names In fact vertical terms were missing Close unit 34 even on error output Sodd table names usinf small letters only closing unit 34 to allow multiple SODD runs changing table entries to more logical names print out clean up trrun F The argument el was removed from argument list of subroutine tmarb called here line 532 in trrun F because it did not coincide with the argument list of the real subroutine tmarb in twiss F Bug found by Stefan Sorge in trrun trinicmd Variables bet0 and bet0i were undefined leading to erronous results Correct
308. y by VBEND SBEND L 6 0 K0S 0 01 6 June 17 2002 116 BEAMBEAM Beam beam Interaction The command BEAMBEAM may be inserted in a beam line to simulate a beam beam interaction point label BEAMBEAM SIGX real SIGY real XMA real YMA real CHARGE real BBSHAPE int WIDTH real BBDIR int The beam beam interaction is represented by a four dimensional interaction with a thin element i e horizontal and vertical non linear kicks The code for this element has been contributed by J M Veuillen 1987 and extended by S Sorge 2007 SIGX The horizontal extent of the opposite beam default 1 m Meaning depends on parameter BBSHAPE SIGY The vertical extent of the opposite beam default 1 m Meaning depends on parameter BBSHAPE XMA The horizontal displacement of the opposite beam with respect to the ideal orbit default 0 m YMA The vertical displacement of the opposite beam with respect to the ideal orbit default 0 m CHARGE The charge of particles in the opposite beam in elementary charges It is set by default CHARGE 1 So if you want to describe collisions between beams containing the same particles having a charge different from 1 you have to set CHARGE explicitly in BEAM and in BEAMBEAM BBSHAPE The parameter to choose the radial density shape of the opposite beam default 1 O BBSHAPE 1 Gaussian shape default SIGX SIGY standard deviation in vertical horizontal direction O BBSHA
309. y real value and integer value can be entered as an arithmetic expression When a value used in an expression is redefined by the user or changed in a matching process the expression is reevaluated Expression definitions may be entered in any order MAD evaluates them in the correct order before it performs any computation At evaluation time all operands used must have values assigned An expression is built from a combination of operatorjand joperand and it may contain random generators Operators in Arithmetic Expressions An expression can be formed using the following operators Arithmetic operators Addition Subtraction Multiplication Division Exponentiation Ordinary functions sqrt x square root log x natural logarithm log10 x logarithm base 10 exp x exponential sin x trigonometric sine cos x trigonometric cosine tan x trigonometric tangent asin x arc sine acos x arc cosine atan x arc tangent sinh x hyperbolic sine cosh x hyperbolic cosine tanh x hyperbolic tangent abs x absolute value 64 random number generators ranf random number uniformly distributed in 0 1 gauss random number gaussian distribution with unit standard deviation tgauss x random number gaussian distribution with unit standard deviation truncated at x standard deviations Wow in the above cases x can be any expression i e contain other functions variable or constant expre
310. ys parametric PTC calculations to perform matching in a faster manner For further details see the comments at the top of matchptcknobs c file 3 Minor corrections and protections against segmentation vilation Do not print to file trailing blanks in the buffer PTC knobs pol_blocks almost completely interfaced to MAD X User sets a knob with ptc_knob command Twiss parameters and user specified with ptc_select map components are buffered in memory after every element in form of taylor series They can be dumped to text file in two formats with ptc_printparametric command They can be also visualized and further studied with rviewer from rplot plugin Further user can set numeric values of knobs with ptc_setknobvalue what updates all numeric values of the parameters in the tables This way knobs can be used in matching Severe bug in knobs corrected attempt to delete not properly assocoated taylors in case no knobs are set by the user knobs implemented with PTC with pol_blocks command to dump parametric results to file or stdout content of ptc_madx_tablepush 90 moved to ptc_madx_knobs 90 the former one removed Debug info printed only at appropriate debuglevel Sceleton for knobs and arbitrary element placement implemented Lattice visualization via ROOT macro Printing detailed lattice geometry in PTC Several small bug corrections and some code cosmetics madx_ptc_module 90 RF cavity treated as TW cavity now
311. z fenergy no default Note that if the RF frequency is not given it is computed from the harmonic number and the revolution frequency fg as before However for deflecting structures this makes no sense and the frequency is mandatory RV1 Number of initial turns with zero voltage default 0 RV2 Number of turns to ramp voltage from zero to nominal default 0 RV3 Number of turns with nominal voltage default VOLT RV4 Number of turns to ramp voltage from nominal to zero default 0 RPH1 Number of initial turns with nominal phase default 0 EPHASE Value of the final crab RF phase 2pi with respect to nominal value default 0 RPH2 Number of turns to ramp phase 2pi from nominal to specified value default 0 HARMON The harmonic number h no default Only if the frequency is not given Please take note that the following MADS attributes BETRF PG SHUNT and TFILL are currently not implemented in MAD X lt Note that crab cavities are only implemented for tracking purposes TWISS will ignore any effect of the crab cavity A cavity requires the particle energy ENERGY and the particle charge CHARGE to be set by a command before any calculations are performed Example BEAM PARTICLE PROTONENERGY 7000 0 CAVITY CRABCAVITY L 10 0 VOLT 5 0 LAG 0 0 FREQ 400 rvl 0 rv2 50 rv3 1000 rv4 50 rphi 100 rph2 500 lagf 0 125 The straight reference system for a cavity is a cartesian coordi
Download Pdf Manuals
Related Search
Related Contents
Fire Safety Leader`s Guide For Parts Call K&T 606-678-9623 or 606-561 Pickering 40-908-001 Manual User Manual - ADFWeb.com hcc: A Handel SilberSonne HL3CW LED lamp инструкцию Type ETO2 InQuiry Copyright © All rights reserved.
Failed to retrieve file