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