Overview

Bmad is a subroutine library for relativistic charged-particle dynamics simulations in high energy accelerators and storage rings. Bmad has been developed at Cornell University's Laboratory for Elementary Particle Physics and has been in use since the mid 1990's. The Bmad subroutines, using an object oriented approach were developed to:

Bmad is mainly written in Fortran90 and has a C++ interface for cross language linking. Bmad has a wide range of routines to do many things. Bmad can be used to study both single and multi--particle beam dynamics. It has routines to track both particles and macroparticles. Bmad has various tracking algorithms including Runge--Kutta and symplectic (Lie algebraic) integration. Wakefields, and radiation excitation and damping can be simulated. Bmad has routines for calculating transfer matrices, emittances, Twiss parameters, dispersion, coupling, etc. The elements that Bmad knows about include quadrupoles, RF cavities (both storage ring and LINAC accelerating types), solenoids, dipole bends, etc. In addition, elements can be defined to control the attributes of other elements. This can be used to simulate the ``girders'' which physically support components in the accelerator or to easily simulate the action of control room ``knobs'' that gang together, say, the current going through a set of quadrupoles.

To be able to extend Bmad easily, Bmad has been developed in a modular, object oriented, fashion to maximize flexibility. As just one example, each individual element can be assigned a particular tracking method in order to maximize speed or accuracy and the tracking methods can be assigned via the lattice file or at run time in a program.


Bmad Source Code

Here the term "Bmad source code" includes not only the Bmad code library as well as the subsidiary libraries, like cesr_utils, but also the code for programs like Tao.

The Bmad source code is kept in a central "repository" which is controlled by a software package called Subversion. Subversion (SVN) is an open source version control system (VCS). It allows the tracking of changes made to the code over time. For more information on Subversion see:
      http://subversion.tigris.org.
For more information on the Cornell Accelerator Software Libraries see:
      https://wiki.lepp.cornell.edu/lepp/bin/view/CESR/ACL/WebHome

Periodically, a copy of the source code in the repository is tarred together and this is called a "distribution". Distributions are meant for off-site acquisition of Bmad.

For on-site access, every so often (typically about once a week), a copy of the source code in the repository is made and a version of all the programs like Tao are compiled from this copy. This is called a "release". There are two major releases: One called "devel" is made from the very latest code. There is also a "current" release which comes from older code. The general idea is that devel should have the latest stuff but current should be more stable (have less bugs). In practice, it turns out that the devel release is typically less buggy and hence it is recommended that one use the devel release. There are also other releases besides devel and current. See the Local Setup page for more information.