source: MML/trunk/machine/SOLEIL/Booster/applications/track3_eddyQP_AT.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: 4.0 KB
Line 
1%  reglage tracking simulé injection 110 MeV et Br=0.00095 G
2
3
4
5Grf = 0.0465 ;           % gradient remanent  T/m
6Grd = 0.0485 ;           % gradient remanent  T/m
7a  = 0.0517 ;           % G/I   T/m/A
8Br = 0.0020 ;           % Champ remanent T
9b  = 0.0013051 ;       % B/I  T/A
10rho=12.3773 ;           % rayon dipole
11brhom = 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
22Iqf0 =201.65;  Iqfc = -0.617 ;         
23Iqd0 =162.43  ;  Iqdc = -0.672  ;           
24Id0  =545;  Ibc  = -0.1 ;                   
25delf =-0.0001 ;          % délai retard si positif
26deld =-0.000 ;          % délai retard si positif
27
28%courant en manipe 19-10-05
29Iqf0 =200.11;  Iqfc = -0.432 ;         
30Iqd0 =160.35;  Iqdc = -0.454 ;           
31Id0  =545;  Ibc  = -0.1 ;
32delf =-0.0001 ;          % délai retard si positif
33deld =-0.0001 ;          % délai retard si positif
34   
35%courant en manipe 18-10-05
36Iqf0 =201.33;  Iqfc = -0.236 ;         
37Iqd0 =162.28;  Iqdc = -0.338 ;           
38Id0  =545;  Ibc  = -0. ;   
39delf =0.0001 ;          % délai retard si positif
40deld =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
53w=2*3.14159*(50./17.);
54i=0;
55clear fq fd r time
56
57i = 1 : 1 : 340;
58t=i/1000;
59time=t;
60% rampe
61fqf = 0.5*(1-cos(w*(t-delf)));
62fqd = 0.5*(1-cos(w*(t-deld)));
63fd = 0.5*(1-cos(w*t));
64fddot=0.5*w*sin(w*t);
65% gradient et champ B
66pf=Grf + a*(Iqfc + Iqf0*fqf);
67pd=Grd + a*(Iqdc + Iqd0*fqd);
68p0=Br + b*(Ibc + Id0*fd);
69p0dot=b*Id0*fddot;
70R=p0dot./p0;
71% ratios G/B
72rf=pf./(p0*rho);
73rd=pd./(p0*rho);
74% tune via model booster AT
75
76global THERING
77%switch2sim
78QFI = findcells(THERING,'FamName','QPF');
79QDI = findcells(THERING,'FamName','QPD');
80
81for 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);
89end   
90
91% eddy QP in dipole
92dK=+1.2e-04*R/3.6*0;
93dnux=dnux+31*dK;
94dnuz=dnuz-43*dK;
95
96resx11=[6 7]; resy11=[4 5];
97resx12=[6.5 6.5]; resy12=[4 5];
98resx13=[6 7]; resy13=[4.5 4.5];
99resx31=[6.667 6.667]; resy31=[4 5];
100resx32=[6 7]; resy32=[4.667 4.667];
101resx33=[6 8]; resy33=[5 4];
102resx41=[6 7]; resy41=[4.5 5];
103resx42=[6.5 7]; resy42=[4 5];
104
105n1=21;
106startx=dnux(n1);
107startz=dnuz(n1);
108n2=170;
109emaxx=dnux(n2);
110emaxz=dnuz(n2);
111
112n1=21;
113n2=340-21;
114clear ylim xlim
115figure(1)
116subplot(2,1,1)
117plot((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
129xlim([6.4 7]);ylim([4.4 5]);
130subplot(2,1,2)
131plot(time(n1:n2) , (dnux(n1:n2)-emaxx) , time(n1:n2) , (dnuz(n1:n2)-emaxz))
132ylim([-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) )
138sprintf(' 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')
Note: See TracBrowser for help on using the repository browser.