Download and Installation

Note: Accelerator Toolbox 1.2 requires MATLAB 6

Accelerator Toolbox 1.2 (zip)

Accelerator Toolbox 1.2 (tar)

Extract the files to a dedicated Accelerator Toolbox root directory (ATROOT).
You should have a directory tree:

ATROOT
ATROOT\atdemos
ATROOT\atgui
ATROOT\atphysics
ATROOT\dev
ATROOT\lattice
ATROOT\simulator\track
ATROOT\simulator\element


Installation:

Define an environment variable ATROOT containing the full path to the Accelerator Toolbox root directory without the '/' or '\' path separator at the end. For example:

WINDOWS 2000

From the 'Start' menu choose: 'Settings' - 'Control Panel' -'System' -
'Advanced' - 'Environment Variables' - 'System variables' - 'New'

UNIX - bash

$ ATROOT=/mnt/winfat/at1.2
$ export ATROOT
$ matlab&

The remaining configuration and testing is done from MATLAB:

Verify that ATROOT environment variable is known to MATLAB

>> ATROOT=getenv('ATROOT')

Add ATROOT and its subdirectories to the MATLAB path

>> cd(ATROOT)
>> atpath(pwd)

Alternatively, you may choose 'Set Path' - 'Add with Subfolders' from the MATLAB 'File' menu and navigate to ATROOT


Making AT mex-files

BACKGROUND

MEX-files (Matlab EXecutable) are binary files that contain code executable from within MATLAB. The users can make their own mex-files from C or Fortran sources. Mex-files are PLATFORM and MATLAB VERSION DEPENDENT. For speed reasons, some of the AT files are  mex-files. C sources  for these AT mex-files are included with this distribution. AT script atmexall in ATROOT directory can automatically 'mex' all C files.

UNIX

You first need to set up and test the MATLAB 'mex' facility with the GNU gcc compiler.

See the MATLAB - External Interfaces Manual. Make sure that you can 'mex' the MATLAB examples.
If the GNU gcc compiler is installed and properly configured on your system, you may be able to skip reading the manual.

>> mex -setup

then choose the GNU gcc compiler from the menu. Run atmexall

>> atmexall

WINDOWS

Windows mex-files are included with this distribution.

If you have the Microsoft Visual C++ compiler, you may want to test atmeaxall anyway in case you write your own element pass-methods. First, configure the MATLAB 'mex' facility to use MSVC compiler:

>> mex -setup

then choose the Microsoft compiler from the menu. Run atmexall

>> atmexall


Tests

1. Run MATLAB script atdiag supplied with AT

>> atdiag

2.  Load an example lattice of the SPEAR storage ring

>> spear2

3. Track one particle for 1 turn around the ring:

>> r0 = [0.001 0 0.001 0 0 0]'
>> ringpass(THERING, r0 ,1)

4. Plot beta-functions

>> plotbeta


AT Home