7.53 rf_setup

&rf_setup  
    STRING filename = NULL;  
    STRING name = NULL;  
    long start_occurence = -1;  
    long end_occurence = -1;  
    double s_start = -1;  
    double s_end = -1;  
    long set_for_each_step = 0;  
    double near_frequency = 0;  
    long harmonic = -1;  
    double bucket_half_height = 0;  
    double over_voltage = 0;  
    double total_voltage = 0;  
    long disable = 0;  
    long output_only = 0;  
    long track_for_frequency = 0;  
&end

This command must follow a twiss_output command that includes radiation integral computation, since the energy loss per turn is needed to set up the rf cavities. Note that the command includes features to allow selecting a subset of the RFCA elements in the beamline. The selected subset is assumed to include all of the cavities that will impart net energy to the beam.

This command stores values for bunch length in symbols Sz0 and St0, and also stores the fractional energy spread in Sdelta0, where they can be used in rpn expressions in subsequent commands, e.g.,

&bunched_beam  
 sigma_dp = "(Sdelta0)",  
 sigma_s = "(Sz0)",  
 ...  
&end

If performing rf setup in the presence of a non-zero orbit, the best procedure is to run rf_setup twice, in a sequence like the following

...  
! Compute nominal radiation integrals  
&twiss_output  
        radiation_integrals = 1  
&end  
! Perform nominal rf cavity setup  
&rf_setup  
        name = *,  
        harmonic = 1296  
        total_voltage = 9e6  
&end  
! Set up to compute the closed orbit, which may depened on radiation losses and rf cavity location  
&closed_orbit  
        output = %s.clo  
&end  
! Set up to compute twiss parameters and radiation integrals  
&twiss_output  
        filename = %s.twi  
        radiation_integrals = 1  
        output_at_each_step = 1  
&end  
! Set up to perform rf cavity setup  
&rf_setup  
        filename = %s.rf  
        name = *,  
        harmonic = 1296  
        total_voltage = 9e6  
        set_for_each_step = 1  
&end  
...

replace_elements