1 | % reglage tracking simulé injection 110 MeV et Br=0.00095 G |
---|
2 | |
---|
3 | |
---|
4 | |
---|
5 | Grf = 0.0465 ; % gradient remanent T/m |
---|
6 | Grd = 0.0485 ; % gradient remanent T/m |
---|
7 | a = 0.0517 ; % G/I T/m/A |
---|
8 | Br = 0.0020 ; % Champ remanent T |
---|
9 | b = 0.0013051 ; % B/I T/A |
---|
10 | rho=12.3773 ; % rayon dipole |
---|
11 | brhom = 8.86 ; % Ã 2.75 GeV |
---|
12 | |
---|
13 | % % courant théorique |
---|
14 | % Iqfc = -0.327757 ; % Offset QPF |
---|
15 | % Iqdc = -0.488591 ; % Offset QPD |
---|
16 | % Ibc = 0. ; % Offset Dip |
---|
17 | % Iqf0 =(kf0*brhom-Grf)/a - Iqfc; |
---|
18 | % Iqd0=(kd0*brhom-Grd)/a -Iqdc ; |
---|
19 | % Id0 = (brhom/rho-Br)/b - Ibc; |
---|
20 | |
---|
21 | %courant en manipe 20-10-05 |
---|
22 | Iqf0 =201.65; Iqfc = -0.617 ; |
---|
23 | Iqd0 =162.43 ; Iqdc = -0.672 ; |
---|
24 | Id0 =545; Ibc = -0.1 ; |
---|
25 | delf =-0.0001 ; % délai retard si positif |
---|
26 | deld =-0.000 ; % délai retard si positif |
---|
27 | |
---|
28 | %courant en manipe 19-10-05 |
---|
29 | Iqf0 =200.11; Iqfc = -0.432 ; |
---|
30 | Iqd0 =160.35; Iqdc = -0.454 ; |
---|
31 | Id0 =545; Ibc = -0.1 ; |
---|
32 | delf =-0.0001 ; % délai retard si positif |
---|
33 | deld =-0.0001 ; % délai retard si positif |
---|
34 | |
---|
35 | %courant en manipe 18-10-05 |
---|
36 | Iqf0 =201.33; Iqfc = -0.236 ; |
---|
37 | Iqd0 =162.28; Iqdc = -0.338 ; |
---|
38 | Id0 =545; Ibc = -0. ; |
---|
39 | delf =0.0001 ; % délai retard si positif |
---|
40 | deld =0.0001 ; % délai retard si positif |
---|
41 | |
---|
42 | %courant en manipe 18-10-05 bis |
---|
43 | % Iqf0 =201.474; Iqfc = -0.324 ; |
---|
44 | % Iqd0 =162.851; Iqdc = -0.55 ; |
---|
45 | % Id0 =545; Ibc = -0. ; |
---|
46 | % delf =0.000 ; % délai retard si positif |
---|
47 | % deld =0.000 ; % délai retard si positif |
---|
48 | |
---|
49 | %sprintf('Id0= %g Iqf0= %g Iqd0= %g ' ,Iqf0, Iqd0 , Id0 ) |
---|
50 | |
---|
51 | |
---|
52 | |
---|
53 | w=2*3.14159*(50./17.); |
---|
54 | i=0; |
---|
55 | clear fq fd r time |
---|
56 | |
---|
57 | i = 1 : 1 : 340; |
---|
58 | t=i/1000; |
---|
59 | time=t; |
---|
60 | % rampe |
---|
61 | fqf = 0.5*(1-cos(w*(t-delf))); |
---|
62 | fqd = 0.5*(1-cos(w*(t-deld))); |
---|
63 | fd = 0.5*(1-cos(w*t)); |
---|
64 | fddot=0.5*w*sin(w*t); |
---|
65 | % gradient et champ B |
---|
66 | pf=Grf + a*(Iqfc + Iqf0*fqf); |
---|
67 | pd=Grd + a*(Iqdc + Iqd0*fqd); |
---|
68 | p0=Br + b*(Ibc + Id0*fd); |
---|
69 | p0dot=b*Id0*fddot; |
---|
70 | R=p0dot./p0; |
---|
71 | % ratios G/B |
---|
72 | rf=pf./(p0*rho); |
---|
73 | rd=pd./(p0*rho); |
---|
74 | % tune via model booster AT |
---|
75 | |
---|
76 | global THERING |
---|
77 | %switch2sim |
---|
78 | QFI = findcells(THERING,'FamName','QPF'); |
---|
79 | QDI = findcells(THERING,'FamName','QPD'); |
---|
80 | |
---|
81 | for i=1:340 |
---|
82 | KQF=rf(i);KQD=-rd(i); |
---|
83 | THERING = setcellstruct(THERING,'K',QFI,KQF); |
---|
84 | THERING = setcellstruct(THERING,'K',QDI,KQD); |
---|
85 | THERING = setcellstruct(THERING,'PolynomB',QFI, KQF,2); |
---|
86 | THERING = setcellstruct(THERING,'PolynomB',QDI, KQD,2); |
---|
87 | tune=modeltune; |
---|
88 | dnux(i)=tune(1);dnuz(i)=tune(2); |
---|
89 | end |
---|
90 | |
---|
91 | % eddy QP in dipole |
---|
92 | dK=+1.2e-04*R/3.6*0; |
---|
93 | dnux=dnux+31*dK; |
---|
94 | dnuz=dnuz-43*dK; |
---|
95 | |
---|
96 | resx11=[6 7]; resy11=[4 5]; |
---|
97 | resx12=[6.5 6.5]; resy12=[4 5]; |
---|
98 | resx13=[6 7]; resy13=[4.5 4.5]; |
---|
99 | resx31=[6.667 6.667]; resy31=[4 5]; |
---|
100 | resx32=[6 7]; resy32=[4.667 4.667]; |
---|
101 | resx33=[6 8]; resy33=[5 4]; |
---|
102 | resx41=[6 7]; resy41=[4.5 5]; |
---|
103 | resx42=[6.5 7]; resy42=[4 5]; |
---|
104 | |
---|
105 | n1=21; |
---|
106 | startx=dnux(n1); |
---|
107 | startz=dnuz(n1); |
---|
108 | n2=170; |
---|
109 | emaxx=dnux(n2); |
---|
110 | emaxz=dnuz(n2); |
---|
111 | |
---|
112 | n1=21; |
---|
113 | n2=340-21; |
---|
114 | clear ylim xlim |
---|
115 | figure(1) |
---|
116 | subplot(2,1,1) |
---|
117 | plot((dnux(n1:n2)) , (dnuz(n1:n2)) , '-k' , ... |
---|
118 | startx, startz, 'ok', ... |
---|
119 | emaxx, emaxz, 'ok', ... |
---|
120 | resx11 , resy11 , '-k' ,... |
---|
121 | resx12 , resy12 , '-k' ,... |
---|
122 | resx13 , resy13 , '-k' ,... |
---|
123 | resx31 , resy31 , '-r' ,... |
---|
124 | resx32 , resy32 , '-r', ... |
---|
125 | resx33 , resy33 , '-r', ... |
---|
126 | resx41 , resy41 , '-b', ... |
---|
127 | resx42 , resy42 , '-b') |
---|
128 | |
---|
129 | xlim([6.4 7]);ylim([4.4 5]); |
---|
130 | subplot(2,1,2) |
---|
131 | plot(time(n1:n2) , (dnux(n1:n2)-emaxx) , time(n1:n2) , (dnuz(n1:n2)-emaxz)) |
---|
132 | ylim([-0.1 0.1]); |
---|
133 | |
---|
134 | % coutant à l'injection |
---|
135 | sprintf(' Courant injection rampe: dip= %g Qf= %g Qd= %g \n Courant injection reel : dip= %g Qf= %g Qd= %g \n Champ dipole injection : %g',... |
---|
136 | Id0*fd(21) , Iqf0*fqf(21) , Iqd0*fqd(21) , ... |
---|
137 | Id0*fd(21) +Ibc, Iqf0*fqf(21) +Iqfc, Iqd0*fqd(21)+Iqdc, p0(21) ) |
---|
138 | sprintf(' Injection : nux =%g nuz=%g \n Extraction : nux =%g nuz=%g', ... |
---|
139 | startx, startz, emaxx, emaxz) |
---|
140 | |
---|
141 | % %Calcul offset sur Qpole en A |
---|
142 | % testf = (rf0*p0(20)*rho - (Grf + a*Iqf0*fqf(20)))/a; |
---|
143 | % testd = (rd0*p0(20)*rho - (Grd + a*Iqd0*fqd(20)))/a; |
---|
144 | % %sprintf('courant offset : If= %g Id= %g') |
---|