0001
0002
0003
0004 spear2
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 QFI = findcells(THERING,'FamName','QF');
0020 Q1I = findcells(THERING,'FamName','Q1');
0021 Q2I = findcells(THERING,'FamName','Q2');
0022 Q3I = findcells(THERING,'FamName','Q3');
0023 CORRINDEX = sort([ QFI Q1I Q2I Q3I]);
0024
0025 THERING = setcellstruct(THERING,'PassMethod',CORRINDEX,'StrMPoleSymplectic4Pass');
0026
0027
0028 BPMINDEX = findcells(THERING,'BendingAngle');
0029
0030 NBPM = length(BPMINDEX);
0031 NCOR = length(CORRINDEX);
0032
0033
0034
0035
0036
0037
0038 KICKSIZE = 1e-5;
0039
0040 RX = findrespm(THERING,BPMINDEX ,CORRINDEX, KICKSIZE, 'PolynomB',1,1);
0041 RY = findrespm(THERING,BPMINDEX ,CORRINDEX, KICKSIZE, 'PolynomA',1,1);
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052 RespM_XY = [RX{1} RY{1}; RX{3} RY{3}];
0053 figure(1);
0054 mesh(RespM_XY);
0055 colormap('copper');
0056 xlabel('Corrector Number')
0057 ylabel('BPM Number');
0058 zlabel('Normalized Orbit Response');
0059 title('Orbit Response Matrix - uncoupled lattice')
0060
0061
0062 QDI = findcells(THERING,'FamName','QD');
0063
0064 QDTILTS = 1*(pi/180)*randn(1,length(QDI));
0065
0066 settilt(QDI,QDTILTS);
0067
0068
0069 RX = findrespm(THERING,BPMINDEX ,CORRINDEX, KICKSIZE, 'PolynomB',1,1);
0070 RY = findrespm(THERING,BPMINDEX ,CORRINDEX, KICKSIZE, 'PolynomA',1,1);
0071
0072 RespM_XY_Coupled = [RX{1} RY{1}; RX{3} RY{3}];
0073 figure(2);
0074 mesh(RespM_XY_Coupled);
0075 colormap('copper');
0076 title('Orbit Response Matrix - coupled lattice')
0077 xlabel('Corrector Number')
0078 ylabel('BPM Number');
0079 zlabel('Normalized Orbit Response');
0080