Skip to main content

This notebook was created by Sergey Tomin (sergey.tomin@desy.de). Update January 2025

Tutorials

Current tutorials can be found in ocelot/demos/ipython_tutorial folder.

Beam dynamics

Before starting with the tutorials, we recommend looking at Ocelot for Students — a beginner-friendly example aimed at students and newcomers to accelerator physics. This tutorial keeps things simple and interactive to help build intuition about how magnetic elements work.


Photon field simulation

Appendixes

  • Undulator matching

    • brief theory and example in OCELOT
  • Some useful OCELOT functions

    A collection of small but handy features in Ocelot:

    • Aperture
    • Losses along accelerator lattice
    • RK tracking
    • Dump the beam distribution at a specific location of the lattice
    • Energy jitter. Or simulation of the jitter in the RF parameters.
    • Get Twiss parameters from the beam slice
    • Transfer Maps in Ocelot. Global assignment and for specific elements
  • Example of an accelerator section optimization

    • A simple demo of accelerator section optimization with a standard scipy numerical optimization method.
  • Optics Design for High Time Resolution with TDS
    An example demonstrating how to perform optics matching in Ocelot to improve time resolution when using a Transverse Deflecting Structure (TDS).

Checking your installation

You can run the following code to check the versions of the packages on your system:

(in IPython notebook, press shift and return together to execute the contents of a cell)

import IPython
print('IPython:', IPython.__version__)

import numpy
print('numpy:', numpy.__version__)

import scipy
print('scipy:', scipy.__version__)

import matplotlib
print('matplotlib:', matplotlib.__version__)

import ocelot
print('ocelot:', ocelot.__version__)
    IPython: 8.20.0
numpy: 1.26.3
scipy: 1.11.4
matplotlib: 3.8.2
initializing ocelot...
ocelot: 24.03.0

Disclaimer:

The OCELOT code comes with absolutely NO warranty. The authors of the OCELOT do not take any responsibility for any damage to equipments or personnel injury that may result from the use of the code.