|
8 | 8 |
|
9 | 9 | This example shows how to use the `~.lhc.apply_lhc_rigidity_waist_shift_knob`
|
10 | 10 | function to force a waist shift at a given IP and break the symmetry of the
|
11 |
| -:math:`\\beta`-functions in the Interaction Region. |
| 11 | +:math:`\\beta`-functions in the Interaction Region. This is done by |
| 12 | +over-powering one triplet and under-powering the other, by the same powering |
| 13 | +delta. |
12 | 14 |
|
13 | 15 | We will do a comparison of the interaction region situation before and after
|
14 |
| -applying a rigid waist shift. |
| 16 | +applying a rigid waist shift, and look in more details at the waist shift |
| 17 | +itself. |
15 | 18 |
|
16 | 19 | .. note::
|
17 | 20 | This is very specific to the LHC machine and the implementation would not
|
|
32 | 35 | plt.rcParams.update(defaults._SPHINX_GALLERY_PARAMS) # for readability of this tutorial
|
33 | 36 |
|
34 | 37 | ###############################################################################
|
| 38 | +# Showcasing the Waist Shift |
| 39 | +# -------------------------- |
35 | 40 | # Let's start by setting up the LHC in ``MAD-X``, in this case at top energy:
|
36 | 41 |
|
37 | 42 | madx = Madx(stdout=False)
|
|
89 | 94 | #
|
90 | 95 | # .. hint::
|
91 | 96 | # A waist shift knob setting of 1 will result in a 0.5% change in the triplets
|
92 |
| -# knob powering. The individual triplet magnets trims are not affected. |
| 97 | +# knob powering. The individual triplet magnets trims are not affected. Here we |
| 98 | +# will use a setting of 1.5 to make the effect easily noticeable. |
93 | 99 |
|
94 | 100 | lhc.apply_lhc_rigidity_waist_shift_knob(madx, rigidty_waist_shift_value=1.5, ir=1)
|
95 | 101 | matching.match_tunes_and_chromaticities(madx, "lhc", "lhcb1", 62.31, 60.32, 2.0, 2.0)
|
|
120 | 126 |
|
121 | 127 | ###############################################################################
|
122 | 128 | # Comparing to the previous plot, one can notice two things:
|
123 |
| -# - The triplet quadrupoles powering has changed and is not symmetric anymore. |
| 129 | +# - The triplet quadrupoles powering has changed and is not (anti-)symmetric anymore. |
124 | 130 | # - The :math:`\beta_{x,y}` functions symmetry has been broken.
|
125 | 131 | #
|
126 | 132 | # One can compare the :math:`\beta_{x,y}` functions before and after the rigid
|
|
152 | 158 | madx.exit()
|
153 | 159 |
|
154 | 160 | ###############################################################################
|
| 161 | +# Determining the Waist Shift |
| 162 | +# --------------------------- |
155 | 163 | # Let's now determine the value of the waist, aka the amount by which we have
|
156 | 164 | # shifted the waist compared to the IP point location. To do so, we will use
|
157 | 165 | # both an analytical approach and a more brute force one through simulations.
|
|
258 | 266 | # The value of the waist is then simply the distance between the IP and the
|
259 | 267 | # location of the found minima. Here is the value, in meters:
|
260 | 268 |
|
261 |
| -shift = abs(ip_s - waist_location) |
| 269 | +shift = ip_s - waist_location |
262 | 270 | print(shift)
|
263 | 271 |
|
264 | 272 | ###############################################################################
|
|
276 | 284 | # Manipulating the equation to determine the waist yields:
|
277 | 285 | # :math:`w = L^{*} - \sqrt{\beta_0 \beta_w - \beta_w^2}`
|
278 | 286 |
|
279 |
| -q1_right_s = twiss_df[twiss_df.name.str.contains(f"mqxa.1r1")].s[0] |
280 |
| -q1_left_s = twiss_df[twiss_df.name.str.contains(f"mqxa.1l1")].s[-1] # to calculate from the left |
| 287 | +q1_right_s = twiss_df[twiss_df.name.str.contains(f"mqxa.1r1")].s[0] # to calculate from the right Q1 |
| 288 | +q1_left_s = twiss_df[twiss_df.name.str.contains(f"mqxa.1l1")].s[-1] # to calculate from the left Q1 |
281 | 289 |
|
282 |
| -L_star = ip_s - q1_left_s |
283 |
| -beta0 = twiss_df[twiss_df.name.str.contains(f"mqxa.1r1")].betx[0] |
284 |
| -# beta0 = twiss_df[twiss_df.name.str.contains(f"mqxa.1l{IP:d}")].betx[-1] # if calculating from the left |
| 290 | +L_star = ip_s - q1_left_s # we calculate from left Q1 |
| 291 | +# beta0 = twiss_df[twiss_df.name.str.contains(f"mqxa.1r1")].betx[0] # to calculate from the right |
| 292 | +beta0 = twiss_df[twiss_df.name.str.contains(f"mqxa.1l1")].betx[-1] # to calculate from the left |
285 | 293 | betaw = around_ip.betx.min()
|
286 | 294 |
|
287 | 295 | ###############################################################################
|
288 | 296 | # The analytical result (sign will swap depending on if we calculate from left
|
289 |
| -# or right Q1) is then: |
| 297 | +# or right Q1) is then easily calculated. We can then compare this value to the |
| 298 | +# one found with the markers we previously added, and they are fairly close. |
290 | 299 | waist = L_star - np.sqrt(beta0 * betaw - betaw**2)
|
291 |
| -print(waist) |
292 |
| - |
293 |
| -############################################################################### |
294 |
| -# It is fairly close to the value found with the markers we previously added: |
295 |
| -print(shift) |
| 300 | +print(waist) # analytical |
| 301 | +print(shift) # markers |
296 | 302 |
|
297 | 303 | #############################################################################
|
298 | 304 | #
|
|
0 commit comments