In [1]:
# loads pyaccel library in interactive mode
from sirius.interactive import *


Names defined in sirius.interactive: Accelerator, Kicktable, add_error_excitation_kdip, add_error_excitation_main, add_error_misalignment_x, add_error_misalignment_y, add_error_multipoles, add_error_rotation_pitch, add_error_rotation_roll, add_error_rotation_yaw, add_knob, bo, bpm, build, calc_emittance_coupling, calc_lifetimes, calc_twiss, corrector, de, dl, draw_lattice, drift, element_pass, find_dict, find_indices, find_m44, find_m66, find_orbit4, find_orbit6, find_spos, flatten, get_attribute, get_beam_size, get_chromaticities, get_equilibrium_parameters, get_error_misalignment_x, get_error_misalignment_y, get_error_rotation_pitch, get_error_rotation_roll, get_error_rotation_yaw, get_frac_tunes, get_mcf, get_natural_bunch_length, get_natural_emittance, get_natural_energy_spread, get_radiation_integrals, get_revolution_frequency, get_revolution_period, get_rf_frequency, get_rf_voltage, get_traces, get_transverse_acceptance, get_twiss, hcorrector, length, line_pass, marker, np, plot_twiss, plt, px, py, PYACCEL_VERSION, quadrupole, rbend, read_flat_file, refine_lattice, rfcavity, ring_pass, rx, ry, set_4d_tracking, set_6d_tracking, set_attribute, set_error_misalignment_x, set_error_misalignment_y, set_error_rotation_pitch, set_error_rotation_roll, set_error_rotation_yaw, set_knob, sextupole, shift, si, tb, ts, vcorrector, write_flat_file, write_flat_file_to_string.


In [2]:
# creates a FODO lattice with a corrector

ds = drift(fam_name='ds', length=0.2)
qf = quadrupole(fam_name='qf', length=0.5, K=+2.0)
qd = quadrupole(fam_name='qd', length=0.5, K=-2.0)
cm = corrector(fam_name='cm', length=0.1, hkick=1e-3, vkick=1e-3)

elist = [ds, qf, ds, qd, cm]
lattice = build(elist)

# creates an accelerator model with previous defined lattice
the_ring = Accelerator(lattice=lattice)
print('Basic information on the accelerator:'), print()
print(the_ring)


Basic information on the accelerator:

energy         : 510998.9277159154 eV
harmonic_number: 0
cavity_on      : False
radiation_on   : False
vchamber_on    : False
lattice size   : 5
lattice length : 1.5 m

In [3]:
# finds 4d closed orbit at start of each element

co = find_orbit4(accelerator=the_ring, energy_offset=0.0, indices='open')
print(co)


[[ 0.00437601  0.00489187  0.00490383  0.00439715  0.00416809]
 [ 0.00257926  0.00257926 -0.0025334  -0.0025334   0.00157926]
 [ 0.00505138  0.00466674  0.0048391   0.00536732  0.0052937 ]
 [-0.00192319 -0.00192319  0.0026411   0.0026411  -0.00292319]]

In [ ]: