Ejemplo n.º 1
0
    def setUp(self):

        # Bunch parameters
        # -----------------

        N_turn = 200
        N_b = 1e9  # Intensity
        N_p = int(2e6)  # Macro-particles

        # Machine parameters
        # --------------------
        C = 6911.5038  # Machine circumference [m]
        p = 450e9  # Synchronous momentum [eV/c]
        gamma_t = 17.95142852  # Transition gamma
        alpha = 1. / gamma_t**2  # First order mom. comp. factor

        # Define general parameters
        # --------------------------
        self.general_params = Ring(C, alpha, p, Proton(), N_turn)

        # Define beam
        # ------------
        self.beam = Beam(self.general_params, N_p, N_b)

        # Define RF section
        # -----------------
        self.rf_params = RFStation(self.general_params, [4620], [7e6], [0.])
Ejemplo n.º 2
0
    ring = Ring(ring_length,
                alpha_0,
                bending_field,
                particle,
                synchronous_data_type='bending field',
                bending_radius=bending_radius)

    from blond_common.interfaces.input_parameters.rf_parameters import RFStation

    harmonic = [21, 28, 169]
    #voltage = [80e3, 0, 0]  # V, h21 Single RF
    voltage = [6e3, 20e3, 0]  # V, h21->h28 batch compression
    voltage = [0, 16.1e3, 12.4e3]  # V, h28->h169 rebucketting
    phi_rf = [np.pi, np.pi, np.pi]  # rad

    rf_station = RFStation(ring, harmonic, voltage, phi_rf, n_rf=3)

    from blond_common.rf_functions.potential import rf_voltage_generation

    n_points = 10000
    t_rev = ring.t_rev[0]
    voltage = rf_station.voltage[:, 0]
    harmonic = rf_station.harmonic[:, 0]
    phi_rf = rf_station.phi_rf[:, 0]
    time_bounds = [
        -ring.t_rev[0] / harmonic[0] * 2, ring.t_rev[0] / harmonic[0] * 2
    ]

    time_array, rf_voltage_array = rf_voltage_generation(
        n_points, t_rev, voltage, harmonic, phi_rf, time_bounds=time_bounds)
Ejemplo n.º 3
0
plt.ylabel('Energy [eV]')
plt.legend(loc='best')

# ## 2.1 Defining an RF station with a single RF system

# In[4]:

# Constant RF voltage, harmonic, phase program

from blond_common.interfaces.input_parameters.rf_parameters import RFStation

harmonic = 4620
voltage = 6e6  # V
phi_rf = 0  # rad

rf_station = RFStation(ring, harmonic, voltage, phi_rf)

# In[5]:

# Note that size of programs is (n_rf_systems, n_turns+1)
plt.figure('Programs-1')
plt.clf()
plt.plot(ring.cycle_time, rf_station.voltage[0, :] / 1e6)
plt.xlabel('Time [s]')
plt.ylabel('RF Voltage [MV]')

# In[6]:

# Using an RF program, the same can be done for the harmonic and phi_rf
# The rf program should be an array/list of size n_turns+1
# NB: the phase is not automatically adjusting if a non-integer harmonic is set