Last change
on this file since 4 was
4,
checked in by zhangj, 11 years ago
|
Initial import--MML version from SOLEIL@2013
|
File size:
1.3 KB
|
Line | |
---|
1 | function anatunefirstturns |
---|
2 | %% Search for tunes using 4 turn by turn data |
---|
3 | |
---|
4 | % |
---|
5 | % Laurent S. Nadolski, 22 mars 2005 |
---|
6 | |
---|
7 | % [closeOrb] = findorbit4initial(THERING,ampe,[ampe*0.06;0;0;0;ampe;0]); |
---|
8 | % X0=X0+[closeOrb;0;0]; |
---|
9 | |
---|
10 | %Simulation |
---|
11 | if isempty(whos('global','variable')) |
---|
12 | global THERING |
---|
13 | end |
---|
14 | |
---|
15 | % number of turns |
---|
16 | nturn = 4; |
---|
17 | % initial condition |
---|
18 | x0 = [1e-3;0;0e-3;0;0;0]; |
---|
19 | |
---|
20 | % Orbit at ring entrance |
---|
21 | BPMindex= buildatindex('BPMx','BPM'); |
---|
22 | |
---|
23 | orbit = ringpass(THERING,x0,nturn); |
---|
24 | |
---|
25 | out = linepass(THERING,x0,BPMindex) |
---|
26 | |
---|
27 | y=out(1,[1 31 61 91]) |
---|
28 | [nu ycod] = anaorbit(y) |
---|
29 | |
---|
30 | y=[]; |
---|
31 | |
---|
32 | iobs = BPMindex(1); % location of observation |
---|
33 | |
---|
34 | % tracking in TRANSPORT mode over nturn |
---|
35 | for k = 1:nturn |
---|
36 | out = linepass(THERING,x0,[1 iobs length(THERING)]); |
---|
37 | x0 = out(:,end); |
---|
38 | y(k)= out(2,1); |
---|
39 | end |
---|
40 | |
---|
41 | %plot(orbit(1,:)); |
---|
42 | y = orbit(1,:); |
---|
43 | [nu ycod] = anaorbit(y) |
---|
44 | |
---|
45 | num=7 |
---|
46 | % on turn |
---|
47 | x0=[1e-3;0;0;0;0;0] |
---|
48 | out = linepass(THERING,x0,[1 BPMindex([num num+30 num+60 num+90])' length(THERING)]); |
---|
49 | y = out(1,[2:end-1]); |
---|
50 | [nu ycod] = anaorbit(y); |
---|
51 | 20-4*nu |
---|
52 | |
---|
53 | function [nu ycod] = anaorbit(y) |
---|
54 | % |
---|
55 | % |
---|
56 | % Algorithm |
---|
57 | % based on orbit computed on 4 turns |
---|
58 | % Reference ... |
---|
59 | |
---|
60 | cosphi = 0.5*(y(2) - y(1)+ y(4) - y(3))/(y(3)-y(2)); |
---|
61 | nu = 0.5/pi*acos(cosphi); |
---|
62 | ycod2 = (y(3) + y(1) - 2*y(2)*cosphi)/2/(1-cosphi); |
---|
63 | ycod = (y(3)*(y(1)+y(3))-y(2)*(y(2)+y(4)))/((y(1)-y(4))+3*(y(3)-y(2))); |
---|
64 | |
---|
Note: See
TracBrowser
for help on using the repository browser.