source: MML/trunk/at/simulator/element/user/wigtaylor.m @ 4

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

Initial import--MML version from SOLEIL@2013

File size: 2.2 KB
Line 
1function 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
26NumOfColumns = 9;
27
28ElemData.FamName     = fname;  % add check for existing identical family names
29ElemData.Length      = L;
30
31for i=1:nx
32 for j=1:NumOfColumns
33  ElemData.MapX(i,j) = x(i,j);
34 end
35end
36ElemData.NumOfMonoX = nx;
37
38for i=1:npx
39 for j=1:NumOfColumns
40  ElemData.MapPx(i,j) = px(i,j);
41 end
42end
43ElemData.NumOfMonoPx = npx;
44
45for i=1:ny
46 for j=1:NumOfColumns
47  ElemData.MapY(i,j) = y(i,j);
48 end
49end
50ElemData.NumOfMonoY = ny;
51
52for i=1:npy
53 for j=1:NumOfColumns
54  ElemData.MapPy(i,j) = py(i,j);
55 end
56end
57ElemData.NumOfMonoPy = npy;
58
59for i=1:ndelta
60 for j=1:NumOfColumns
61  ElemData.MapDelta(i,j) = delta(i,j);
62 end
63end
64ElemData.NumOfMonoDelta = ndelta;
65
66for i=1:nt
67 for j=1:NumOfColumns
68  ElemData.MapT(i,j) = t(i,j);
69 end
70end
71ElemData.NumOfMonoT = nt;
72
73ElemData.R1          = diag(ones(6,1));
74ElemData.R2          = diag(ones(6,1));
75ElemData.T1          = t1;
76ElemData.T2          = t2;
77ElemData.PassMethod  = method;
78
79global FAMLIST
80z = length(FAMLIST)+1; % number of declare families including this one
81FAMLIST{z}.FamName = fname;
82FAMLIST{z}.NumKids = 0;
83FAMLIST{z}.KidsList= [];
84FAMLIST{z}.ElemData= ElemData;
Note: See TracBrowser for help on using the repository browser.