source: MML/trunk/at/simulator/element/solenoid.m

Last change on this file was 4, checked in by zhangj, 11 years ago

Initial import--MML version from SOLEIL@2013

File size: 1.2 KB
Line 
1function z=solenoid(fname,L,KS,method)
2
3% z=solenoid('FAMILYNAME',Length [m],KS,'METHOD')
4%       creates a new family in the FAMLIST - a structure with field
5%       FamName                 family name
6%       Length                  length[m]
7%       KS              solenoid strength KS [rad/m]
8%       PassMethod     name of the function to use for tracking
9%
10%   function returns assigned address in the FAMLIST that uniquely identifies
11%   the family
12%
13%   Additional structures being set up (initialized to default values within this routine):   
14%       NumIntSteps             Number of integration steps
15%       MaxOrder
16%       R1                                      6 x 6 rotation matrix at the entrance
17%       R2                      6 x 6 rotation matrix at the entrance
18%       T1                                      6 x 1 translation at entrance
19%       T2                                      6 x 1 translation at exit
20
21ElemData.FamName = fname;  % add check for existing identical family names
22ElemData.Length = L;
23ElemData.K         = KS;
24ElemData.MaxOrder = 3;
25ElemData.NumIntSteps = 10;
26ElemData.R1 = diag(ones(6,1));
27ElemData.R2 = diag(ones(6,1));
28ElemData.T1 = zeros(1,6);
29ElemData.T2 = zeros(1,6);
30ElemData.PassMethod=method;
31
32global FAMLIST
33z = length(FAMLIST)+1; % number of declare families including this one
34FAMLIST{z}.FamName = fname;
35FAMLIST{z}.NumKids = 0;
36FAMLIST{z}.KidsList= [];
37FAMLIST{z}.ElemData= ElemData;
38
Note: See TracBrowser for help on using the repository browser.