Bmad: A relativistic charged particle simulation library

https://doi.org/10.1016/j.nima.2005.11.001Get rights and content

Abstract

Bmad is a subroutine library for simulating relativistic charged particle beams in high-energy accelerators and storage rings. Bmad can be used to study both single and multi-particle beam dynamics using routines to track both particles and macroparticles. Bmad has various tracking algorithms including Runge–Kutta and symplectic (Lie algebraic) integration. Various effects such as wakefields, and radiation excitation and damping can be simulated. Bmad has been developed in a modular, object-oriented fashion to maximize flexibility. Interface routines allow Bmad to be called from C/C++ as well as Fortran programs. Bmad is well documented. Every routine is individually annotated, and there is an extensive manual.

Section snippets

Overview

The Bmad [1] subroutine library for simulating relativistic charged particle beams was created to enable programmers to develop programs without the need to code from scratch commonly used functions such as lattice file parsing and particle tracking. Using a subroutine library such as Bmad cuts down on the time needed to develop programs and reduces programming errors.

Bmad has been developed at Cornell University's Laboratory for Elementary Particle Physics. The name Bmad is derived from the

Lattice parsing

The Bmad library includes two lattice parser subroutines. One parser interfaces with the Extended Standard Input Format (XSIF) library developed at SLAC [4] so that XSIF lattice files can be read. The other parser implements the Bmad standard lattice format.

Aside from the standard MAD elements such as quadrupoles, bends, RF cavities, etc., the Bmad standard format includes wiggler [5], and Taylor map elements. Like the SLAC extension to MAD, the Bmad standard also implements LINAC accelerating

Tracking and transfer map calculations

Tracking and transfer map calculations are at the heart of most simulations, and different problems will have different requirements as to accuracy, speed, etc. To preserve flexibility, Bmad implements a number of different tracking and transfer map engines. Each lattice element can be separately assigned which engine to use. Furthermore, Bmad has routines to do tracking both in the forward and backwards directions.

The default “Bmad_standard” engine is implemented using thick element formulas

C/C++ interface

Bmad is written in Fortran90 in an object-oriented fashion. To facilitate interfacing Bmad with routines written in C or C++, C structures with corresponding translation subroutines have been implemented to transfer data between Fortran and C/C++. For example, a Fortran program with a call such as:

type (ele_struct) ele
call c_example (ele)
could be handled with a C++ routine like:
void c_example_(void* f_ele) {
c_ele_struct c_ele;
ele_struct_to_c_(f_ele, &c_ele);
cout << "X_Beta: " << c_ele.x.beta <

Applications

The versatility of Bmad has led to its use in a number projects at Cornell. Bmad is the engine that drives the main software tools used for designing and simulating the Cornell Electron/positron Storage Ring CESR. Projects include dynamic aperture studies, lattice design, Beam-beam luminosity simulations, element misalignment studies, synchrotron radiation calculations, Baba scattering simulations, injection simulations, and measurement and correction of orbits, dispersion, coupling, beta, and

Summary

Bmad is a flexible, well documented, object-oriented environment for simulating accelerators and storage rings. It is not only useful in designing simulation programs but, since it is a software library, Bmad can be built into control room operation programs as well. Distributions with build scripts are available on OSF UNIX, Linux, and VMS. Bmad has also been compiled on Windows. The Bmad distribution and documentation may be obtained from Ref. [1]

Acknowledgements

My thanks to David Rubin for his support, to Etienne Forest for use of his remarkable PTC/FPP library not to mention his patience in explaining everything to me, to Mark Palmer for all his work porting Bmad to different platforms, to Hans Grote for granting the adaptation of figures in the MAD manual for use in the Bmad manual, and to Richard Helms, Kim Moore, Jeremy Urban, Jeff Smith, and Mike Forster for their help.

References (7)

  • For the Bmad distribution and documentation see:...
  • H. Grote, F.C. Iselin, The MAD Program User's Reference Manual, Version 8.19, CERN/SL/90-13 (AP) (REV. 5) (1996). Can...
  • W. Press et al.

    Numerical Recipes in Fortran, the Art of Scientific Computing

    (1992)
There are more references available in the full text version of this article.

Cited by (92)

  • Comparison of multiobjective optimization methods for the LCLS-II photoinjector

    2023, Computer Physics Communications
    Citation Excerpt :

    Several commonly used accelerator simulation codes have incorporated this algorithm for use by users directly or into their distributions, or provide a separate but paired package for optimization. Examples include OPAL [8] (the simulation code used in this paper), BMAD [9], Elegant [10], and General Particle Tracer [11]. One advantage, and possibly a key reason this algorithm has been widely used in the accelerator physics community, is the ease of multiobjective setup (given an implementation is already written and provided).

  • Muon g − 2: A review

    2022, Nuclear Physics B
    Citation Excerpt :

    Another important feature of the Fermilab measurement compared to the BNL experiment is the extensive use of three state-of-the-art and complementary particle tracking simulation programs to understand and estimate various systematic uncertainties. These are the Geant4 simulation toolkit [34] and accelerator simulation toolkits BMAD [35] and COSY [36]. Details about simulations and estimation of systematics based on these programs are outlined in [37].

View all citing articles on Scopus

Work supported by the National Science Foundation.

View full text