Skip to content

Commit

Permalink
Adapt example
Browse files Browse the repository at this point in the history
  • Loading branch information
giadarol committed Aug 26, 2024
1 parent fe1f78a commit c1dd339
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions examples/symm_twiss_and_match/000_symm_twiss_and_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
)
half_cell.particle_ref = xt.Particles(p0c=2e9)

# Add observation points every 1 m (to see betas inside bends)
half_cell.discard_tracker()
s_cut = np.arange(0, half_cell.get_length(), 1.)
half_cell.cut_at_s(s_cut)

# Attach knobs to quadrupoles
half_cell.vars['kqf'] = 0.027/2
half_cell.vars['kqd'] = -0.0271/2
half_cell.element_refs['qf1'].k1 = half_cell.vars['kqf']
Expand All @@ -32,17 +38,11 @@
vary=xt.VaryList(['kqf', 'kqd'], step=1e-5),
)


# Add observation points every 1 m
half_cell.discard_tracker()
s_cut = np.arange(0, half_cell.get_length(), 1.)
half_cell.cut_at_s(s_cut)

# Twiss with periodic symmetric boundary
tw_half_cell = half_cell.twiss4d(init='periodic_symmetric')

# Plot
import matplotlib.pyplot as plt
plt.close('all')
tw_half_cell.plot()

plt.show()

0 comments on commit c1dd339

Please sign in to comment.