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