Skip to content

Simulation class

Vyacheslav Fedorov edited this page Dec 20, 2019 · 7 revisions

The Simulation class

The Simulation class is top-level class in kenv. It contains all the simulation data, and has the high-level method track that performs the kenv cycle.

class kenv.Simulation(beam, accelerator)

Initializes a simulation.


Parameters:

  • beam (kenv.Beam) - Initial beam.

  • accelerator (kenv.Accelerator) - accelerator.

  • gamma (func, after track) - beam gamma factor in the accelerator.

  • envelope_x (func, after track) [m] - x-axis envelope beam.

  • envelope_xp (func, after track) [rad] - x-axis envelope prime beam.

  • envelope_y (func, after track) [m] - y-axis envelope beam.

  • envelope_yp (func, after track) [rad] - y-axis envelope prime beam.

  • centroid_x (func, after track) [m] - x-axis trajectory shifted centroid.

  • centroid_xp (func, after track) [rad] - x-axis trajectory prime shifted centroid.

  • centroid_y (func, after track) [m] - y-axis trajectory shifted centroid.

  • centroid_yp (func, after track) [rad] - y-axis trajectory prime shifted centroid.

  • larmor_angle (func, after track) [rad] - Larmor angle centroid.

Methods:

  • track(rtol=1e-6)

Perform kenv simulation.

Parameters:

    • rtol (float, optional) - relative accuracy.