source: MML/trunk/at/simulator/element/user/rbend3.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: 1.7 KB
Line 
1function z=rbend3(fname,L,A,A1,A2,K, gap, FF1, FF2, method)
2%BEND2('FAMILYNAME',  Length[m], BendingAngle[rad], EntranceAngle[rad],
3%       ExitAngle[rad], K, gap, F1, F2, 'METHOD')
4%       creates a new family in the FAMLIST - a structure with fields
5%               FamName         family name
6%               Length          length of the arc for an on-energy particle [m]
7%               BendingAngle    total bending angle [rad]
8%               EntranceAngle   [rad] (0 - for sector bends)
9%               ExitAngle               [rad] (0 - for sector bends)
10%               ByError                 error in the dipole field relative to the design value
11%               K                               quadrupole K-value for combined funtion bends
12%       gap             FullGap
13%               PassMethod      name of the function to use for tracking
14% returns assigned address in the FAMLIST that is uniquely identifies
15% the family
16
17%
18% Added by Laurent S. Nadolski, SOLEIL, 03/04
19
20ElemData.FamName = fname;  % add check for identical family names
21ElemData.Length                 = L;
22ElemData.MaxOrder               = 3;
23ElemData.NumIntSteps    = 10;
24ElemData.BendingAngle   = A;
25ElemData.EntranceAngle  = A1;
26ElemData.ExitAngle      = A2;
27ElemData.ByError        = 0;
28ElemData.K                      = K;
29ElemData.FullGap                = gap;
30ElemData.FringeInt1         = 0.5*FF1; % same convention as in Tracy II
31ElemData.FringeInt2         = 0.5*FF2; % same convention as in Tracy II
32
33ElemData.R1             = diag(ones(6,1));
34ElemData.R2             = diag(ones(6,1));
35ElemData.T1             = zeros(1,6);
36ElemData.T2             = zeros(1,6);
37
38ElemData.PolynomA               = [0 0 0 0];     
39ElemData.PolynomB               = [0 K 0 0];
40ElemData.PassMethod     = method;
41
42global FAMLIST
43z = length(FAMLIST)+1; % number of declare families including this one
44FAMLIST{z}.FamName  = fname;
45FAMLIST{z}.NumKids  = 0;
46FAMLIST{z}.KidsList = [];
47FAMLIST{z}.ElemData = ElemData;
Note: See TracBrowser for help on using the repository browser.