TUNE_SCAN (Updated May 3, 2005)
The main program and sample initialization files are in "/home/development/tune_scan". To run on OSF type "/home/dlr/development/bin/tune_scan" To run on LINUX type "/home/dlr/development1_linux/bin/tune_scan"
  • Description: Vary horizontal and/or vertical and/or synchrotron tunes over a rectangular grid and for each triplet of tunes track a single particle for N turns (typically N=1000) and determine the maximum vertical and horizontal amplitudes of the trajectory.
  • The result is a table of maximum amplitudes vs tune.
  • The parameters of the scan are given in an input file. An example of an input file is "/home/dlr/development/tune_scan/tunescan.in"
    ¶meters
        Qx_ini = 0.55    !tune for setup of lrbbi etc.
        Qy_ini = 0.58
        Q_x0 = 0.51      !horizontal tune at lower left of tune plane rectangle
        Q_y0 = 0.58      !vertical tune at lower left of tune plane rectangle
        Q_z0 = -0.1      !synchrotron tune at lower left of tune plane rectangle
        Q_x1 = 0.57      !horizontal tune at upper right 
        Q_y1 = 0.64      !vertical tune at upper right
        Q_z1 = -0.02     !synchrotron tune at upper right
        dQ_x = 0.002     !horizontal tune step. (There will be 0.06/0.002 horizontal steps)
        dQ_y = 0.002     !vertical tune step. (There will be 0.06/0.002 vertical steps)
        dQ_z = 0.001     !synchrotron tune step. (There will be 0.08/0.001 synch steps)
        Q_z  = -0.1       !synchrotron tune (if Q_z1-Q_z0 = 0, or if dQ_z = 0)
        lat_file = '~dlr/bmad/lat/low_emitt_ew_sym_20040503.lat'  !lattice file
        n_turn = 1000     !number of turns at each tune
        init(1)%vec(1) =  0.0022    !initial horizontal displacement of trajectory
        init(1)%vec(2) =  0.0       !initial horizontal angle
        init(1)%vec(3) =  0.000005  !initial vertical displacement
        init(1)%vec(4) =  0.0       !initial vertical angle
        init(1)%vec(5) =  0.0       !initial longitudinal displacement
        init(1)%vec(6) =  0.0006    !initial fractional energy offset
        particle = 1                !species, (1=positrons, -1=electrons)
        i_train = 1                 !train of bunch being tracked
        j_car = 1                   !car of bunch being tracked
        n_trains_tot = 9            !number of trains in strong beam
        n_cars = 4                  !number of cars in each train
        current = 1.                !strong beam bunch current (mA)
        lrbbi   = .true.            !turn on parasitic interactions
        beambeam_ip = .true.        !turn on beambeam interaction at IP
        close_pretz = .true.        !adjust horizontal separators to ensure collisions
        close_vert = .true.         !adjust vertical separators and vcrosing 7 to ensure collisions
        rec_taylor = .true.         !read digested file with appropriate bunch pattern and transfer 
                                         taylor coefficients
        slices = 5                  !Beam beam interaction is treated as  longitudinal kicks 
        coupling_sb = 0.01          !Emittance coupling assumed for determining size of strong beam
        single_particle = .true.
    /
    
  • The data is written to files "INPUT_FILENAME.out" and "INPUT_FILENAME.hed" so in our example that would be "tunescan.out" and "tunescan.hed".
  • If Q_z0 - Q_z1 = 0 or if dQ_z = 0, then you get the traditional scan of horizontal and vertical tune for fixed synchrotron tune (Q_z = Q_z0)
  • If Q_x0 - Q_x1 = 0 or if dQ_x = 0, then you get a scan of vertical vs synchrotron tune for fixed horizontal tune (Q_x = Q_x0)
  • If Q_y0 - Q_y1 = 0 or if dQ_y = 0, then you get a scan of horizontal vs synchrotron tune for fixed vertical tune (Q_y = Q_y0)
  • Use ~dlr/dvelopment/bin/plot_sb_scan to plot the output data
  • For scans with fixed synch tune the data can PLOTTED using the "PHYSICA" command file "scan_fix_synch.pcm"
    • To plot with physica type "physica"
    • At the prompt "PHYSICS:" type "@scan_fix_synch" (You will need to copy file "scan_fix_synch.pcm" from the directory /home/dlr/physica_macro/)
    • The scan data file prefix in the example above is "scan_example"
    • To make a hard copy type "hardcopy", then "s" to write a postscript file
  • For scans with fixed vertical tune the data can PLOTTED using the "PHYSICA" command file "scan_vert_synch.pcm"
  • Submitting multiple jobs to apc cluster
    • Create a directory sb_jobs/ and subdirectory sb_jobs/job_log/
    • Create a subdirectory that will hold the input and output files for your calculation sb_jobs/sb_test/
    • Move to the directory sb_jobs/ and create a soft link associating current_job/ to sb_test/ with the command "ln -s sb_test current_job
    • Create an input file "tunescan.in" in sb_jobs/sb_test/
    • Move to sb_jobs/sb_test/ and execute the program
      • /home/dlr/sb_jobs/scripts/bin/input ------ if you are on a linux machine, or
      • /home/dlr/sb_jobs/scripts/bin/input_osf ----- if you are on a unix machine
    • Specify the number of separate input files to create. If the tune plane grid is 35 by 35 you might specify 35 for x and 1 for y. Then you will get 35 input files, each with a single horizontal tune and 35 vertical tunes. The template is "tunescan.in".
    • You will now submit 35 separate jobs onto however many processors you have available.
    • OSF - The script /home/dlr/sb_jobs/scripts/subapc_sb will submit the jobs to the 21 apc nodes.
    • LINUX - The script /home/dlr/sb_jobs/scripts/subapc_sb_linux will submit the jobs to lnx313-316.
      • Log output is sent to sb_jobs/job_log/
      • Output files go to sb_jobs/sb_test/
    • On completion the output data can be combined.
      • Go to sb_jobs/sb_test/ and execute the program
        • /home/dlr/sb_jobs/scripts/bin/output ------ if you are on a linux machine, or
        • /home/dlr/sb_jobs/scripts/bin/output_osf ----- if you are on a unix machine
      • The number of x files is 35. The number y files is 1. The basename is "sb"
      • The data will be combined into a single file sb_combined.dat.
    • The combined data can be plotted using (OSF) /home/dlr/development/bin/plot_sb_scan or on LINUX /home/dlr/development1_linux/bin/plot_sb_scan