Skip to content

Commit

Permalink
Example for ele_co_search
Browse files Browse the repository at this point in the history
  • Loading branch information
giadarol committed Dec 17, 2023
1 parent 4c12028 commit c03b6d2
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions examples/twiss/000d_twiss_ele_co_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@
collider.lhcb2.twiss_default['method'] = '4d'
collider.lhcb2.twiss_default['reverse'] = True

line = collider.lhcb2
line_name = 'lhcb2'

line = collider.lhcb1
line_name = 'lhcb1'

two = line.twiss(ele_start='ip7', ele_stop='ip3', ele_init='ip1',
betx=.15, bety=.15)
collider.vars['on_x1vs'] = 123
collider.vars['on_sep1h'] = 2
collider.vars['on_x1vs'] = 200
collider.vars['on_sep1v'] = -3

# tw = collider.lhcb1.twiss() # Fails on closed orbit search
tw = collider.lhcb1.twiss(ele_co_search='ip7') # Successful closed orbit search

import matplotlib.pyplot as plt
plt.close('all')
plt.figure(1)
plt.plot(two.s, two.betx, label='betx')
plt.plot(two.s, two.bety, label='bety')
plt.plot(tw.s, tw.x)
plt.plot(tw.s, tw.y)
plt.show()

0 comments on commit c03b6d2

Please sign in to comment.