BMADZ Lattice Design Program
One program that is not included in the Distribution is
BMADZ which is used for designing storage ring lattices and control room knobs.
BMADZ was developed for designing Cornell CESR lattices but it can be applied to other storage rings as well.
Note: Unless you know otherwise, it is better to use the Tao program included in the Distribution. That is, do not bother to download BMADZ unless you really know you need it.
To download
BMADZ: First download a
Distribution. Then, in the distribution root directory, download the cesr_utils and bmadz directories:
svn co https://accserv.lepp.cornell.edu/svn/CESR/CESR_libs/cesr_utils
svn co https://accserv.lepp.cornell.edu/svn/trunk/src/bmadz
To compile, use the following commands:
cd cesr_utils
mk
cd ../bmadz
mk
The [cesr]login command file defines symbols:
BMADZ = run [cesr.bmad.codez]bmadz
BMADZ_DEB = run [cesr.bmad.codez]bmadz_deb (the version of the code
compiled and linked with debug)
The constraint file is entered on the command line. Constraint files have a default ".IN" suffix. For example, with the constraint file CONS.IN you run
BMADZ by typing:
$ BMADZ CONS
The lattice file can also be specified on the command line and if this is done then the lattice specified in the constraint file is superceeded. Example:
$ BMADZ CONS BMAD_N9A18A70A.FD_4S_15KG
If you would like to see the values of the parameters specified in the constraint file as well as a plot of beta, eta, and closed orbits, and do not want to optimize then type:
$ BMADZ CONS BMAD_N9A18A70A.FD_4S_15KG PLOT
Constraint file
The constraint file is broken into 4 parts.
The first part is the list of variables to use in the optimization. The first line of the variable use list is "$USE_LIST" and the last line is "$END". Each line in between is in the form:
USE <ELEMENT> <ATTRIBUTE_TO_VARY> <STEP_SIZE> <MIN_VALUE> <MAX VALUE>
Example:
$USE_LIST
use q01w k1 0.001 -2.6 -0.5 ! comments are allowed
use qadd_47w k1 0.001 -0.5 -0.01
use sk3w k1 0.1 -0.5 0.5
use h_sep_45w hkick 0.0001 0.0 0.001
use v_sep_48w vkick 0.00002 0.0 0.0015
$END
The second part is the list of sextupoles to use in the minimization of sextupole moments Example:
$USE_LIST_SEXT
use SEX_21W k2 0.001 -4.0 -0.01
use SEX_21E k2 0.001 -4.0 -0.01
use SEX_42W k2 0.001 0.0 4.0
use SEX_43W k2 0.001 -4.0 -0.01
$END
The third part is the constraint list which specifies how to construct the figue_of_merit function that the optimizer wants to minimize. The first line of the constraint list is "$CONSTRAINT_LIST" and the last line is "$END". Each line inbetween is in the form:
<CONSTRAINT> <PLANE> <TYPE_PREFIX> <TYPE> <TARGET_VALUE> <WEIGHT> <LOC1> {to <LOC2>}
Example:
$CONSTRAINT_LIST
BETA X TARGET 1.0 1.0e3 IP_L0
BETA Y TARGET 0.018 1.0e5 IP_L0
ETA X TARGET 0.0 1.0e4 IP_L0
BETA Y MAX 39.0 1.0e2 Q03W to QADD_47W
ALPHA Y MAX 0.001 1.0e8 IP_L3
Q Y MAX 0.595 1.0e5 GLOBAL
PHASE X TARGET 5.26 1.0 IP_L0 to IP_L3
BETAX_BETAY X TARGET 0.0 1.e02 Q48W
ALPHAX_ALPHAY X TARGET 0.0 1.e02 Q48W
PHIX_PHIY X TARGET 0.5 1.e02 Q48W to Q48E
LRBBI_DEL_Q X MAX 7.2e-4 30. GLOBAL
LRBBI_DEL_Q Y MAX 0.0011 30. GLOBAL
CHROM X MIN -20.0 0.0 GLOBAL
CHROM Y MIN -25.0 0.0 GLOBAL
PRETZ_APERTURE X MAX 0.045 1.0e6 ARC
PRETZ_APERTURE X MAX 0.0525 1.0e2 IR
PRETZ_EFFICIENCY N MIN 0.7 1.0e3 GLOBAL
PHASE X TARGET 0.78 10. IP_L0 to H_SEP_08W
APERTURE X MAX 0. 0. IR
APERTURE Y MAX 0. 0. IR
DISPLACEMENT X TARGET 0. 1.e04 IP_L0
DISPLACEMENT Y TARGET 0. 1.e05 IP_L0
DISPLACEMENT Y TARGET 0. 1.e06 Q05W
DISPLACEMENT Y TARGET 0. 1.e06 Q07W
DISPLACEMENT Y MIN 0.006 1.e04 IP_L3
CO_ANGLE X MAX 0.0029 1.e6 IP_L0
CO_ANGLE X MIN 0.0015 1.e1 IP_L0
CO_ANGLE X TARGET 0.0024 1.0 IP_L0
I_BUNCH N MIN 10.0 1.e2 GLOBAL
WIG_EMITTANCE N MAX 2.e-7 1.0 GLOBAL
EMITTANCE N MAX 2.e-7 1.0 GLOBAL
SEP_VOLT N MAX 90. 100.0 GLOBAL
WELCH_TEMNYKH N MAX 1.1 1.0 GLOBAL
C11 N TARGET 0.0 1.0 IP_L0
C12 N TARGET 0.0 1.e05 IP_L0
C21 N TARGET 0.0 1.0 IP_L0
C22 N TARGET 0. 1. IP_L0
C11 N TARGET 0. 1.e04 IP_L3
C12 N TARGET 0. 1.e04 IP_L3
C21 N TARGET 0. 1.e05 IP_L3
C22 N TARGET 0. 1.e04 IP_L3
MOMENTUM_COMP N MAX 0.012 1. GLOBAL
VARIABLE_LIMIT N MAX 0. 1.e05 GLOBAL
SEXT_MOMENTS N MAX 0. 1.e02 GLOBAL
SEXT_SYMMETRY N MAX 0. 1.e0 GLOBAL
SIGN_SYMMETRY N MAX 0. 0.0 SEX_8W to SEX_44W
NONLIN_Q X TARGET 0.0 0.0 GLOBAL
TONALITY X TARGET 0. 5.0e04 GLOBAL
DELTA_BETA X TARGET 0. 125. Q01W to Q01E
DBETA_DCOS X MAX 0.0 1.0E0 IP_L0
DBETA_DSIN X MAX 0.0 1.0E0 IP_L0
COUPLING_A_REAL N MAX 0.0 50.0e0 Q01W to Q01E
COUPLING_A_IMAGE N MAX 0.0 50.0e0 Q01W to Q01E
COUPLING_B_REAL N MAX 0.0 50.e0 Q01W to Q01E
COUPLING_B_IMAGE N MAX 0.0 50.0e0 Q01W to Q01E
CHI2 N MAX 1000000. 0.01 GLOBAL
DET_4BY4 N TARGET 0. 1.e0 FULL_TURN
DET_2BY2_UL N TARGET 0. 1.e0 FULL_TURN
DET_2BY2_LR N TARGET 0. 1.e0 FULL_TURN
TRACE N Target 0. 1.e0 FULL_TURN
$END
<CONSTRAINT>:
- ALPHA
- Twiss parameter - computed for positron closed orbit
- ALPHAX_ALPHAY
- Difference of alphax and alphay - computed for positron closed orbit
- ALPHA_XX, ALPHA_XY, ALPHA_YY
- Detuning coefficents from sextupoles from S.Y.Lee page 191. XX is horizontal detuning due to horizontal amplitude, XY is horizontal detuning due to vertical amplitude and YY is vertical detuning due to vertical amplitude
- APERTURE
- RMS beam size, vertical uses sigma = sqrt(0.5*emitt_x*beta_y)
- AVG_ETA_BEAM
- Average dispersion of electron and positron beams
- BETA
- Twiss paramter for positron closed orbit
- BETAX_BETAY
- Difference of betax and betay for positron closed orbit
- B_PARAM_I
- Like welch temnyk except sqrt(beta_x * emittance) is replaced by beam size including dispersion. Gives bunch current in ma consistent with acceptable value of b_param
- B_EFFICIENCY
- Ratio of minimum contributor to B_PARAM_I to maximum This parameter will be independent of pretzel scale
- C11, C12, C21, C22
- Elements of the 2x2 coupling matrix for positron closed orbit
- CBAR11, CBAR12, CBAR21, CBAR22
- Elements of the normalized 2x2 coupling matrix for positron closed orbit
- CHI2
- chi2 for least square minimization of sextupole moments
- CHROMATICITY
- Chromaticity: Linear mode: Sum beta*k Nonlinear mode: (Q(+delta E) -Q(-delta E))/2 delta E computed using NONLINEAR_CLOSED_ORBIT
- C_MAT_CHROM12
- Energy dependence of c12 at IP
- COUPLING_A_REAL
- Coupling at each point dues to displaced orbit in sextupoles is described by four parameters. A_REAL, A_IMAGE, B_REAL, B_IMAGE are linear combinations of C's.
- CO_ANGLE
- Pretzel angle. If plane = None then co_angle is amplitude: sqrt(x'^2 + y'^2)
- CURLY_D
- Curly_d is zero for an on-axis closed orbit. This is the sum of displacement*k*eta in quadrupoles and if it adds to zero, damping is independent of pretzel. The eta in the calulation is for positrons. And of course since eta changes with the closed orbit, this is only good to lowest order
- DBETA_DCOS
- Amplitude dependence of beta for cos-like trajectory due to sextupoles, computed in subroutine sextupole_moments (nonlin_mod.f90)
- DBETA_DPRETZ
- Dependence of beta on pretzel due to sextupoles. The quantity constrained is the pretzel on - pretzel off value of beta
- DBETA_DSIN
- Amplitude dependence of beta for sin-like trajectory due to sextupoles, computed in subroutine sextupole_moments (nonlin_mod.f90)
- DCBAR11, DCBAR12, DCBAR21, DCBAR22
- The 4X4 map through the interaction region, from eastern most compensating_ele to western most, is decomposed into normal modes. DCBAR are the energy derivatives of the CBAR elements. Computed with cbar_v_e
- DCHROM
- Derivative of chromaticity with respect to energy. Computed with NONLINEAR_TWISS
- DELTA_BETA
- Energy dependence of beta due to quadrupoles and sextupoles = d(beta)/d(delta E/E)
- DELTA_ALPHA
- Energy dependence of alpha due to quadrupoles and sextupoles = d(alpha)/d(delta E/E)
- DELTA_PHI
- Energy dependence of phase due to quadrupoles and sextupoles = d(phi)/d(delta E/E)
- DELTA_BETA_QUAD
- Energy dependence of beta due to quadrupoles
- DET_4BY4
- Difference of determinant of 4X4 jacobian from unity. In a linear machine the jacobian is 1. It is computed on the basis of trajectories with starting point displaced incrementally (in transverse phase space) from the closed orbit. The incremental displacement is defined by the first N_DET_CALC points in the DISP_FILE and the energy in ENERGY_OFFSET (see below)
- DET_2BY2_UL
- Difference of determinant of the 2X2 upper left block of the jacobian from unity
- DET_2BY2_LR
- Difference of determinant of the 2X2 lower left block from unity
- DIF_CBAR11_CBAR22
- cbar11-cbar22 for positron closed orbit
- DIF_CBAR12_CBAR21
- cbar12-cbar21 for positron closed orbit
- DIFF_DISPLACE
- Difference in displacement of electron and positron closed orbits. If plane = None then displacement is amplitude: sqrt(x^2 + y^2)
- DISPLACEMENT
- Displacement of closed oribt. If plane = None then displacement is amplitude: sqrt(x^2 + y^2)
- DX_VCROS5
- dX/dVCROS5 where vcros5 is antisymmetric vertical separator kick in rad
- DX_VCROS7
- dX/dVCROS7. RAW_VCROSING_7 must be defined
- D_BETA_BEAM
- Difference in beta for positrons and electrons
- D_ALPHA_BEAM
- Difference in alpha for positrons and electrons
- D_ETA_BEAM
- Difference in eta for positrons and electrons
- D_CURLY_D
- Difference in curly_d (damping parition numbers) for electrons and positrons
- DX_PRETZ1
- dX/dPRETZ1 where pretz1 is proportional change in horizontal separators in mrad
- DX_PRETZ13
- dX/dPRETZ13 where pretz13 is symmetric change in horizontal separators at 8W and 8E in rad
- D_PATH_LENGTH
- Difference in path length for electrons and positrons if those numbers have been computed. The separate calculation for: electrons and positrons is triggered by any of the following D_BETA_BEAM, D_ALPHA_BEAM, D_XEMIT, D_CURLY_D, TONALITY
- D_XEMIT
- Difference in horizontal emittance for electrons and positrons
- ELEC_CO_ANGLE
- Pretzel angle for electrons. If plane = None then co_angle is amplitude: sqrt(x'^2 + y'^2)
- ELEC_DISPLACE
- Displacement of electron closed oribt. If plane = None then displacement is amplitude: sqrt(x^2 + y^2)
- ELEC_EMITT
- Electron horizontal emittance
- ELE_FEEDBK_PHASE
- Phase advance in units of betatron wavelengths from feedback pickup at 5W clockwise around the machine (electron direction) to the kicker near 10W. Specify plane. (See also POS_FEEDBK_PHASE)
- EMITTANCE
- Emittance (positrons). Includes wigglers. There is no difference between this constraint and WIG_EMITTANCE
- ENERGY_SPREAD
- Energy spread for positron closed orbit
- ETA
- Dispersion for positron closed orbit
- ETAP
- Dispersion derivative for positron closed orbit
- ETAP_ELECTRONS
- Dispersion derivative for electron closed orbit
- I_BUNCH
- Bunch current. This goes with WELCH_TEMNYKH, and LRBBI
- LRBBI_DEL_Q
- Long range beam beam tune shift
- MOBIUS_BETA
- Projected x and y betas for a coupled lattice for positron closed orbit
- MOBIUS_ETA
- Projected x and y dipersion for a coupled lattice for positron closed orbit
- MOMENTUM_COMP
- Momentum compaction for positron closed orbit
- NONLIN_Q
- Tune of positron orbit computed with NONLINEAR_TWISS
- PHASE
- Betatron phase advance in units of 2pi for positron closed orbit
- PHIX_PHIY
- Difference in phase advance for positron closed orbit
- POS_FEEDBK_PHASE
- Phase advance in units of betatron wavelengths from feedback pickup at 5W counterclockwise around the machine (positron direction) once and then to the kicker near 10W. Specify plane. Vertical kicker is at 55.09 m from IP, and horizontal kicker is 56.55 m from IP (near 10W). The pickup is at element indicated. The number of turns is the integer part of the specified number of wavelengths. (See also ELE_FEEDBK_PHASE)
- PRETZ_APERTURE
- Pretzel displacement (positron closed orbit) + 7.2 * sigma_x
- PRETZ_EFFICIENCY
- Ratio of minimum separation to maximum pretzel amplitude normalized to sqrt(beta x)
- Q
- Fractional Tune. 0 < Q < 1 for positron closed orbit
- Q_ELE
- Fractional Tune. 0 < Q < 1 for electron closed orbit
- Q_TOT
- Tune in units of 2pi for positron closed orbit
- QS_2QX, QS_2QX_COS, QS_2QX_SIN
- Magnitude, cos-like, and sin-like components of the m=21 fourier coefficient of F(s) = (S(s) * eta(s) +K(s)) * L(S), the driving term for the Qs-2Qx=21 resonance.
- QS_2QX_ELE, QS_2QX_COS_ELE, QS_2QX_SIN_ELE
- Magnitude, cos-like, and sin-like components of electrons of the m=21 fourier coefficient of F(s) = (S(s) * eta(s) +K(s)) * L(S), the driving term for the Qs-2Qx=21 resonance.
- QS_2QX_TRACK
- Maximum amplitude after QS_2QX_TRACK turns, at Qx=0.542, Qy=0.58, Qz=-0.089, and xinit=0.0025, yinit=0.000025, delta_e_init = 0.002 Set QS_2QX_TRACK as a Single Variable
- SEP_VOLT
- Separator voltage
- SEX_K2^4
- Sextupole k^4. If this constraint is used then the subroutine SEX_K2_CALC is used instead of MINIMIZE_MOMENTS.
- SEXT_MOMENTS
- There are ten linear combinations of sextupole strengths that determine the geometric 3rd order sextupole resonances (that is, all the 3rd order resonances without the synchrobetatron resonances). Since it is generally desirable and possible to make them all zero, the same weight is attached to them all. Note: Calculation is done assuming non-tilted sextupoles and no coupling.
- SEXT_RESONANCES
- This is for all 72 3rd order sextupole resonance terms. This overlaps SEXT_MOMENTS so you should not use both. More weight is given to resonances closest to the operating point. See JZ_JA_BETAZ_RATIO, DEL_Q_RES_MIN, Q_Z Note: Caluclation is done assuming non-tilted sextupoles but coupling can be present.
- SEXT_SYMMETRY
- Difference in east west
- SIGMA_SEP
- Minimum separation of all parasitic crossings in units of local beam sigma
- SIGN_SYMMETRY
- Difference in sextupole from nominal sign
- SUM_CBAR11_CBAR22
- cbar11+cbar22 computed for positron orbit
- SUM_CBAR12_CBAR21
- cbar12+cbar21 computed for positron orbit
- SYNC_BETA_PATH
- difference in closed orbit invariant amplitude at IP for 6-d closed orbit with RF on and 4-d closed orbit normalized by total RF voltage. Specify plane. See bmadz/code/synchro_beta.f90 (subroutine sync_beta_path)
- SYNC_BETA_VOLT
- derivative of 6-d closed orbit amplitude at IP with respect to total RF voltage. Specify plane. See bmadz/code/synchro_beta.f90 (subroutine sync_beta_volt)
- TONALITY
- Difference in tune for electrons and positrons. Compute closed orbits, transfer matrices about them, and then twiss parameters and tunes for positrons and electrons. Units are kHz.
- UNSTABLE_RING
- Adds a penalty if the ring is unstable then
- VARIABLE_LIMIT
- Weight to use if a variable is out of range.
- WIG_EMITTANCE
- Emittance with wigglers
- WELCH_TEMNYKH
- Measure of the long range beam-beam interaction. W_T is the maximum of the W_T computed for each bunch. W_T for an individual bunch is: sum [ (beta_y * beta_x * emit_x * sep2_inv * 0.1)**2 ] per ma where the sum is over all parasitic crossings for the bunch.
<PLANE>
-
- X X-plane
- Y Y-plane
- N No plane
- <TYPE_PREFIX>
- This modifies the figure_of_merit calculation defined by <TYPE>
" " (blank) | No modification. |
AMP | actual_value -> abs(actual_value) |
REL | figure_of_merit -> figure_of_merit / target_value^2 |
$ <TYPE>:
TARGET |
figure_of_merit = ((actual_value - target_value) * weight)^2 |
MIN |
figure_of_merit = (min(actual_value - target_value, 0) * weight)^2 |
MAX |
figure_of_merit = (max(actual_value - target_value, 0) * weight)^2 |
- <TARGET_VALUE>
- If the actual value is equal to the <TARGET_VALUE> then the contribution to the figure of merit from the constrant is zero. Instead of a number, if the word "INITIAL_VALUE" is used then the target_value will be taken to be the initial value of the constraint before any variables are changed.
- <WEIGHT>
- weight given to the figure of merit.
- <LOC1>, <LOC2>
- locations in the ring for evaluation
Single variables
- BETA_X_INIT = Real, BETA_Y_INIT = Real
- When there is an unstable ring: Used as the initial beta at the IP. This is a fudge so the program will not bomb.
- BunchPattern = character*64
- Name of a file with positron and electron bunch pattern. If this file is present, then N_TRAIN, N_CARS, N_14NS_SPACE are all ignored. The bunch pattern is given in terms of the 183, 14ns time slots. The electron and positron patterns may be different, and may have different numbers of bunches. Example of BunchPattern file: bunchpattern.in
&bunchpattern PositronBuckets = 1 2 21 22 41 42 62 63 82 83 102 103 127 128 143 144 163 164 ElectronBuckets = 15 16 35 36 55 56 76 77 96 97 116 117 137 138 157 158 177 178 /
- CIRCULAR_MACHINE = Logical
- true for closed lattice, false for transfer line
- COMPENSATING_ELE
- List of 2, 3, or 4 skew elements that will be used to compensate solenoid coupling. For example, if
- COMPENSATING_ELE = 'SC_SK_Q01',' SC_SK_Q02','SK_Q02' then the values of the strengths of the 3 skew quad pairs will be computed for 3 pair compensation. Each element must be an overlay of east/west symmetrically placed magnets. DO NOT include these elements in the use_list. Their values will be uniquely determined to compensate the solenoid. If 4 elements are specified then the 4 pair compensation algorithm will be used. If 2 elements are specified then global coupling is compensated. If the permanent magnet quadrupole appears in the list, its TILT attribute will be varied. The element furthest from the IP defines the compensation region for constraint DCBAR
- CURRENT = real (mA)
- If CURRENT /= 0, then long range beam beam interactions are added. The crossing points will correspond to bunch J_CAR, train 1 in the weak beam, with N_TRAINS, by N_CARS in the strong beam. Bunch current is CURRENT. Note that parameters N_TRAINS, N_CARS, and J_CAR are specified as "Single Variables". If there is an INITIAL_LAT_FILE specified, then the same parasitic crossings are added to it but with current 0.001.
- DBETA_EXACT = Logical (default = .false.)
- Determines whether the DELTA_BETA constraint is calculated assuming no coupling and nontilted quads (the fast way) or whether it is calculated via matrix multiplication (the slow way) that does not make any assumptions about coupling.
- DEFINE_SPECIAL_VARIABLES = 'file_name'
- Name of the file that will define groups or overlays to be used as variables in optimization
- DELTA_E = Real (default = 3 * 10^-3)
- Change in energy to use with dbeta_exact = .true. calculation.
- DEL_Q_RES_MIN = Real
- In determining the weight for various terms with SEXT_RESONANCES: Minimum tune difference (in units of 2pi) between a resonance and the operation point.
- DISP_FILE = file name
- Displacements used to compute jacobian
- ELECTRON_OFFSET = Integer
- Timing offset of electron bunches with respect to positron bunches. The value of ELECTRON_OFFSET is an integer from 1 to 19. It is in units of 14ns. If there are 9 trains with 2 bunches per train of positrons then the positron bunch configuration is 1,2,21,22,41,42,62,63,... and the electron configuration is 1+N,2+N,21+N,22+N,41+N,42+N,62+N,63+N,..., where N=ELECTRON_OFFSET
- ENERGY_OFFSET = Real,Real,Real
- If NONLINEARITY is true then parameters of orbits with 3 different energy offsets are computed
- EXCLUDE_LRBBI = 'G1', 'G2'
- You may want to exclude a particular parasitic crossing. Specify the name of the element
- HYBRIDIZE = Logical (default = .false.)
- Hybridization will speed things up at the expense of some accuracy
- INITIAL_LAT_FILE = 'file_name'
- Name of the lattice file that will be used to compute initial lattice parameters so that design parameters can be constrained with respect to those in the INITIAL_LAT_FILE using "INITIAL_VALUE" as the TARGET VALUE in the constraint list. If no INITIAL_LAT_FILE is specified then, initial_values are those of LAT_FILE
- J_CAR = Integer
- J_CAR is the weak beam bunch for which figure of merit is computed. (The weak beam train is always train 1) Strong beam bunch distribution is specified by "Single variables" N_TRAINS and N_CARS. Strong beam bunch current is "Single variable" CURRENT. If CURRENT=0, then no strong beam is introduced.
- JZ_JA_BETAZ_RATIO = Real
- Jz / (Ja * Beta_z) ratio where Jz is the longitudinal action, Ja is the transverse action, and Beta_z is the longitudinal beta. Used in the calculation of the weights for the synchro-betatron terms with SEXT_RESONANCES. JZ_JA_BETAZ_RATIO has units of 1/meters. For example, for a particle with dE/E = 3*10^-3 (typical 5 sigma) then Jz/beta_z = 10^-5. With a_amplitude = 10^-2 m and with beta_a = 10 m then J_a = 10^-5 m. In this case Jz/(Ja*beta_z) = 1.
- LAT_FILE = 'file_name'
- Name of the lattice file.
- MINIMIZE_MOMENTS = Logical
- Set true to compute a set of sextupole strengths that minimizes moments, including SEXT_MOMENTS, SEXT_SYMMETRY, SIGN_SYMMETRY TONALITY, DELTA_BETA, DBETA_DCOS, DBETA_DSIN, COUPLING_A_REAL, etc. Note that moments can be computed and minimized if NONLINEARITY is set false.
- N_CARS = Integer
- Number of cars in a train
- N_CYCLES = Integer
- Number of optimizer steps per loop. The total number of steps when the optimizer is involked is N_LOOPS*N_CYCLES. See also N_LOOPS.
- N_DET_CALC = Integer (default = 6)
- How many sets of trajectories are used to calculate DET_4BY4, DET_2BY2_UL, and DET_2BY2_LR.
- N_LOOPS = Integer
- Number of times the optimizer is called when it is involked. See also N_CYCLES.
- N_TRAINS = Integer
- Number of trains in a bunch
- N_14NS_SPACE = Integer
- Spacing between cars in units of 14 nsec
- NONLINEARITY = Logical
- true to calculate nonlinearities including energy and amplitude dependence of beta, determinants pretzel tunes etc.
- OPTIMIZER = {'FRPRMN','MINIDEL', 'MANUAL_OPT', 'MINOP','LINEAR', 'MARQUARDT'}
- Optimizer to use. 'MANUAL_OPT' allows the user to change variables manually. Any variable that is specified in the use list may be changed. 'LINEAR' assumes that the number of variables is the same as the number of parameters. The dependence of variables on parameters is linearized and the solution determined by matrix inversion.
- PLOT = Logical
- Set true to plot beta, eta, closed orbits
- PRETZEL = Logical
- Set true to calculate pretzel aperture, separation, long range tune shift, welch-temnykh etc.
- PRE_INIT_SET_FILE = string - bmad input format
- This is a bmad input file that will be appended to both the input lattice (LAT_FILE) and the reference lattice file (INITIAL_LAT_FILE). For example: To turn off separator 8W in both the lat_file and the initial_lat_file the PRE_INIT_SET_FILE would have the line H_SEP_08W[HKICK]:=0.
- POST_INIT_SET_FILE = string - bmad input format
- This is a bmad input file that will be appended to the input lattice (LAT_FILE) but not the reference lattice file (INITIAL_LAT_FILE). For example: If you want the optimizer to compensate for a change in Q49E the POST_INIT_SET_FILE would have the line k1_save = Q49E [k1] Q49E [k1]:=k1_save+0.01
- QS_2QX_TURNS = integer
- Number of turns to track for constraint QS_2QX_TRACK
- Q_Z = Real
- Longitudinal tune. Used, e.g., with SEXT_RESONANCES.
- SET_REFERENCE = Logical (default = .true.)
- If set True then target values with the sextupole calculation will be relative the natural values with no sextupoles. For example, if the chromatisity has a target a value of VALUE, then with SET_REFERENCE = True the actual target value for the change in chromatisity between sextupoles on verses off is VALUE - The_natural_chromatisity. $ SOL_COM = integer OBSOLETE! See COMPENSATING_ELE:
- SPECIAL_OUTPUT = file_name
- A group element is computed and written into the output file named file_name.dat. The group elements are the variables in the USE_LIST. The coefficients are the differences
- n the values of the variables between initial and final lattice. The possible groups are: BETASING1, BETASING2,... BETASING9, VCROSING7, SCMATING1 - SCMATING10, ROTQ_NOB, PHASING, ANYTHING, DX_PRETZ1, DX_PRETZ13, DX_VCROS5, DX_VCROS7 VNOSEING1-3, XQUNEING1-4 Coefficients are written to the file <'name'ing_#>.dat
- f the initial and final lattice are already computed, set the optimizer to and the coefficients will be written.
- SYMMETRY = {'EW_ANTISYMMETRY', 'NO_SYMMETRY', 'MOBIUS_SYMMETRY'}
- NO_SYMMETRY means there is no symmetry in the ring. EW_ANTISYMMETRY is where the quad strengths are east west symmetric and the IR quads are rotated anti-symmetrically. With EW_ANTISYMMETRY the east side is automatically varied to maintain the correct symmetry. That is, you use EW_ANTISYMMETRY' if you only need to control the west side (speeds up computations too). Note that CESR lattices are normally set to NO_SYMMETRY since it is not assumed that you want to maintain symmetry.
If symmetry is not set then the default is what is specified from the lat file and if the symmetry is not set in the lat file then the default symmetry is NO_SYMMETRY.
MOBIUS_SYMMETRY is identical to NO_SYMMETRY at this point in time. In the future it may be used to indicate special computations for a mobius lattice.
- SEXTUPOLE_SYMMETRY = {'NO_SYMMETRY' or 'EW_SYMMETRY'}
- Used in minimization of moments. 'EW_SYMMETRY' => zero tonality
- USE_SEXTUPOLE_FOM = Logical (default = .false.)
- If set True then the chi^2 from the constraints that are used for sextupole optimization (eg DELTA_BETA, TONALITY, etc.) are added to the regular figure_of_merit.
SEXTUPOLE DISTRIBUTIONS
In the input file, the east and west sextupoles are grouped so that they are adjusted antisymmetrically. The following are near pretzel maxima for best leverage. The ranges are chosen so that none will be less than zero.
NONLIN_Q is the tune of the pretzeled orbit. Q is the tune for the on axis orbit. Set the difference of NONLIN_Q and Q to the tonality you want
Lattice file: BMAD_ "lattice name"
! this is a test of spec_read
$USE_LIST
use sex_08a command 0.01 -0.3 0.3
use sex_09a command 0.01 -0.2 0.2
use sex_14a command 0.01 -0.1 0.1
use sex_24a command 0.01 -0.1 0.1
use sex_32a command 0.01 -0.1 0.1
use sex_33a command 0.01 -0.5 0.5
use sex_34a command 0.01 -0.2 0.2
use sex_38a command 0.01 -0.2 0.2
use sex_44a command 0.01 -0.1 0.1
$END
$CONSTRAINT_LIST
BETA X TARGET 1.0 1.0e2 IP_L0
BETA Y TARGET 0.018 1.0e3 IP_L0
ETA X TARGET 0.0 1.0e2 IP_L0
BETA X MAX 39.0 1.0e0 Q03W to QADD_47W
BETA Y MAX 39.0 1.0e1 Q03W to QADD_47W
BETA X MAX 57.0 1.0e1 Q48W
BETA Y MAX 57.0 1.0e1 Q48W
BETA X MAX 37.0 1.0e1 Q49W
BETA Y MAX 37.0 1.0e1 Q49W
BETA X MAX 100. 1.0e1 IP_L0 to Q03W
BETA Y MAX 100. 1.0e1 IP_L0 to Q03W
ALPHA X AMP_MAX 0.002 1.0e8 IP_L3
ALPHA Y AMP_MAX 0.002 1.0e8 IP_L3
ETAP X MAX 0.01 1.0e8 IP_L3
ETAP X MIN -0.01 1.0e8 IP_L3
PHASE Y TARGET 0.25 0. V_SEP_48W to IP_L3
Q Y MAX 0.595 1.0e3 GLOBAL
Q X MAX 0.525 1.0e3 GLOBAL
Q Y MIN 0.585 1.0e3 GLOBAL
Q X MIN 0.515 1.0e3 GLOBAL
Q Y TARGET 0.5879 1.0e3 GLOBAL
Q X TARGET 0.5419 1.0e3 GLOBAL
PHASE Y TARGET 4.795 1.0e IP_L0 to IP_L3
PHASE X TARGET 5.26 1.0e IP_L0 to IP_L3
LRBBI_DEL_Q X MAX 0.00072 30. GLOBAL
LRBBI_DEL_Q Y MAX 0.011 30. GLOBAL
CHROM X TARGET 0.4557 1.0e5 GLOBAL
CHROM Y TARGET 0.7152 1.0e5 GLOBAL
DELTA_CHROM X TARGET 0.0 1.0e4 GLOBAL
DELTA_CHROM Y TARGET 0.0 1.0e4 GLOBAL
NONLIN_Q X TARGET 0.5568 1.e8 GLOBAL
NONLIN_Q Y TARGET 0.5849 1.e8 GLOBAL
PRETZ_APERTURE X MAX 0.045 1.0e4 ARC
PRETZ_APERTURE X MAX 0.0525 1.0e2 IR
PRETZ_EFFICIENCY N MIN 0.7 1.0e2 GLOBAL
PHASE X TARGET 0.78 10. IP_L0 to H_SEP_08W
APERTURE X MAX 0.003 10. Q08W
APERTURE X MAX 0. 0. IR
APERTURE Y MAX 0. 0. IR
DISPLACEMENT X TARGET 0. 1.e04 IP_L0
DISPLACEMENT Y TARGET 0. 1.e05 IP_L0
DISPLACEMENT Y TARGET 0. 1.e05 Q05W
DISPLACEMENT Y TARGET 0. 1.e05 Q07W
DISPLACEMENT Y MIN 0.006 1.e04 IP_L3
CROSS_ANGLE X MAX 0.0029 1.e6 IP_L0
CROSS_ANGLE X MIN 0.015 1.e1 IP_L0
CO_ANGLE X TARGET 0.002 1.0 IP_L0
CO_ANGLE Y TARGET 0.0 1.e3 IP_L0
I_BUNCH N MIN 10.0 1.e2 GLOBAL
WIG_EMITTANCE N MAX 2.e-7 1. GLOBAL
EMITTANCE N MAX 2.e-7 1. GLOBAL
SEP_VOLT N MAX 90. 100. GLOBAL
WELCH_TEMNYKH N MAX 1.1 1. GLOBAL
C11 N TARGET 0. 1. IP_L0
C12 N TARGET 0. 1.e05 IP_L0
C21 N TARGET 0. 1. IP_L0
C22 N TARGET 0. 1. IP_L0
C11 N TARGET 0. 1.e04 IP_L3
C12 N TARGET 0. 1.e04 IP_L3
C21 N TARGET 0. 1.e05 IP_L3
C22 N TARGET 0. 1.e04 IP_L3
MOMENTUM_COMP N MAX 0.012 1. GLOBAL
VARIABLE_LIMIT N MAX 0. 1.e09 GLOBAL
DELTA_BETA X TARGET 0. 1.e02 IP_L0
DELTA_BETA Y TARGET 0. 1.e02 IP_L0
DELTA_BETA X TARGET 0. 1.e03 Q08W
DELTA_BETA X TARGET 0. 1.e03 Q08E
DELTA_BETA X TARGET 0. 1.e03 Q09W
DELTA_BETA X TARGET 0. 1.e03 Q09E
DBETA_DPRETZ X MAX 0.05 1.E02 IP_L0
DBETA_DPRETZ Y MAX 0.05 1.E02 IP_L0
DBETA_DPRETZ X MAX 0.05 1.E05 IP_L0 TO Q03E
DBETA_DPRETZ Y MAX 0.05 1.E05 IP_L0 TO Q03E
DBETA_DPRETZ X MIN -0.05 1.E05 IP_L0 TO Q03E
DBETA_DPRETZ Y MIN -0.05 1.E05 IP_L0 TO Q03E
DET_4BY4 N TARGET 0. 1.e06 FULL_TURN
DET_4BY4 N TARGET 0. 1.e05 IP_L0
DET_4BY4 N TARGET 0. 1.e06 IP_L3
DET_2BY2_UL N TARGET 0. 1.e04 IP_L3
DET_2BY2_LR N TARGET 0. 1.e04 IP_L3
UNSTABLE_RING N TARGET 0. 1.e10 GLOBAL
$END
$SINGLE_VARS
N_LOOPS = 100
N_CYCLES = 1
CIRCULAR_MACHINE = .true.
EXCLUDE_LRBBI = 'G1', 'G2'
N_TRAINS = 9
N_CARS = 3
N_14NS_SPACE = 2
OPTIMIZER = 'MINIDEL'
SYMMETRY = 'NO_SYMMETRY'
LAT_FILE = 'bmad_on.'
NONLINEARITY = .true.
PRETZEL = .true.
ENERGY_OFFSET = -0.006 0. 0.006
SEXTUPOLE_SYMMETRY = 'NO_SYMMETRY'
MINIMIZE_MOMENTS = .false.
DISP_FILE = 'disp.dat'
$END
$END_FILE ! reading of file stops here
To compute veritcal tonality try
Lattice file: BMAD_"lattice name"
! this is a test of spec_read
$USE_LIST
use sex_09a command 0.01 -0.2 0.2
use sex_13a command 0.01 -0.2 0.2
use sex_17a command 0.01 -0.2 0.2
use sex_19a command 0.01 -0.2 0.2
use sex_29a command 0.01 -0.2 0.2
use sex_33a command 0.01 -0.2 0.2
use sex_34a command 0.01 -0.2 0.2
use sex_35a command 0.01 -0.2 0.2
use sex_39a command 0.01 -0.2 0.2
use sex_43a command 0.01 -0.2 0.2
$END
$CONSTRAINT_LIST
BETA X TARGET 1.0 1.0e2 IP_L0
BETA Y TARGET 0.018 1.0e3 IP_L0
ETA X TARGET 0.0 1.0e2 IP_L0
BETA X MAX 39.0 1.0e0 Q03W to QADD_47W
BETA Y MAX 39.0 1.0e1 Q03W to QADD_47W
BETA X MAX 57.0 1.0e1 Q48W
BETA Y MAX 57.0 1.0e1 Q48W
BETA X MAX 37.0 1.0e1 Q49W
BETA Y MAX 37.0 1.0e1 Q49W
BETA X MAX 100. 1.0e1 IP_L0 to Q03W
BETA Y MAX 100. 1.0e1 IP_L0 to Q03W
ALPHA X MAX 0.002 1.0e8 IP_L3
ALPHA X MIN -0.002 1.0e8 IP_L3
ALPHA Y MAX 0.002 1.0e8 IP_L3
ALPHA Y MIN -0.002 1.0e8 IP_L3
ETAP X MAX 0.01 1.0e8 IP_L3
ETAP X MIN -0.01 1.0e8 IP_L3
PHASE Y TARGET 0.25 0. V_SEP_48W to IP_L3
Q Y MAX 0.595 1.0e3 GLOBAL
Q X MAX 0.525 1.0e3 GLOBAL
Q Y MIN 0.585 1.0e3 GLOBAL
Q X MIN 0.515 1.0e3 GLOBAL
Q Y TARGET 0.5879 1.0e3 GLOBAL
Q X TARGET 0.5419 1.0e3 GLOBAL
PHASE Y TARGET 4.795 1.0e IP_L0 to IP_L3
PHASE X TARGET 5.26 1.0e IP_L0 to IP_L3
LRBBI_DEL_Q X MAX 0.00072 30. GLOBAL
LRBBI_DEL_Q Y MAX 0.011 30. GLOBAL
CHROM X TARGET 0.4557 1.0e5 GLOBAL
CHROM Y TARGET 0.7152 1.0e5 GLOBAL
DELTA_CHROM X TARGET 0.0 1.0e4 GLOBAL
DELTA_CHROM Y TARGET 0.0 1.0e4 GLOBAL
NONLIN_Q X TARGET 0.5368 1.e8 GLOBAL
NONLIN_Q Y TARGET 0.5949 1.e8 GLOBAL
PRETZ_APERTURE X MAX 0.045 1.0e4 ARC
PRETZ_APERTURE X MAX 0.0525 1.0e2 IR
PRETZ_EFFICIENCY N MIN 0.7 1.0e2 GLOBAL
PHASE X TARGET 0.78 10. IP_L0 to H_SEP_08W
APERTURE X MAX 0.003 10. Q08W
APERTURE X MAX 0. 0. IR
APERTURE Y MAX 0. 0. IR
DISPLACEMENT X TARGET 0. 1.e04 IP_L0
DISPLACEMENT Y TARGET 0. 1.e05 IP_L0
DISPLACEMENT Y TARGET 0. 1.e05 Q05W
DISPLACEMENT Y TARGET 0. 1.e05 Q07W
DISPLACEMENT Y MIN 0.006 1.e04 IP_L3
CROSS_ANGLE X MAX 0.0029 1.e6 IP_L0
CROSS_ANGLE X MIN 0.015 1.e1 IP_L0
CO_ANGLE X TARGET 0.002 1.0 IP_L0
CO_ANGLE Y TARGET 0.0 1.e3 IP_L0
I_BUNCH N MIN 10.0 1.e2 GLOBAL
WIG_EMITTANCE N MAX 2.e-7 1. GLOBAL
EMITTANCE N MAX 2.e-7 1. GLOBAL
SEP_VOLT N MAX 90. 100. GLOBAL
WELCH_TEMNYKH N MAX 1.1 1. GLOBAL
C11 N TARGET 0. 1. IP_L0
C12 N TARGET 0. 1.e05 IP_L0
C21 N TARGET 0. 1. IP_L0
C22 N TARGET 0. 1. IP_L0
C11 N TARGET 0. 1.e04 IP_L3
C12 N TARGET 0. 1.e04 IP_L3
C21 N TARGET 0. 1.e05 IP_L3
C22 N TARGET 0. 1.e04 IP_L3
MOMENTUM_COMP N MAX 0.012 1. GLOBAL
VARIABLE_LIMIT N MAX 0. 1.e09 GLOBAL
DELTA_BETA X TARGET 0. 1.e02 IP_L0
DELTA_BETA Y TARGET 0. 1.e02 IP_L0
DELTA_BETA X TARGET 0. 1.e03 Q08W
DELTA_BETA X TARGET 0. 1.e03 Q08E
DELTA_BETA X TARGET 0. 1.e03 Q09W
DELTA_BETA X TARGET 0. 1.e03 Q09E
DBETA_DPRETZ X MAX 0.05 1.E02 IP_L0
DBETA_DPRETZ Y MAX 0.05 1.E02 IP_L0
DBETA_DPRETZ X MAX 0.05 1.E05 IP_L0 TO Q03E
DBETA_DPRETZ Y MAX 0.05 1.E05 IP_L0 TO Q03E
DBETA_DPRETZ X MIN -0.05 1.E05 IP_L0 TO Q03E
DBETA_DPRETZ Y MIN -0.05 1.E05 IP_L0 TO Q03E
DET_4BY4 N TARGET 0. 1.e06 FULL_TURN
DET_4BY4 N TARGET 0. 1.e05 IP_L0
DET_4BY4 N TARGET 0. 1.e06 IP_L3
DET_2BY2_UL N TARGET 0. 1.e04 IP_L3
DET_2BY2_LR N TARGET 0. 1.e04 IP_L3
UNSTABLE_RING N TARGET 0. 1.e10 GLOBAL
$END
$SINGLE_VARS
N_LOOPS = 100
N_CYCLES = 1
CIRCULAR_MACHINE = .true.
EXCLUDE_LRBBI = 'G1', 'G2'
N_TRAINS = 9
N_CARS = 3
N_14NS_SPACE = 2
OPTIMIZER = 'MINIDEL'
SYMMETRY = 'NO_SYMMETRY'
LAT_FILE = 'bmad_on.'
NONLINEARITY = .true.
PRETZEL = .true.
ENERGY_OFFSET = -0.006 0. 0.006
SEXTUPOLE_SYMMETRY = 'NO_SYMMETRY'
MINIMIZE_MOMENTS = .false.
DISP_FILE = 'disp.dat'
$END
$END_FILE ! reading of file stops here
SEXTUPOLE MOMENTS
BMADZ has the capability to compute the dependence of resonances, and the amplitude and energy dependence of beta and coupling on sextupole strength, and chromaticity. These moments are calculated by the subroutine SEXTUPOLE_MOMENTS. Subroutine MINIMIZE_MOMENTS finds the set of sextupole strengths that minimizes the sum of the squares of the deviations of the moments from the desired value. (For example, In the case of the dependence of beta on amplitude and energy, the desired value is zero. For chromaticity, the value is specified below.) The USE_LIST_SEXT is the list of sextupoles that are used as fit parameters by MINIMIZE_MOMENTS
MINIMIZE_MOMENTS If true then subroutine MINIMIZE_MOMENTS is called on each iteration and best fit set of sextupoles is computed. Note that it is not necessary for NONLINEARITY to be true in order to minimize moments. The best fit sextupoles are written to for041.dat and in a group format to for042.dat. DISP_FILE Subroutine NONLINEARITY computes jacobian of a closed orbit based on trajectories of nearby points. Displacement of the nearby trajectories is defined in file disp.dat
Lattice design
The existing on energy HEP optics
FD93S _4S_15KG_SX0A09 (December 1998) were designed in two steps
- Optimize to betas, pretzel parameters, coupling, tunes. The quadrupoles and IR quad angles are the variables.
- Compute sextupoles that minimize moments with each moments weighted according to the CONSTRAINT_LIST. Experimentation with various sets of weights was guided by the deviation of the determinant of the full turn matrix from unity. If the deviation is small, (<1) then typically dynamic aperture is OK. Note that in order to compute the determinant, NONLINEARITY must be true. The relevant subset of CONSTRAINT_LIST that yielded a good set is
SEXT_MOMENTS N MAX 0. 1.e0 GLOBAL
SEXT_SYMMETRY N MAX 0. 1.e01 GLOBAL
SIGN_SYMMETRY N MAX 0. 0.0 SEX_8W to SEX_44W
CHROM X TARGET 1.0 1.0e2 GLOBAL
CHROM Y TARGET 0.0 1.0e2 GLOBAL
TONALITY X TARGET 0. 1.0e03 GLOBAL
TONALITY Y TARGET 00. 1.0e03 GLOBAL
DELTA_BETA X TARGET 0. 13.0e0 Q01W to Q01E
DELTA_BETA Y TARGET 0. 11.0e0 Q01W to Q01E
DELTA_BETA X TARGET 0. 1.e1 IP_L0
DELTA_BETA Y TARGET 0. 1.e1 IP_L0
DELTA_BETA Y TARGET 0. 1.e-3 Q08W to Q09W
DELTA_BETA Y TARGET 0. 1.e-3 Q09E to Q08E
DBETA_DPRETZ X MAX 0.0 3.7e0 Q01W to Q01E
DBETA_DPRETZ Y MAX 0.0 0.5e0 Q01W to Q01E
DBETA_DCOS X MAX 0.0 50.0E0 IP_L0
DBETA_DSIN X MAX 0.0 50.0E0 IP_L0
DBETA_DCOS Y MAX 0.0 50.0E0 IP_L0
DBETA_DSIN Y MAX 0.0 50.0E0 IP_L0
DBETA_DCOS X MAX 0.0 6.5E0 Q01W to Q01E
DBETA_DSIN X MAX 0.0 2.5E0 Q01W to Q01E
DBETA_DCOS Y MAX 0.0 1.5E0 Q01W to Q01E
DBETA_DSIN Y MAX 0.0 3.0e0 Q01W to Q01E
COUPLING_A_REAL N MAX 0.0 40.0e0 Q01W to Q01E
COUPLING_A_IMAGE N MAX 0.0 40.0e0 Q01W to Q01E
COUPLING_B_REAL N MAX 0.0 40.1e0 Q01W to Q01E
COUPLING_B_IMAGE N MAX 0.0 40.0e0 Q01W to Q01E
COUPLING_A_REAL N MAX 0.0 0.e0 IP_L0
COUPLING_A_IMAGE N MAX 0.0 0.e0 IP_L0
COUPLING_B_REAL N MAX 0.0 0.e0 IP_L0
COUPLING_B_IMAGE N MAX 0.0 0.e0 IP_L0
The high tune optics BMAD_D90961500.FD11_4S_15KG was developed in a slightly different way. I tried the same strategy as for the HEP optics but the fitted sextupoles tended to be to strong or of wrong sign and in any event the dynamic aperture was poor. So I reoptimized the quadrupole optics, computing a best fit sextupole set on each iteration. The deviation of the fitted strengths from realizable strengths was included in the constraint list (VARIABLE_LIMIT). The result was a realizable set of sextupoles that yielded good dynamic aperture. (It was necessary to set a couple sextupoles to zero and remove them from the USE_SEXT_LIST) The relevant constraints are
SEXT_MOMENTS N MAX 0. 1.e02 GLOBAL
SEXT_SYMMETRY N MAX 0. 1.e0 GLOBAL
SIGN_SYMMETRY N MAX 0. 0.0 SEX_8W to SEX_44W
CHROM X TARGET 0. 1.0e3 GLOBAL
CHROM Y TARGET 0. 1.0e3 GLOBAL
NONLIN_Q X TARGET 0.0 0.0 GLOBAL
NONLIN_Q Y TARGET 0.0 0.0 GLOBAL
TONALITY X TARGET 0. 5.0e04 GLOBAL
TONALITY Y TARGET 0.0 5.0e04 GLOBAL
DELTA_BETA X TARGET 0. 125. Q01W to Q01E
DELTA_BETA Y TARGET 0. 125. Q01W to Q01E
DELTA_BETA X TARGET 0. 1.e0 IP_L0
DELTA_BETA Y TARGET 0. 1.e0 IP_L0
DELTA_BETA Y TARGET 0. 1.e-3 Q08W to Q09W
DELTA_BETA Y TARGET 0. 1.e-3 Q09E to Q08E
DBETA_DCOS X MAX 0.0 1.0E0 IP_L0
DBETA_DSIN X MAX 0.0 1.0E0 IP_L0
DBETA_DCOS Y MAX 0.0 1.0E0 IP_L0
DBETA_DSIN Y MAX 0.0 1.0E0 IP_L0
DBETA_DCOS X MAX 0.0 100.E0 Q01W to Q01E
DBETA_DSIN X MAX 0.0 100.0E0 Q01W to Q01E
DBETA_DCOS Y MAX 0.0 100.E0 Q01W to Q01E
DBETA_DSIN Y MAX 0.0 100.0e0 Q01W to Q01E
COUPLING_A_REAL N MAX 0.0 50.0e0 Q01W to Q01E
COUPLING_A_IMAGE N MAX 0.0 50.0e0 Q01W to Q01E
COUPLING_B_REAL N MAX 0.0 50.e0 Q01W to Q01E
COUPLING_B_IMAGE N MAX 0.0 50.0e0 Q01W to Q01E
COUPLING_A_REAL N MAX 0.0 50.e0 IP_L0
COUPLING_A_IMAGE N MAX 0.0 50.e0 IP_L0
COUPLING_B_REAL N MAX 0.0 50.e0 IP_L0
COUPLING_B_IMAGE N MAX 0.0 50.e0 IP_L0
CHI2 N MAX 1000000. 0.01 GLOBAL
MANUAL MODE
To run in a mode where the lattice elements can be changed manually. Set the optimizer to 'MANUAL' in the single variables list in the constraint file. Start the program in the usual way by typing
BMADZ CONS<constraint file> BMAD.<lattice file>
and the command line indicated by the prompt
BMADZ> will appear. At the prompt type
<element_name> <attribute to change> <value>
Examples
BMADZ> Q14W K 0.2 !K of Q14W is set to 0.2
BMADZ> Q14W DK 0.002 ! change K of Q14W by 0.002
If elements are controlled by LORDS as for OVERLAYS (see BMAD documentation) Then the LORD must be changed. For example if in the lattice file there is an overlay
Q14 : overlay = {Q14W, Q14E}, K1 = -2.71607E-01
Then to change Q14 type
BMADZ> Q14 K 0.002 !K of Q14W and Q14E are set to 0.2
A carriage return will result in a repeat of the previous command.
Note: In order to change an elements value, it must be in the USE_LIST
EXAMPLE FILES
To run with the test files in [cesr.bmad.test] type
BMADZ CONS_TEST BMAD.
OUTPUT
- NEW_BMAD_INPUT.
- At each iteration of the optimizer that results in a reduction of the figure of merit, an updated copy of the input file is written. The name of the file is NEW_BMAD_INPUT. The file can be used as the starting point for more optimization.
- FOR041.DAT, FOR042.DAT
- With each call of subroutine MINIMIZE_MOMENTS the resulting set of sextupoles is appended. The two files differ only in format. FOR041.DAT can be appended to the input file (NEW_BMAD_INPUT.) FOR042.DAT can be used in a GROUP
- BETA_ORBIT.DAT
- lists twiss data and can be plotted using the plotting package PHYSICA with command file [cesr.bmad.physica]beta_orbit.pcm
- PRETZEL.DAT
- lists pretzel data and can be plotted using PHYSICS and [cesr.bmad.physica]pretzel.pcm
- CONS_<LATTICE_NAME>
- summarizes the constrained values
- MOBIUS_BETA_ORBIT.DAT
- lists mobius twiss data
- ELEMENT_LIST.DAT
- lists elements with lengths and locations
- ZREP.DAT
- lists lattice parameters of general interest