# LOAD IMPEDANCE TABLES-------------------------------------------------------- var = str(kin_beam_energy / 1e9) # ejection kicker Ekicker = np.loadtxt( this_directory + '../input_files/EX_02_Ekicker_1.4GeV.txt', skiprows=1, dtype=complex, converters={ 0: lambda s: complex(bytes(s).decode('UTF-8').replace('i', 'j')), 1: lambda s: complex(bytes(s).decode('UTF-8').replace('i', 'j')) }) Ekicker_table = InputTable(Ekicker[:, 0].real, Ekicker[:, 1].real, Ekicker[:, 1].imag) # Finemet cavity F_C = np.loadtxt(this_directory + '../input_files/EX_02_Finemet.txt', dtype=float, skiprows=1) F_C[:, 3], F_C[:, 5], F_C[:, 7] = np.pi * F_C[:, 3] / 180, np.pi * F_C[:, 5] / 180, np.pi * F_C[:, 7] / 180 option = "closed loop"
PL = BeamFeedback(ring, rf, profile, config, PhaseNoise=LHCnoise, LHCNoiseFB=noiseFB) mpiprint(" PL gain is %.4e 1/s for initial turn T0 = %.4e s" % (PL.gain, ring.t_rev[0])) mpiprint(" SL gain is %.4e turns" % PL.gain2) mpiprint(" Omega_s0 = %.4e s at flat bottom, %.4e s at flat top" % (rf.omega_s0[0], rf.omega_s0[n_turns])) mpiprint(" SL a_i = %.4f a_f = %.4f" % (PL.lhc_a[0], PL.lhc_a[n_turns])) mpiprint(" SL t_i = %.4f t_f = %.4f" % (PL.lhc_t[0], PL.lhc_t[n_turns])) # Injecting noise in the cavity, PL on # Define machine impedance from http://impedance.web.cern.ch/impedance/ ZTot = np.loadtxt(os.path.join(inputDir, 'Zlong_Allthemachine_450GeV_B1_LHC_inj_450GeV_B1.dat'), skiprows=1) ZTable = InputTable(ZTot[:, 0], ZTot[:, 1], ZTot[:, 2]) indVoltage = InducedVoltageFreq( beam, profile, [ZTable], frequency_resolution=freq_res) totVoltage = TotalInducedVoltage(beam, profile, [indVoltage]) # TODO add the noiseFB tracker = RingAndRFTracker(rf, beam, BeamFeedback=PL, Profile=profile, interpolation=True, TotalInducedVoltage=totVoltage, solver='simple') # interpolation=True, TotalInducedVoltage=None) mpiprint("PL, SL, and tracker set...") # Fill beam distribution fullring = FullRingAndRF([tracker]) # Juan's fit to LHC profiles: binomial w/ exponent 1.5 # matched_from_distribution_function(beam, fullring, # main_harmonic_option = 'lowest_freq',