source: MML/trunk/at/simulator/element/user/sextcorr.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.4 KB
Line 
1function z=sextupole_corr(fname,L,S,KickAngle,method)
2
3%SEXTUPOLE('FAMILYNAME',Length [m],S,Kickangle,'METHOD')
4%       creates a new family in the FAMLIST - a structure with fields%          FamName   
5%       FamName                 family name
6%       Length                  length[m]
7%       S                                       S-strngth of the sextupole
8%       NumIntSteps             Number of integration steps
9%       MaxOrder
10%       R1                                      6 x 6 rotation matrix at the entrance
11%       R2                      6 x 6 rotation matrix at the entrance
12%       T1                                      6 x 1 translation at entrance
13%       T2                                      6 x 1 translation at exit4
14%       ElemData.PolynomA= [0 0 0 0];   
15%       ElemData.PolynomB= [0 0 S 0];
16%   KickAngle      same as corrector however in this case it is a thick
17%                  element kick, ie it adds PolynomB(1) = sin(angle)/L.
18%       PassMethod     name of the function to use for tracking
19% returns assigned address in the FAMLIST that is uniquely identifies
20% the family
21
22
23ElemData.FamName = fname;  % add check for identical family names
24ElemData.Length = L;
25ElemData.MaxOrder = 3;
26ElemData.NumIntSteps = 10;
27ElemData.R1 = diag(ones(6,1));
28ElemData.R2 = diag(ones(6,1));
29ElemData.T1 = zeros(1,6);
30ElemData.T2 = zeros(1,6);
31ElemData.KickAngle = KickAngle;
32ElemData.PolynomA= [0 0 0 0];   
33ElemData.PolynomB= [0 0 S 0];
34ElemData.PassMethod=method;
35
36global FAMLIST
37z = length(FAMLIST)+1; % number of declare families including this one
38FAMLIST{z}.FamName = fname;
39FAMLIST{z}.NumKids = 0;
40FAMLIST{z}.KidsList= [];
41FAMLIST{z}.ElemData= ElemData;
42
Note: See TracBrowser for help on using the repository browser.