1 | function z=wigtaylor(fname,L,x,nx,px,npx,y,ny,py,npy,delta,ndelta,t,nt,t1,t2,method) |
---|
2 | |
---|
3 | %WIGGLER('FAMILYNAME',Length [m], MapX, NumOfMonoX, MapPx, NumOfMonoPx, MapY, NumOfMonoY, |
---|
4 | %MapPy, NumOfMonoPy, MapT, NumOfMonoT, MapDelta, NumOfMonoDelta, 'METHOD') |
---|
5 | % creates a new family in the FAMLIST - a structure with fields |
---|
6 | % FamName family name |
---|
7 | % Length length [m] |
---|
8 | % MapX Taylor map of final X |
---|
9 | % NumOfMonoX number of monomials in MapX |
---|
10 | % MapPx Taylor map of final Px |
---|
11 | % NumOfMonoPx number of monomials in MapPx |
---|
12 | % MapY Taylor map of final Y |
---|
13 | % NumOfMonoY number of monomials in MapY |
---|
14 | % MapPy Taylor map of final Py |
---|
15 | % NumOfMonoPy number of monomials in MapPy |
---|
16 | % MapDelta Taylor map of final Delta E |
---|
17 | % NumOfMonoDelta number of monomials in MapDelta |
---|
18 | % MapT Taylor map of final T |
---|
19 | % NumOfMonoT number of monomials in MapT |
---|
20 | % PassMethod name of the function to use for tracking |
---|
21 | % returns assigned address in the FAMLIST that is uniquely |
---|
22 | % identifies the family |
---|
23 | % |
---|
24 | % Weishi Wan, November 2002 |
---|
25 | |
---|
26 | NumOfColumns = 9; |
---|
27 | |
---|
28 | ElemData.FamName = fname; % add check for existing identical family names |
---|
29 | ElemData.Length = L; |
---|
30 | |
---|
31 | for i=1:nx |
---|
32 | for j=1:NumOfColumns |
---|
33 | ElemData.MapX(i,j) = x(i,j); |
---|
34 | end |
---|
35 | end |
---|
36 | ElemData.NumOfMonoX = nx; |
---|
37 | |
---|
38 | for i=1:npx |
---|
39 | for j=1:NumOfColumns |
---|
40 | ElemData.MapPx(i,j) = px(i,j); |
---|
41 | end |
---|
42 | end |
---|
43 | ElemData.NumOfMonoPx = npx; |
---|
44 | |
---|
45 | for i=1:ny |
---|
46 | for j=1:NumOfColumns |
---|
47 | ElemData.MapY(i,j) = y(i,j); |
---|
48 | end |
---|
49 | end |
---|
50 | ElemData.NumOfMonoY = ny; |
---|
51 | |
---|
52 | for i=1:npy |
---|
53 | for j=1:NumOfColumns |
---|
54 | ElemData.MapPy(i,j) = py(i,j); |
---|
55 | end |
---|
56 | end |
---|
57 | ElemData.NumOfMonoPy = npy; |
---|
58 | |
---|
59 | for i=1:ndelta |
---|
60 | for j=1:NumOfColumns |
---|
61 | ElemData.MapDelta(i,j) = delta(i,j); |
---|
62 | end |
---|
63 | end |
---|
64 | ElemData.NumOfMonoDelta = ndelta; |
---|
65 | |
---|
66 | for i=1:nt |
---|
67 | for j=1:NumOfColumns |
---|
68 | ElemData.MapT(i,j) = t(i,j); |
---|
69 | end |
---|
70 | end |
---|
71 | ElemData.NumOfMonoT = nt; |
---|
72 | |
---|
73 | ElemData.R1 = diag(ones(6,1)); |
---|
74 | ElemData.R2 = diag(ones(6,1)); |
---|
75 | ElemData.T1 = t1; |
---|
76 | ElemData.T2 = t2; |
---|
77 | ElemData.PassMethod = method; |
---|
78 | |
---|
79 | global FAMLIST |
---|
80 | z = length(FAMLIST)+1; % number of declare families including this one |
---|
81 | FAMLIST{z}.FamName = fname; |
---|
82 | FAMLIST{z}.NumKids = 0; |
---|
83 | FAMLIST{z}.KidsList= []; |
---|
84 | FAMLIST{z}.ElemData= ElemData; |
---|