-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLHC_longitudinal_test.py
More file actions
46 lines (36 loc) · 1.19 KB
/
LHC_longitudinal_test.py
File metadata and controls
46 lines (36 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import numpy as np
import matplotlib.pyplot as plt
from modules.tracker import *
from modules.naff import *
from modules.grid import *
from modules.tune_resonances import *
from modules.FMA import *
lattice = Lattice()
if ( True ):
#if ( False ):
#lattice.read_twiss_table("LHC/lhc_no_bb.twi")
lattice.read_twiss_table("small_ring/test/Optimized_ring_01.twi")
lattice.optimise()
lattice.compile()
#lattice.write_ptx("LHC/lhc_no_bb")
lattice.write_ptx("small_ring/test/Optimized_ring_01.twi")
else:
#lattice.read_ptx("LHC/lhc_no_bb")
lattice.read_ptx("small_ring/test/Optimized_ring_01.twi")
quit()
lattice.n_turns = 1000
lattice.norm_emit_x = 2e-6
#lattice.bunch_length=1e-3
lattice.norm_emit_y = 2e-6
n_particles=50
b=lattice.make_matched_bunch(n_particles)
lattice.collect_tbt_data = 1 # every 1 turn
lattice.bunch_energy_spread = 1e-4
lattice.track(b)
############################ DELTA-Z ##################################
for i in range (n_particles):
print 'Particle: ',i
plt.plot(lattice.turns[:].z(i), lattice.turns[:].d(i))
plt.show()
############################ NAFF ##################################
tunes = naff(lattice.turns[0:1000], vec_HostBunch.z, vec_HostBunch.d)