n_rf_systems, harmonic_numbers, [v / n_sections for v in voltage_program], phi_offset, section_index=i)) # DEFINE BEAM------------------------------------------------------------------ beam = Beam(general_params, n_macroparticles, n_particles) # DEFINE TRACKER--------------------------------------------------------------- longitudinal_tracker = [] for i in range(n_sections): longitudinal_tracker.append(RingAndRFSection(RF_sct_par[i], beam)) full_tracker = FullRingAndRF(longitudinal_tracker) # DEFINE SLICES---------------------------------------------------------------- number_slices = 500 slice_beam = Slices(RF_sct_par[0], beam, number_slices, cut_left=0., cut_right=bucket_length) # BEAM GENERATION-------------------------------------------------------------- matched_from_distribution_function(beam, full_tracker, emittance=emittance,
C, momentum_compaction, sync_momentum, particle_type, number_of_sections=1) RF_sct_par = RFSectionParameters(general_params, n_rf_systems, harmonic_numbers, voltage_program, phi_offset) # DEFINE BEAM------------------------------------------------------------------ beam = Beam(general_params, n_macroparticles, n_particles) # DEFINE TRACKER--------------------------------------------------------------- longitudinal_tracker = RingAndRFSection(RF_sct_par, beam) full_tracker = FullRingAndRF([longitudinal_tracker]) # DEFINE SLICES---------------------------------------------------------------- number_slices = 500 slice_beam = Slices(RF_sct_par, beam, number_slices, cut_left=0., cut_right=bucket_length) # Single RF ------------------------------------------------------------------- matched_from_distribution_density(beam, full_tracker, distribution_options, main_harmonic_option='lowest_freq')
harmonic_numbers = [35640.0] voltage_program = [16e6] phi_offset = [0] # DEFINE RING------------------------------------------------------------------ general_params = GeneralParameters(n_turns, C, momentum_compaction, sync_momentum, particle_type) RF_sct_par = RFSectionParameters(general_params, n_rf_systems, harmonic_numbers, voltage_program, phi_offset) beam = Beam(general_params, n_macroparticles, n_particles) ring_RF_section = RingAndRFSection(RF_sct_par, beam) full_tracker = FullRingAndRF([ring_RF_section]) fs = RF_sct_par.omega_s0[0] / 2 / np.pi bucket_length = 2.0 * np.pi / RF_sct_par.omega_RF[0, 0] # DEFINE SLICES --------------------------------------------------------------- number_slices = 3000 slice_beam = Slices(RF_sct_par, beam, number_slices, cut_left=0, cut_right=21 * bucket_length) # LOAD IMPEDANCE TABLES -------------------------------------------------------