source: MML/trunk/at/simulator/element/sextupole.m @ 8

Last change on this file since 8 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 1.2 KB
Line 
1function z=sextupole(fname,L,S,method)
2
3%SEXTUPOLE('FAMILYNAME',Length [m],S,'METHOD')
4%       creates a new family in the FAMLIST - a structure with fields
5%       FamName                     family name
6%       Length                  length[m]
7%       S                                       S-strength 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%       PassMethod     name of the function to use for tracking
17% returns assigned address in the FAMLIST that is uniquely identifies
18% the family
19
20
21ElemData.FamName = fname;  % add check for identical family names
22ElemData.Length = L;
23ElemData.MaxOrder = 3;
24ElemData.NumIntSteps = 10;
25ElemData.R1 = diag(ones(6,1));
26ElemData.R2 = diag(ones(6,1));
27ElemData.T1 = zeros(1,6);
28ElemData.T2 = zeros(1,6);
29ElemData.PolynomA= [0 0 0 0];   
30ElemData.PolynomB= [0 0 S 0];
31ElemData.PassMethod=method;
32
33global FAMLIST
34z = length(FAMLIST)+1; % number of declare families including this one
35FAMLIST{z}.FamName = fname;
36FAMLIST{z}.NumKids = 0;
37FAMLIST{z}.KidsList= [];
38FAMLIST{z}.ElemData= ElemData;
39
Note: See TracBrowser for help on using the repository browser.