|
179 | 179 | madx.call("acc-models-lhc/lhc.seq")
|
180 | 180 | lhc.make_lhc_beams(madx, energy=6800)
|
181 | 181 | madx.call("acc-models-lhc/operation/optics/R2022a_A30cmC30cmA10mL200cm.madx")
|
182 |
| - madx.command.use(sequence=f"lhcb1") |
| 182 | + madx.command.use(sequence="lhcb1") |
183 | 183 |
|
184 |
| - lhc.re_cycle_sequence(madx, sequence=f"lhcb1", start=f"MSIA.EXIT.B1") |
185 |
| - madx.command.use(sequence=f"lhcb1") |
186 |
| - lhc.make_lhc_thin(madx, sequence=f"lhcb1", slicefactor=4) |
187 |
| - lhc.add_markers_around_lhc_ip(madx, sequence=f"lhcb1", ip=1, n_markers=1000, interval=0.001) |
| 184 | + lhc.re_cycle_sequence(madx, sequence="lhcb1", start="MSIA.EXIT.B1") |
| 185 | + madx.command.use(sequence="lhcb1") |
| 186 | + lhc.make_lhc_thin(madx, sequence="lhcb1", slicefactor=4) |
| 187 | + lhc.add_markers_around_lhc_ip(madx, sequence="lhcb1", ip=1, n_markers=1000, interval=0.001) |
188 | 188 | madx.command.twiss()
|
189 | 189 | initial_twiss = madx.table.twiss.dframe()
|
190 | 190 |
|
|
206 | 206 |
|
207 | 207 | initial_twiss.name = initial_twiss.name.apply(lambda x: x[:-2])
|
208 | 208 | twiss_df.name = twiss_df.name.apply(lambda x: x[:-2])
|
209 |
| -ip_s = twiss_df.s[f"ip1"] |
| 209 | +ip_s = twiss_df.s["ip1"] |
210 | 210 | slimits = (ip_s - 10, ip_s + 10)
|
211 | 211 |
|
212 | 212 | around_ip = twiss_df[twiss_df.s.between(*slimits)]
|
|
285 | 285 | # Manipulating the equation to determine the waist yields:
|
286 | 286 | # :math:`w = L^{*} - \sqrt{\beta_0 \beta_w - \beta_w^2}`
|
287 | 287 |
|
288 |
| -q1_right_s = twiss_df[twiss_df.name.str.contains(f"mqxa.1r1")].s[0] # to calculate from the right Q1 |
289 |
| -q1_left_s = twiss_df[twiss_df.name.str.contains(f"mqxa.1l1")].s[-1] # to calculate from the left Q1 |
| 288 | +q1_right_s = twiss_df[twiss_df.name.str.contains("mqxa.1r1")].s[0] # to calculate from the right Q1 |
| 289 | +q1_left_s = twiss_df[twiss_df.name.str.contains("mqxa.1l1")].s[-1] # to calculate from the left Q1 |
290 | 290 |
|
291 | 291 | L_star = ip_s - q1_left_s # we calculate from left Q1
|
292 | 292 | # beta0 = twiss_df[twiss_df.name.str.contains(f"mqxa.1r1")].betx[0] # to calculate from the right
|
293 |
| -beta0 = twiss_df[twiss_df.name.str.contains(f"mqxa.1l1")].betx[-1] # to calculate from the left |
| 293 | +beta0 = twiss_df[twiss_df.name.str.contains("mqxa.1l1")].betx[-1] # to calculate from the left |
294 | 294 | betaw = around_ip.betx.min()
|
295 | 295 |
|
296 | 296 | ###############################################################################
|
|
0 commit comments