source: MML/trunk/machine/SOLEIL/StorageRing/bpm/analyse_reconst3.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 1.0 KB
Line 
1
2num = 12;
3
4X = AM.Data.X(:,num:num+5)';
5Z = AM.Data.Z(:,num:num+5)';
6
7
8[X1 X2 X3 X4] = deal(X(1,:),X(2,:),X(3,:),X(4,:));
9[Z1 Z2 Z3 Z4] = deal(Z(1,:),Z(2,:),Z(3,:),Z(4,:));
10
11%% Algo 4 turns
12nux = acos((X2-X1+X4-X3)/2./(X3-X2))/2/pi;
13nuz = acos((Z2-Z1+Z4-Z3)/2./(Z3-Z2))/2/pi;
14
15Xcod = (X3.*(X1+X3)-X2.*(X2+X4))./((X1-X4) + 3*(X3-X2));
16Zcod = (Z3.*(Z1+Z3)-Z2.*(Z2+Z4))./((Z1-Z4) + 3*(Z3-Z2));
17
18spos = getspos('BPMx');
19
20figure
21plot(spos,Xcod,'b.-',spos,Zcod,'r.-');
22xlabel('s-position [m]');
23ylabel('Close orbit [mm]');
24legend('Xcod','Zcod');
25grid on
26yaxis([-7 7])
27
28% disregard cplx results
29nux(imag(nux) ~= 0) = NaN;
30nuz(imag(nuz) ~= 0) = NaN;
31
32figure
33subplot(2,2,[1 2])
34plot(spos,nux,'b.',spos,nuz,'r.')
35xlabel('s-position [m]')
36ylabel('tune fractionnal part')
37title('4-turn Algorithm')
38legend(sprintf('nux %f',mean(nux(~isnan(nux)))),sprintf('nuz %f',mean(nuz(~isnan(nuz)))));
39grid on
40yaxis([0 0.5])
41
42subplot(2,2,3)
43hist(nux(~isnan(nux)))
44xlabel('Fractional tune nux')
45grid on
46
47subplot(2,2,4)
48hist(nuz(~isnan(nuz)))
49xlabel('Fractional tune nuz')
50grid on
51
Note: See TracBrowser for help on using the repository browser.