@@ -351,10 +351,10 @@ def coulomb_log(
351351 # and can be skewed by some very high peaks in the optics
352352 with warnings .catch_warnings (): # Catch and ignore the scipy.integrate.IntegrationWarning
353353 warnings .simplefilter ("ignore" , category = UserWarning )
354- _bx_bar = quad (_bxb , self ._twiss .s [0 ], self ._twiss .s [- 1 ])[0 ] / self ._twiss .circumference
355- _by_bar = quad (_byb , self ._twiss .s [0 ], self ._twiss .s [- 1 ])[0 ] / self ._twiss .circumference
356- _dx_bar = quad (_dxb , self ._twiss .s [0 ], self ._twiss .s [- 1 ])[0 ] / self ._twiss .circumference
357- _dy_bar = quad (_dyb , self ._twiss .s [0 ], self ._twiss .s [- 1 ])[0 ] / self ._twiss .circumference
354+ _bx_bar = quad (_bxb , self ._twiss .s [0 ], self ._twiss .s [- 1 ])[0 ] / self ._twiss .line_length
355+ _by_bar = quad (_byb , self ._twiss .s [0 ], self ._twiss .s [- 1 ])[0 ] / self ._twiss .line_length
356+ _dx_bar = quad (_dxb , self ._twiss .s [0 ], self ._twiss .s [- 1 ])[0 ] / self ._twiss .line_length
357+ _dy_bar = quad (_dyb , self ._twiss .s [0 ], self ._twiss .s [- 1 ])[0 ] / self ._twiss .line_length
358358 # ----------------------------------------------------------------------------------------------
359359 # Calculate transverse temperature as 2*P*X, i.e. assume the transverse energy is temperature/2
360360 # We need the total energy and the particle mass in GeV hence the 1e-9 below
@@ -373,7 +373,7 @@ def coulomb_log(
373373 if bunched is True : # bunched beam
374374 volume = 8.0 * np .sqrt (np .pi ** 3 ) * sigma_x_cm * sigma_y_cm * sigma_t_cm
375375 else : # coasting beam
376- volume = 4.0 * np .pi * sigma_x_cm * sigma_y_cm * 100 * self ._twiss .circumference
376+ volume = 4.0 * np .pi * sigma_x_cm * sigma_y_cm * 100 * self ._twiss .line_length
377377 density = total_beam_intensity / volume
378378 debye_length = 743.4 * np .sqrt (TempeV / density ) / abs (self ._particle .q0 )
379379 # ----------------------------------------------------------------------------------------------
@@ -610,9 +610,9 @@ def integrals(
610610 Sxp : ArrayLike = 3 * self ._twiss .gamma0 ** 2 * phix ** 2 * ax * (R3 - R2 ) / sqrt_term
611611 # ----------------------------------------------------------------------------------------------
612612 # These are the integrands of the integrals in Eq (30-32) in Nagaitsev paper
613- Ix_integrand = self ._twiss .betx / (self ._twiss .circumference * sigx * sigy ) * (Sx + Sp * (self ._twiss .dx ** 2 / self ._twiss .betx ** 2 + phix ** 2 ) + Sxp )
614- Iy_integrand = self ._twiss .bety / (self ._twiss .circumference * sigx * sigy ) * (R2 + R3 - 2 * R1 )
615- Iz_integrand = Sp / (self ._twiss .circumference * sigx * sigy )
613+ Ix_integrand = self ._twiss .betx / (self ._twiss .line_length * sigx * sigy ) * (Sx + Sp * (self ._twiss .dx ** 2 / self ._twiss .betx ** 2 + phix ** 2 ) + Sxp )
614+ Iy_integrand = self ._twiss .bety / (self ._twiss .line_length * sigx * sigy ) * (R2 + R3 - 2 * R1 )
615+ Iz_integrand = Sp / (self ._twiss .line_length * sigx * sigy )
616616 # fmt: on
617617 # ----------------------------------------------------------------------------------------------
618618 # Integrating the integrands above accross the ring to get the desired results
@@ -739,7 +739,7 @@ class instead.
739739 "Using 'bunched=False' in this formalism makes the approximation of bunch length = C/(2*pi). "
740740 "Please use the Bjorken-Mtingwa formalism for a correct handling of Dy."
741741 )
742- bunch_length : float = self ._twiss .circumference / (2 * np .pi )
742+ bunch_length : float = self ._twiss .line_length / (2 * np .pi )
743743 # ----------------------------------------------------------------------------------------------
744744 # Ensure we update the integrals have been computed beforehand
745745 _ = self .integrals (gemitt_x = gemitt_x , gemitt_y = gemitt_y , sigma_delta = sigma_delta )
@@ -869,7 +869,7 @@ def _Gamma(
869869 * gemitt_x
870870 * gemitt_y
871871 * sigma_delta
872- * self ._twiss .circumference
872+ * self ._twiss .line_length
873873 )
874874
875875 def _a (self , gemitt_x : float , gemitt_y : float , sigma_delta : float ) -> ArrayLike :
@@ -1666,9 +1666,9 @@ def calculate_integral_vectorized(func: Callable) -> ArrayLike:
16661666 LOGGER .debug ("Getting average growth rates over the lattice" )
16671667 with warnings .catch_warnings (): # Catch and ignore the scipy.integrate.IntegrationWarning
16681668 warnings .simplefilter ("ignore" , category = UserWarning )
1669- Kx : float = float (quad (_kx , self ._twiss .s [0 ], self ._twiss .s [- 1 ])[0 ] / self ._twiss .circumference )
1670- Ky : float = float (quad (_ky , self ._twiss .s [0 ], self ._twiss .s [- 1 ])[0 ] / self ._twiss .circumference )
1671- Kz : float = float (quad (_kz , self ._twiss .s [0 ], self ._twiss .s [- 1 ])[0 ] / self ._twiss .circumference )
1669+ Kx : float = float (quad (_kx , self ._twiss .s [0 ], self ._twiss .s [- 1 ])[0 ] / self ._twiss .line_length )
1670+ Ky : float = float (quad (_ky , self ._twiss .s [0 ], self ._twiss .s [- 1 ])[0 ] / self ._twiss .line_length )
1671+ Kz : float = float (quad (_kz , self ._twiss .s [0 ], self ._twiss .s [- 1 ])[0 ] / self ._twiss .line_length )
16721672 emittance_rates = IBSEmittanceGrowthRates (Kx , Ky , Kz )
16731673 # ----------------------------------------------------------------------------------------------
16741674 # Important: the calculations of B&M yield emittance growth rates (this is what one gets in MAD-X
0 commit comments