1 | function 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 | |
---|
21 | ElemData.FamName = fname; % add check for identical family names |
---|
22 | ElemData.Length = L; |
---|
23 | ElemData.MaxOrder = 3; |
---|
24 | ElemData.NumIntSteps = 10; |
---|
25 | ElemData.R1 = diag(ones(6,1)); |
---|
26 | ElemData.R2 = diag(ones(6,1)); |
---|
27 | ElemData.T1 = zeros(1,6); |
---|
28 | ElemData.T2 = zeros(1,6); |
---|
29 | ElemData.PolynomA= [0 0 0 0]; |
---|
30 | ElemData.PolynomB= [0 0 S 0]; |
---|
31 | ElemData.PassMethod=method; |
---|
32 | |
---|
33 | global FAMLIST |
---|
34 | z = length(FAMLIST)+1; % number of declare families including this one |
---|
35 | FAMLIST{z}.FamName = fname; |
---|
36 | FAMLIST{z}.NumKids = 0; |
---|
37 | FAMLIST{z}.KidsList= []; |
---|
38 | FAMLIST{z}.ElemData= ElemData; |
---|
39 | |
---|