Changes from AT1.2

 

Pass-Methods

 

1. PASSMETHODS command prints a list of all available pass methods in …/simulator/element subdirectory.

 

2. Calling a pass method function with no arguments returns a list of required and optional fields in element data structure:

 

>> [req,opt] = BendLinearPass

 

Optional fields are used only if present.

 

3. It is now possible to write pass method functions in MATLAB for faster prototyping or for problems where tracking speed is less of a concern. See for example mDriftPass.m and mIdentityPass.m

 

4. The following pass methods require ‘Energy’ (value in eV) field in the element structure:

 

StrMPoleSymplectic4RadPass,

BndMPoleSymplectic4RadPass

CavityPass

 

Note: Value in global variable GLOBVAL (soon to become obsolete) GLOBVAL.E0 is not used by pass methods but is required by another AT function OHMIENVELOPE.

To ensure consistency, set Energy field in all elements and GLOBVAL.E0 to the same value:

 

>> E0 = 3e9; % Energy 3 GeV

>> THERING = setcellstruct(THERING,’Energy’,1:length(THERING), E0);

>> global GLOBVAL

>> GLOBVAL.E0 = E0;

 

5. Obsolete Pass methods:

 

 

Lattice Tools

 

1. New useful tools:  SETTAGS, FINDTAGS, and ATINDEX. Syntax and intended use should be clear from m-file help.

 

 

2. There is no specific format for lattice files. The only requirement is that proper AT lattice variable is produced.  AT lattice variable is a cell array of structures with fields, matching their pass methods. Compare for example spear2.m (AT1.2 style lattice file) and spear3.m. New function ATELEM may be useful in lattice files.

 

3. For many types of calculations it is no longer a requirement that lattice structure is stored in special global variable ‘THERING’.

 

It is recommended that lattice file returns a lattice variable that is assigned a name in workspace.  Pass this variable to other AT functions instead of THERING.

 

>> spearlattice = spear3;

>> findm44(spearlattice,0);

 

Note: Some GUI functions (INTLAT, INTELEM) still require global THERING to simplify GUI callback code.  Also fittune2 and fitchrom2 work with global THERING.

 

4. Global variable FAMLIST, a byproduct of the AT1.2 style lattice format, is now obsolete.