Logger(debug=True) # Set up machine parameters ring = Ring(N_t, C, alpha, p_s, Particle=Proton()) print("Machine parameters set!") # Set up RF parameters rf = RFStation(ring, 1, h, V, phi) #rf.omega_rf[0,0] = 2*np.pi*200.222e6 # cavity central frequency logging.debug("RF frequency %.6e Hz", rf.omega_rf[0, 0] / (2 * np.pi)) logging.debug("Revolution period %.6e s", rf.t_rev[0]) print("RF parameters set!") # Define beam and fill it beam = Beam(ring, N_m, N_b) bigaussian(ring, rf, beam, 3.2e-9 / 4, seed=1234, reinsertion=True) print("Beam set! Number of particles %d" % len(beam.dt)) print("Time coordinates are in range %.4e to %.4e s" % (np.min(beam.dt), np.max(beam.dt))) profile = Profile(beam, CutOptions=CutOptions(cut_left=0.e-9, cut_right=rf.t_rev[0], n_slices=4620)) profile.track() Commissioning = CavityFeedbackCommissioning(debug=True, open_loop=False, open_FB=False, open_drive=False) #Commissioning = CavityFeedbackCommissioning(debug=True, open_loop=True,
Logger(debug = True) # Set up machine parameters ring = Ring(C, alpha, p_s, Particle=Proton(), n_turns=N_t) print("Machine parameters set!") # Set up RF parameters rf = RFStation(ring, 1, h, V, phi) #rf.omega_rf[0,0] = 2*np.pi*200.222e6 # cavity central frequency logging.debug("RF frequency %.6e Hz", rf.omega_rf[0,0]/(2*np.pi)) logging.debug("Revolution period %.6e s", rf.t_rev[0]) print("RF parameters set!") # Single bunch bunch = Beam(ring, N_m, N_b) bigaussian(ring, rf, bunch, 3.2e-9/4, seed = 1234, reinsertion = True) # Create beam beam = Beam(ring, n_bunches*N_m, n_bunches*N_b) for i in range(n_bunches): beam.dt[int(i*N_m):int((i+1)*N_m)] = bunch.dt + i*rf.t_rf[0]*bunch_spacing beam.dE[int(i*N_m):int((i+1)*N_m)] = bunch.dE profile = Profile(beam, CutOptions = CutOptions(cut_left=0.e-9, cut_right=rf.t_rev[0], n_slices=46200))#4620*2)) profile.track() print(profile.Beam.ratio) plot_long_phase_space(ring, rf, beam, 0, 5e-9, -2e8, 2e8, dirname='fig', alpha=0.5, color=colors[0])