0001
0002 clear all
0003 spear2rad
0004 for i=1:272 THERING{i}.Energy = 3e9; end
0005
0006 BENDINDEX = findcells(THERING,'PassMethod','BndMPoleSymplectic4RadPass');
0007 QUADSEXTINDEX = findcells(THERING,'PassMethod','StrMPoleSymplectic4RadPass');
0008
0009 RADELEMINDEX = sort([BENDINDEX QUADSEXTINDEX]);
0010
0011
0012
0013 QFI = findcells(THERING,'FamName','QF');
0014
0015 TILTI = QFI([3:7 10:12]);
0016
0017
0018
0019
0020
0021 tilterr = 0.1*pi/180;
0022 qftilts = tilterr*randn(1,length(TILTI));
0023
0024
0025 settilt(TILTI,qftilts);
0026
0027 [ENV, DP, DL] = ohmienvelope(THERING(:),RADELEMINDEX, 1:length(THERING)+1);
0028 sigmas = cat(2,ENV.Sigma);
0029 tilt = cat(2,ENV.Tilt);
0030 spos = findspos(THERING,1:length(THERING)+1);
0031
0032 figure(1)
0033 plot(spos,tilt*180/pi,'.-')
0034 set(gca,'XLim',[0 spos(end)])
0035 title('Rotation angle of the beam ellipse [degrees]');
0036 xlabel('s - position [m]');
0037
0038 figure(2)
0039 [A, H1, H2] = plotyy(spos,sigmas(1,:),spos,sigmas(2,:));
0040
0041 set(H1,'Marker','.')
0042 set(A(1),'XLim',[0 spos(end)])
0043 set(H2,'Marker','.')
0044 set(A(2),'XLim',[0 spos(end)])
0045 title('Principal axis of the beam ellipse [m]');
0046 xlabel('s - position [m]');