source: MML/trunk/mml/at/solerror.m @ 4

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%% In Tracy or AT for rotation, the beam is rotated and not the element
2% This is not equivalent to rotating elements
3% For zero closed orbit, there is no effect on closed orbit of
4% 1. rotation around s-axis
5%   One way is just to rotate the element ie the component of the multipole
6%   But special attention has to be watch for 2n poles
7% 2. s-displacement --> in reality it is equivalent to a orbit kick
8
9global THERING;
10
11ATind = atindex(THERING);
12
13% Dipoles
14sigmaDs = 500e-6; % meter
15sigmaDx = 500e-6; % meter
16sigmaDz = 000e-6; % meter
17sigmaRs = 200e-6; % meter
18
19Index = ATind.BEND;
20
21sigmaDx = sigmaDx*randn(size(Index));
22sigmaDz = sigmaDz*randn(size(Index));
23sigmaDs = sigmaDs*randn(size(Index));
24sigmaRs = sigmaRs*randn(size(Index));
25
26mvelem(Index,sigmaDs);
27setshift(Index, sigmaDx, sigmaDz);
28
29%settilt(Index, sigmaRs);
30% Rotation of the dipole fields
31Theta = THERING{Index(1)}.BendingAngle*/getbrho;
32
33% for ik = 1:length(Index)
34%     THERING{Index(ik)}.PolynomeA(1) = sin(sigmaRs(ik))*
35% end
36
37% Quadrupoles
38
39sigmaDx = 100e-6; % meter
40sigmaDz = 100e-6; % meter
41
42Index = [ATind.Q1, ATind.Q2, ATind.Q3, ATind.Q4, ATind.Q5 ...
43         ATind.Q6, ATind.Q7, ATind.Q8, ATind.Q9, ATind.Q10];
44
45sigmaDx = sigmaDx*randn(size(Index));
46sigmaDz = sigmaDz*randn(size(Index));
47
48     
49setshift(Index, sigmaDx, sigmaDz);
50
51% Sextupoles
Note: See TracBrowser for help on using the repository browser.