Simulation Labs

We will complete simulation labs using cloud computing resources provided by RadiaSoft.

The computer labs explore beam dynamics using python routines and the accelerator simulation code Elegant. The procedures are written up as Python notebooks, which we will run in the Jupyter notebook interface using a server provided by Radiasoft.


Every group will complete the same 4 computer labs in the following order:

  1. transverse-dynamics

  2. longitudinal-dynamics

  3. quadrupole-transport

  4. dispersion-chromaticity


Lab Reports:

Please turn in one lab report for the group, anyone in the group can submit via upload. The lab report should answer the questions in the procedure that are numbered and bolded. You can create a separate document (e.g., word file) to record answers, or you can enter them directly into the jupyter notebook. If saving answers in the notebook, please export as HTML ("File" --> "Export notebook as "--> "Export notebook to html"). Any plots can be printed and submitted separately or embedded in lab report.

If you have any problems exporting your notebook file, please follow the alternative instructions for submission:

  • Agree among your group members who will turn in the completed file.

  • Place the .ipynb file into the USPAS-Student/ directory under the name of one group member. Note that as students you can only see files within your own directory.

  • Your submission will be the path to a notebook file on the sirepo server, for example ~/jupyter/USPAS-Student/<student-name>/<name-of-file>.ipynb.

  • Instructors will then be able to go in and view that file.

Setting up lab notebooks:

To access the computer labs, you will need an account on the Radiasoft Jupyter server. If you have not registered an account already, please follow instructions at the bottom of this page.

Once you have an account:

  1. Navigate to https://jupyter.radiasoft.org

  2. Click on upper left "+" symbol, which will open a Launcher page.

  3. On this page, click "Terminal" to open a terminal window.

  4. Enter the following lines on the command line:

git clone https://github.com/uspas/fundamentals-labs.git


  1. Verify that you see the following output in the terminal window. On the navigation pane (left side of screen) you will see the new folder "fundamentals-labs". This contains the 4 simulation labs used in this course, see highlighted below.

6. It is recommended to copy the file you are going to work on into another directory. If you do not make changes in the directory created with "git clone," it will be easier for you to get updated copies.

7. To grab an updated copy, from the terminal window run:

cd fundamentals-labs/

git pull

Accessing simulation tools

The last two labs, quadrupole-transport and dispersion-chromaticity, require you to run accelerator simulations. We will be using the simulation code Elegant, which is developed by Michael Borland at the Argonne Lab Advanced Photon Source. This code supports tracking of particle orbits through beamline elements, and is most commonly used to model electron beams in light sources.

The simulations are set up in the Sirepo interface, also hosted by Radiasoft. Direct links to the Sirepo simulations are embedded in the notebook files. You will use the same email login to access Sirepo. Unlike the notebook files, the simulations are not already in your workspace. However, when you click the link a copy of the simulation will be added to your persistent workspace on Sirepo.

Although the links are embedded in the notebook files, they are repeated here for back-up:

  1. FODObeamline (used in Quadrupole-transport and Dispersion-Chromaticity)

  2. DispersionFree (used in Dispersion-Chromaticity)

Radiasoft Jupyter accounts:

You should have received an email from uspas@fnal.gov with instructions for creating an account for Radiasoft Jupyter. They are repeated here:

When creating an account, please use the email address at which you received this email.

  1. If you do not currently have a Sirepo log-in, please go to Sirepo Elegant, create an account. If you have an existing RadiaSoft Jupyter or Elegant account please go through the merge process that moves your Jupyter home directory over to Sirepo.

  2. Email support@sirepo.com from the email address associated with your account and with subject line "USPAS Student".

RadiaSoft will create directories that will be read-only and which everyone will be able to see, and student directories which each student and instructors will be able to see.

End of course

RadiaSoft will reconfigure their Sirepo Jupyter servers at the end of USPAS. Students will still have all of their data and course materials in their home directories, but any jobs they have running will be killed when Sirepo is reconfigured and restarted.