Zgoubi
A startup guide for the complete beginner
Abstract
Zgoubi is a code which can be used to model accelerators and beam lines, comprised of magnetic and electrostatic elements. It has been extensively developed since the mid-1980s to include circular accelerators and related beam physics. It has been made freely available by its author on a code development site, including a Users’ Guide, a data treatment/graphic interfacing tool, and many examples[1].
1 Getting started
1.1 Introduction to Zgoubi
Zgoubi began in the early 1970’s as a code to be used for ray-tracing in large spectrometers for nuclear physics. Since then Zgoubi has been adapted such that it can be used to design beam optics and beam lines, and to simulate nonlinear dynamics. From the mid-1980’s on, it has been developed and used extensively for the simulation of circular accelerators and storage rings, and related beam physics as spin dynamics, synchrotron radiation, short-lived beams, etc. It has been made freely available by its author on a code development site, including a Users’ Guide, a data treatment/graphic interface program, zpop, and many examples [1, 2, 3, 4].
The code is written in FORTRAN but users have developed additional interfaces for data handling and visualisation. In this guide reference will be made to MATLAB [5] scripts written for this purpose.
In the Zgoubi code, particle trajectories in electromagnetic fields are calculated through numerical integration of the Lorentz equations. As a result of the efficiency of the integration (through a Taylor-series based expansion) and the nature of the programming language used the computation time is very fast. The main program array is a linear description of the Zgoubi input file, named zgoubi.dat. This file contains a linear definition of the lattice and beam parameters, and is written for the specific simulation required.
1.2 Installation of zgoubi
Zgoubi can be run on Windows or UNIX systems. However the post-processing program, zpop, requires an xterm window so is better suited to a UNIX system. On most Windows systems it is possible to run a UNIX system such as Scientific Linux (https://www.scientificlinux.org/) using a product such as VirtualBox (https://www.virtualbox.org/), both of which are freely available. During the installation of Scientific Linux it is possible to select the developer options which should include the required FORTRAN compilers needed for Zgoubi.
The installation of Zgoubi on Windows and UNIX systems is covered in the following section. It is also possible to install Zgoubi through installation of PyZgoubi (see section 1.6)[6]. It is recommended that the new user gains some experience with Zgoubi to gain some understanding of how the code works before expanding to Zgoubi interfaces such as PyZgoubi.
1.2.1 Required Software
To use Zgoubi you will need a FORTRAN compiler on your machine. Many UNIX systems will already have a compiler installed. On a Windows machine MinGW can be used [7].
To install MinGW;
- 1.
-
2.
Click on ‘mingw-get-inst’, download and run the latest .exe version (figure 1(a)) to install to a directory of your choice, for example C:\MinGW. Ensure to select the FORTRAN option during the install process (figure 1(b)). Further information about this install is available on the ‘Getting Started’ webpage above.
(a) The MinGW download file. (b) Selecting MinGW install options. Figure 1: Installing MinGW. -
3.
In the subfolder ’MinGW\bin’ rename the file ’mingw32-make.exe’ to ’make.exe’ (figure 2).
-
4.
Set the environmental variable with the address of the MinGW\bin directory (see section 1.2.2).
Figure 2: Renaming to ’make.exe’.
To install Zgoubi;
-
•
Windows
-
1.
Download Zgoubi from source, e.g. http://sourceforge.net/projects/zgoubi/ and unpack to a directory of your choosing, e.g. C:\zgoubi-5.1.0. Version 5.1.0 is stable but newer versions are available.
-
2.
To use Zgoubi in Windows; in the main directory of the unpacked folder and every subfolder edit the ’Makefile’ to replace every occurrence of ’;’ with ’&’ (figure 3(b)): in UNIX the semicolon can be used separate two lines of command, but in Windows the ampersand performs this function.
(a) The zgoubi-5.1.0 contents. (b) Editing ’Makefile’. Figure 3: Editing the Zgoubi ’Makefile’ to work in Windows. -
3.
Set the environmental variable with the address of the file ’zgoubi.exe’ (see section 1.2.2).
-
4.
Open a command prompt (cmd.exe) in the Zgoubi folder and type the command make. This should trigger an install of the program (see figure 4). In Windows the install is likely to complete with error messages for the install of ’zpop’. This graphics package needs to be run in an xterm window, which requires an X11 environment. This is not a trivial process for most Windows systems so it will not be covered here.
Figure 4: Entering the command ’make’ on the Windows command line.
-
1.
-
•
UNIX
-
1.
If you are unsure if there is a FORTRAN compiler on your system entering the command apropos fortran will show a list of the commands available and their use (figure 5). If there is no installer available it can be obtained using the command sudo apt-get install gcc-gfortran, or through the GUI software installer.
Figure 5: Expected response from the apropos command if FORTRAN compilers are installed. -
2.
Download source file from http://sourceforge.net/projects/zgoubi/ (e.g. zgoubi-5.1.0.tar.bz2).
-
3.
Unpack using the command tar -xjvf zgoubi-5.1.0.tar.bz2 (figure 6).
Figure 6: Unpacking Zgoubi download in Scientific Linux. - 4.
-
5.
Within the directory ’zgoubi-5.1.0’ enter the command make (figure 7).
Figure 7: Entering the make command in Scientific Linux. -
6.
Add the location of the folder ‘zgoubi-5.1.0/zgoubi’ to the Path - see section 1.2.2.
-
1.
1.2.2 Setting Environmental Variables
Both MinGW and Zgoubi will need adding to the ‘Path’ variable. In order to do this, follow the instructions for the operating system used.
-
•
Windows
-
1.
From the Start menu right-click on ‘My Computer’ or ‘Computer’ and select ‘Properties’, and ’Advanced System Settings’.
-
2.
Under the ‘Advanced’ tab select ‘Environmental Variables’ (figure 8).
Figure 8: Setting the Path in Windows 7. -
3.
Here there are two boxes, the upper specifying user settings and the lower specifying settings for all users. Be careful editing these settings as a mistake can affect the correct operation of the computer.
-
4.
In the lower box highlight ’Path’ and click ’Edit’.
-
5.
At the end of the existing entry add the address for the MinGW bin directory and the Zgoubi directory, e.g. for the base directories described in the install above the add to the path ’;C:\MinGW\bin’ and ’;C:\zgoubi-5.1.0’ (figure 9).
Figure 9: Inputing the path addresses.
-
1.
-
•
UNIX
-
1.
Edit the startup file and modify the PATH variable to include the location of the file /zgoubi-5.1.0/zgoubi as follows (e.g. if this file is in the directory usr/local/);
-
2.
Save and close the file.
-
3.
To use the graphics program ‘zpop’ another line can be added to the file using the location of the file ‘/zgoubi-5.1.0/zpop’ in the same manner as above (inserted before the ‘export PATH’ line for the bash shell) as can be seen in figure 10(b) below.
(a) Opening the bash shell script in the home directory with text editor ’gedit’. (b) The completed shell script. Figure 10: Editing the shell script in Scientific Linux. -
1.
1.2.3 Hints
Depending on your familiarity with Windows the following information may be unnecessary.
-
•
You will need a text editor to edit FORTRAN files. ‘Notepad++’ (http://notepad-plus-plus.org/) is freely available and an easy to use option for Windows.
-
•
In order to quickly open the command prompt in the correct folder on each use, paste a shortcut to the cmd.exe into the example folder, right click and under ‘Properties’, in the ‘Start in’ field copy and paste the address of the folder containing the zgoubi.dat file.
1.3 Running Zgoubi
In Windows the program is run from the command line (cmd.exe). In both Windows and Linux, at the command line within the folder containing the zgoubi.dat file to be used, type zgoubi and enter (see figure 11).

A successful run will output a list of elements as specified in the .dat file and produce a results file, ‘zgoubi.res’ alongside other files such as;
-
•
zgoubi.fai - particle coordinates and spin information. This stores data at the end of each magnet - it is useful for analysing phase space.
-
•
zgoubi.spn - spin coordinate information.
-
•
zgoubi.plt - particle coordinates and fields experienced by the particles stepwise along the beamline. This stores data points within a magnetic field only, drift spaces don’t store tracking data in this file.
-
•
zgoubi.map - 2-D field map information.
The results output overview of Zgoubi is written to the zgoubi.res file. The particle tracking and field data are stored to the other output files. The data can be visualised using the Zpop code for users with access to an xterm window. Otherwise extracting the required data can be done using other program interfaces. Dr Kai Hock has written MATLAB scripts to perform this function (see section 4.1). There are also add-on scripts such as PyZgoubi which uses a python interface to input lattice data and analyse the results (see section 1.6).
Further information about the Zgoubi output files can be found in Part D of the Zgoubi User’s Guide.
1.4 Running zpop
The Zgoubi code comes with a graphics package called zpop. It can only be run in an xterm window which can be accessed on most UNIX systems with the command xterm. An example of use can be seen in section 3.2.1.
1.5 How to use the Zgoubi User’s Guide
The Zgoubi User’s Guide is split into four sections. The first section, Part A - ‘Description of software contents’, provides information about the physics processes considered, the procedures available and the mathematical methods used to perform the integrations. The section begins with a glossary of the keywords used in the program. The keywords are how the user defines the accelerator lattice in the input zgoubi.dat file. Further information about the keywords can be found in section 4 of Part A, with details about how to use the keywords to be found in section B.
Part B - ‘Keywords and input data formatting’ details all the keywords used in the program. To enter lattice information into the zgoubi.dat file a keyword is used, followed by further numerical or text data to define the use of the keyword. As a simple example a drift section is defined in zgoubi.dat with the keyword ‘DRIFT’ with the length of the section (in cm). A few other examples will be discussed in section 2 of this guide.
In the introduction to Part B a description is given of how to input the information given for each keyword. An important thing to note is the units expected for each keyword. As an example, both radians and degrees are used at different occasions. When defining a lattice careful reference to the use of the keywords as defined in this section is strongly recommended. The allowed values for each keyword and the units to be used can be found in part B.
In Part C - ‘Examples of input data files and output result files’ several zgoubi.dat files are given as examples of different accelerator definitions. The resultant zgoubi.res files are also shown.
The information regarding instillation and running of Zgoubi is contained within Part D - ‘Running Zgoubi and its post-processor/graphic interface zpop’.
1.6 PyZgoubi - a python interface to Zgoubi
PyZgoubi is a freely available interface to Zgoubi written in python (http://www.hep.manchester.ac.uk/u/sam/pyzgoubi/). It has been designed to make reading and writing input data files easier, and takes advantage of python’s utilities and analysis tools to interpret the output[8]. It requires an installation of python with the packages of NumPy, SciPy and Matplotlib. It is also possible to install Zgoubi from the PyZgoubi installation if the OS has the GFortran compiler installed.
1.6.1 Installing PyZgoubi on Windows
Python can be installed on Windows with the required packages and libraries, NumPy, SciPy, Matplotlib either as individual modules ( see http://www.scipy.org/) or through the single package options such as Anaconda (http://continuum.io/downloads) or Enthought Canopy (https://www.enthought.com/products/epd/free/). The 32 bit version is free to all users. Links to these products and more are available on the PyZgoubi homepage above. The environmental variables need be amended to include the executable ’python.exe’ and also the library site packages, which may have an address such as ’C:\Users\Username\AppData\Local\Enthought\Canopy32
\User\Lib\site-packages
’.
After installing a python package with the above libraries PyZgoubi can be downloaded from sourceforge via the homepage (http://www.hep.manchester.ac.uk/u/sam/pyzgoubi/). After downloading it can be unpacked to a directory such as ’C:\pyzgoubi’ through a MinGW (see 1.2.1 for MinGW information) interface opened in the directory containing the tar.gz file (for example ’filename.tar.gz’) using the following command;
After unpacking PyZgoubi, through a command prompt open in the pyzgoubi folder enter the command python setup.py install, or to install to a specific destination (e.g. /python/install/) with the command python setup.py install --prefix=~/python/install/. The installation dialogue will offer suggestions of amendments to be added to the environmental Path variable which should be updated accordingly, along with the address of the PyZgoubi executable (see section 1.2.2).
Depending on the installation some small amendments may be necessary to run PyZgoubi. A batch file in the pyzgoubi folder (titled for example ’pyzgoubi.bat’) can help pyzgoubi to locate the python.exe executable. An example is shown below for an Enthought installation of python.
In the python file ’core.py’ within the ’run(… )’ loop a temporary directory is made with a prefix. This can cause problems in Windows which can be patched by changing the definition of ’tmpdir = tempfile.mdktemp(… )’ in this loop to ’tmpdir = tempfile.mkdtemp()’. On some systems the ’settings.ini’ file in the .pyzgoubi folder may need to be edited to ensure the path names are correct.
1.6.2 Installing PyZgoubi on UNIX
The PyZgoubi homepage contains links and information about how to install the code. The required packages of SciPy, NumPy and Matplotlib can be installed through Anaconda (link from the homepage) or other sources. Anaconda will also suggest appropriate changes to the PATH variable or offer to adjust the shell script automatically.
After a successful installation of python with these libraries on a system with a g77 compiler it should now be possible to download and install PyZgoubi following the advice on the homepage and in the README included with the source code. The shell environment needs to be configured to include the paths for the python executable and paths for the python libraries (PYTHONPATH) as advised during the installation procedure.
2 Defining a lattice
To define an accelerator lattice for Zgoubi the details need to be saved into a text file named ‘zgoubi.dat’. Keeping this input file for different accelerators in separate directories is essential to avoid accidentally overwriting one with another. In the file each element of the accelerator is specified in turn.
2.1 Coordinates
It is important to note that Zgoubi always works in local coordinates, not global coordinates. A right-handed system is used but the terminology may be slightly different to other commonly used systems, most notably in that the x axis is along the general direction of motion. The x axis is zeroed at the beginning of a component. In the figure below (see figure 12) the origin is in the median plane on a reference curve which coincides with the optical axis of optical elements.

2.2 Keywords and labels
In the zgoubi.dat file a keyword is used (in capitals and in quotes) to input data about every step of the lattice. The keyword and the data following it is read into the Zgoubi program. Each keyword can have two ’labels’ on the same line.
Although this label can be free text and used as an aide memoir, it can also on occasion be used to produce a result. For the keyword ’MARKER’, if the second label is .plt the current coordinates will be stored to the file named ’zgoubi.plt’. This file can be used with Zpop to produce plots. As another example, if given the name of a label the keyword ’FAISTORE’ will create a ’.fai’ file for storage of particle data at any element where the label is used. An example is given below. Here the output file will be called ’zgoubi.fai’ and will store data at the exit of any element labelled label1.
The details about the available keywords and how to use them can be found in Part B of the Zgoubi User’s Manual. Further information and examples of use can also be found in the Zgoubi Tutorial[9] available online.
2.3 Handling rotations and translations
A translation and/or rotation may be required between different elements which can be achieved by using the ‘CHANGREF’ keyword. The CHANGREF keyword is used to define transverse and longitudinal shifts and a z-axis rotation. The entry for this keyword in Part B of the Zgoubi User’s Guide is shown in figure 13 below.

The above entry gives an explanation of the function of the term, the units required (where ‘2*cm deg’ means two separate entries in cm followed by one entry in degrees), and each entry to be in real numbers (as indicated by ‘3*E’). As such, a rotation of the frame of reference by 10 degrees with respect to the z axis of the original frame would be entered into zgoubi.dat as below.
2.4 Defining initial particle coordinates
The keyword for the initial particle is ’OBJET’. The input parameters are specified over the subsequent five lines of code as can be seen in the example code below. With reference to Part B of the User’s Guide it can be found that the number on the second of these lines (with value ’2’ in the code below) selects options about the subsequent variables. It is again important to note the units used ( G = T). The units for the particle coordinates can be in different units dependent on the number option used on line 2.
This defined object describes the starting coordinates at the beginning of a cell in the lattice. If these coordinates were all set to zero the particle would travel along the reference path. However this may not be the best starting path, and may result in the particle getting lost after travelling though a few components. Some trial and error is likely to be involved to check if a particle can travel through the lattice correctly. Careful selection of a starting point for a cell - often at a point of symmetry - may mean that the right starting coordinates can be found by varying the horizontal displacement (the Y value) alone.
2.5 Extracting local particle coordinates
Printing out the local particle coordinates into zgoubi.res can be done with the keyword ’FAISCEAU’. However if the coordinates are to be stored (ie saved to file for later analysis) the keyword ’FAISTORE’ should be used. This saves the particle data to a filename (filename.fai) to be specified under the keyword. The keyword ’MARKER’ can be used to free-text name a point in the lattice. For example the following code would label a point in the lattice as three and produce a .fai file ’three_zgoubi.fai’ which would record the particle data at every occurrence of the marker ’three’.
3 Example: The EMMA lattice
EMMA (Electron Model of Many Applications) is a non-scaling FFAG accelerator. It consists of 42 doublet quadrupole cells (see figure 14) in a m circumference ring which accelerate electrons from MeV (kinetic energy)[10].



As the EMMA ring contains 42 replications of the same doublet cell the lattice definition is comparatively straightforward (see figure 15) - after definition the cell can be repeated 42 times to produce the complete ring.
3.1 The zgoubi.dat file

The ’zgoubi.dat’ input file for the EMMA lattice can be seen in figure 16. This section will explain the content of this file line by line using some of the components as described in the previous section.
Along the right hand side of the data in this file it can be seen that each keyword has been labelled in numerical order. This is not an essential part of the file, but can make matching the keyword to the output in the zgoubi.res file more simple. It can be seen in figure 17 that the results file zgoubi.res numbers each lattice element (the number before the keyword). Labelling each element in the input file with the corresponding number can make it easier to locate an input element with its output. For this lattice, with only 16 keywords used, it is not very difficult to identify each element in the zgoubi.res file and match it to the corresponding element in the zgoubi.dat file but in more complicated lattices this is less straightforward.

Line 1 of the zgoubi.dat file is for free text, in order to identify the lattice. The first keywords needed for this, and most lattices, are ’OBJET’ and ’PARTICUL’. OBJET defines the object, i.e. the initial particle coordinates and PARTICUL defines the characteristics of the particles in the beam. For EMMA the beam consists of electrons. The zgoubi.res file output gives further details about the particle from the input data from OBJET and PARTICUL (see figure 18). It is strongly advised to check this file after defining a lattice to ensure this output is correct, and the data has been input correctly.

At this point in the input file the cell can be defined. In EMMA the cell consists of the quadrupole doublet followed by a drift of cm. The next cell is then at an angle to the first. As there are 42 cells in the complete ring this angle is (actually with respect to the x axis to describe a rotation towards the centre of the ring) . For this lattice the drift section has been described as two cm sections at the beginning and end of the cell. This means the rotation of reference frame appears within the cell description rather than at the end as expected. The reason for this relates to the initial injection of particles in the OBJET definition. In order to obtain a stable orbit around the ring some trial and error with the initial particle coordinates is required. Using the middle of the drift space as the start of the cell allows a stable orbit to be found by varying the horizontal displacement (Y) alone. If the start/end of the cell involved the rotation the angle theta (T) would need to be varied too, making the process of finding a stable orbit more complicated. So it can be seen in figure 16 at line 10 the first drift section of cm is defined, which is then followed by a change in reference frame of a rotation of . The other half of the drift cavity is defined at the end of the cell on line 42. This defines a cell represented by the schematic picture in figure 19.

The CHANGREF on line 12 of zgoubi.dat rotates the coordinate system from ’a’ in figure 19 to one with the x-axis parallel to ’b’. The following CHANGREF on line 14 then performs a translation to move the coordinates to ’b’, with the x-axis in line with the centre of the defocusing quadrupole. Line 16 then defines the defocusing quadrupole, with the label ’defoc’ and is followed by a CHANGREF which reverses the previous translation and moves the coordinates to ’c’. After a further drift section there is another change of coordinates to ’d’ before the definition of the focusing quadrupole on line 31. One final CHANGREF moves the coordinates to ’e’ before the final drift section is defined at line 42.
The defocusing and focusing quadrupoles are defined at lines 16 and 31 respectively. The initial value of ’2’ is an instruction to print the field and coordinates along the trajectories. The following lines (18 and 33) define the length, radius and magnetic field at the pole tip for each quadrupole. The focusing magnet can be seen to have a negative value for this field. Both quadrupoles are then defined with four lines consisting of zero values. These lines can be used to define the fringe magnetic fields - the ’entrance’ and ’exit’ fringe fields. With zero values a ’sharp edge’ magnetic field approximation is used.
On lines 23 and 38 three values are entered to define the ’XPAS’ - this defines the number of steps for the integration process in the entrance field, main field and exit field of each component. If passed a single value a step length in cm would be used.
At line 44 a marker is placed. This itself has no impact on the beam (if given a second keyword of .plt data from this point in the lattice will be stored in the zgoubi.plt file) but marks the position on the lattice with the label bpm_str. The following keyword ’FAISTORE’ stores particle information in a .fai file given as an argument, here zgoubi.fai. The information is stored at every occurence of the labels given on line 46 which in this case is bpm_str. So the net result of lines 44-47 is to produce a file output of particle data at the end of the cell where the marker is placed.
The ’REBLOTTE’ keyword on line 48 of figure 16 is a command to repeat the zgoubi.dat file. Here it is given the values ’42 0 99’ which translates as 42 repetitions (i.e. one complete ring) with the ’0’ specifying a level of verbosity in the .res file and the ’99’ indicating that the particle coordinates at the end of one pass are used as initial coordinates for the next pass. To track the particle through several laps of the ring a multiple of 42 would be used for the first value.
3.2 Running EMMA and sample output
A run can be performed by typing the command zgoubi in the directory containing EMMA’s zgoubi.dat file (within a command prompt in Windows); this can be seen in figure 20, the run produces four output files.

3.2.1 Zpop output
If used in UNIX the output can be visualised with Zpop which is part of the Zgoubi package. In the following example the same zgoubi.dat file is used as input as seen in figure 16.
In order to produce data plots first Zgoubi should be run as in the previous section to produce .fai and/or .plt files, as can be seen in figure 21(a). An xterm window can then be opened with the command ’xterm’. In the xterm window the command zpop (see figure 21(b)) then opens the menu 21(c) and a blank tektronix window. Firstly option 1, ’Run Zgoubi’ should be selected in the xterm window to produce a zpop.log file. After this has been done the other options can be selected to examine different data. A list of the available variables to plot can be seen in figure 22. There is also an analysis package as part of Zpop accessible through option 8 of the main menu. This offers options as can be seen in figure 23 below.






As an example of the possible options, it is possible to plot the track of the particle through the lattice quadrupole by loading the zgoubi.plt file (see figure 24). Plotting the lab X and Y coordinates then produces a plot showing one cell in the lab coordinates. The quadrupoles can be seen as trapezoidal rather than rectangular shapes as the axis have different scales. The reference track which passes through the centre of the quadrupoles can be seen changing direction in line with the ’CHANGREF’ commands from zgoubi.dat. The particle tracking data can be seen as two arcs of data through the quadrupoles. The trapezoids representing the quadrupoles do not define the physical extent of the magnetic field, so it can be seen that although the particle track happens outside of the defocusing quadrupole trapezoid the track is still curved by its magnetic field.


The zgoubi.fai file is useful for analysing the phase space. From the Zpop main menu choosing the menu options to open the file ’zgoubi.fai’ allows plotting of a choice of variables. If the variables Z and Z’ are chosen (see figure 21(d)) and then plotted the following phase space chart can be produced (see figure 25(b)).


3.2.2 Analysis in Windows
As the running of Zpop requires an xterm window it it not ideally suited to a Windows system. In this situation a MATLAB script can be used to extract the data from the zgoubi.fai or zgoubi.plt file (see Appendix 4.1). The output from these files can be seen in figure 26.



3.2.3 EMMA with PyZgoubi
The identical lattice can be defined using the PyZgoubi script found in appendix 4.2. A version of this script and other EMMA examples are included in the PyZgoubi downloaded package. As with Zgoubi, the program is run from a command line (cmd.exe in Windows) open in the directory containing the particular script. The ’emma_ellipse.py’ script is run by entering the command pyzgoubi emma_ellipse.py (see figure 27(a)). The output of the script begins with a print to screen of the zgoubi.res file produced (figure 27(b)), followed by other instructions from the code - in this case a list of the Z,P values and a graphical output (see figure 27(c)).
An advantage of PyZgoubi is the ability to use python analysis tools on the resultant data. Included in the PyZgoubi downloaded package are sample EMMA scripts to calculate the closed orbits, tune, Twiss profiles and magnetic apertures for the lattice. Futher information about the use of PyZgoubi can be found at http://www.hep.manchester.ac.uk/u/sam/pyzgoubi/doc/0.3/doc.html.



4 Appendix
4.1 MATLAB scripts
The following codes were written by Dr. Kai Hock to extract and plot data from the Zgoubi output files using MATLAB.
4.1.1 get_zgoubi_data.m
This code extracts data from zgoubi.plt.
4.1.2 plt_zgoubi_plt_2b.m
In this script the previous code is called to extract the data which is then plotted.
4.2 PyZgoubi EMMA script
This script, emma_ellipse.py, will write the zgoubi.dat file for the EMMA lattice, print the ’zgoubi.res’ output to screen and plot a chart of Z vs Z’ (or Z vs P).
References
- [1] ”Zgoubi”, F. Méot, http://sourceforge.net/projects/zgoubi/
- [2] ”Zgoubi User’s Guide”, F. Méot, 2012, https://www.bnl.gov/isd/documents/80278.pdf
- [3] ”Zgoubi”, C. Lapoire, R. Basset, F. Zimmermann and F. Ruggiero, https://oraweb.cern.ch/pls/hhh/code_website.disp_code?code_name=Zgoubi
- [4] http://www.scienceaccelerator.gov/dsa/result-list/fullRecord:zgoubi/
- [5] Mathworks, 2013, http://www.mathworks.co.uk/
- [6] ”PyZgoubi - a python interface to Zgoubi”, S.Tygier, http://www.hep.manchester.ac.uk/u/sam/pyzgoubi/
- [7] MinGW, 2013, http://www.mingw.org/
- [8] ”PyZgoubi Documentation”, S. Tygier, http://www.hep.manchester.ac.uk/u/sam/pyzgoubi/doc/0.3/doc.html
- [9] ”Zgoubi Tutorial - A course for (potential) users”, F. Méot, 2009, ftp://ftp3.ie.freebsd.org/pub/sourceforge/z/zg/zgoubi/exemples/tutorial/lecture.pdf
- [10] ”EMMA, The World’s First Non-Scaling FFAG Accelerator”, S.L. Smith, 2009, http://accelconf.web.cern.ch/AccelConf/PAC2009/papers/we4pbi01.pdf
- [11] ”Fixed Field Alternating Gradient Accelerators (FFAG)”, S.Machida, 2012, http://cas.web.cern.ch/cas/Granada-2012/Lectures/GranadaLectures/Machida.pdf