1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
---|
2 | "http://www.w3.org/TR/REC-html40/loose.dtd"> |
---|
3 | <html> |
---|
4 | <head> |
---|
5 | <title>Description of sbend</title> |
---|
6 | <meta name="keywords" content="sbend"> |
---|
7 | <meta name="description" content="BEND('FAMILYNAME', Length[m], BendingAngle[rad], EntranceAngle[rad],"> |
---|
8 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
9 | <meta name="generator" content="m2html © 2003 Guillaume Flandin"> |
---|
10 | <meta name="robots" content="index, follow"> |
---|
11 | <link type="text/css" rel="stylesheet" href="../../../m2html.css"> |
---|
12 | </head> |
---|
13 | <body> |
---|
14 | <a name="_top"></a> |
---|
15 | <div><a href="../../../index.html">Home</a> > <a href="../../index.html">at</a> > <a href="#">simulator</a> > <a href="index.html">element</a> > sbend.m</div> |
---|
16 | |
---|
17 | <!--<table width="100%"><tr><td align="left"><a href="../../../index.html"><img alt="<" border="0" src="../../../left.png"> Master index</a></td> |
---|
18 | <td align="right"><a href="index.html">Index for at/simulator/element <img alt=">" border="0" src="../../../right.png"></a></td></tr></table>--> |
---|
19 | |
---|
20 | <h1>sbend |
---|
21 | </h1> |
---|
22 | |
---|
23 | <h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2> |
---|
24 | <div class="box"><strong>BEND('FAMILYNAME', Length[m], BendingAngle[rad], EntranceAngle[rad],</strong></div> |
---|
25 | |
---|
26 | <h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2> |
---|
27 | <div class="box"><strong>function z=rbend(fname,L,A,A1,A2,K,method) </strong></div> |
---|
28 | |
---|
29 | <h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2> |
---|
30 | <div class="fragment"><pre class="comment">BEND('FAMILYNAME', Length[m], BendingAngle[rad], EntranceAngle[rad], |
---|
31 | ExitAngle[rad], K, 'METHOD') |
---|
32 | creates a new family in the FAMLIST - a structure with fields |
---|
33 | FamName family name |
---|
34 | Length length of the arc for an on-energy particle [m] |
---|
35 | BendingAngle total bending angle [rad] |
---|
36 | EntranceAngle [rad] (0 - for sector bends) |
---|
37 | ExitAngle [rad] (0 - for sector bends) |
---|
38 | ByError error in the dipole field relative to the design value |
---|
39 | K quadrupole K-value for combined funtion bends |
---|
40 | PassMethod name of the function to use for tracking |
---|
41 | returns assigned address in the FAMLIST that is uniquely identifies |
---|
42 | the family</pre></div> |
---|
43 | |
---|
44 | <!-- crossreference --> |
---|
45 | <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2> |
---|
46 | This function calls: |
---|
47 | <ul style="list-style-image:url(../../../matlabicon.gif)"> |
---|
48 | </ul> |
---|
49 | This function is called by: |
---|
50 | <ul style="list-style-image:url(../../../matlabicon.gif)"> |
---|
51 | </ul> |
---|
52 | <!-- crossreference --> |
---|
53 | |
---|
54 | |
---|
55 | <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2> |
---|
56 | <div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function z=rbend(fname,L,A,A1,A2,K,method)</a> |
---|
57 | 0002 <span class="comment">%BEND('FAMILYNAME', Length[m], BendingAngle[rad], EntranceAngle[rad],</span> |
---|
58 | 0003 <span class="comment">% ExitAngle[rad], K, 'METHOD')</span> |
---|
59 | 0004 <span class="comment">% creates a new family in the FAMLIST - a structure with fields</span> |
---|
60 | 0005 <span class="comment">% FamName family name</span> |
---|
61 | 0006 <span class="comment">% Length length of the arc for an on-energy particle [m]</span> |
---|
62 | 0007 <span class="comment">% BendingAngle total bending angle [rad]</span> |
---|
63 | 0008 <span class="comment">% EntranceAngle [rad] (0 - for sector bends)</span> |
---|
64 | 0009 <span class="comment">% ExitAngle [rad] (0 - for sector bends)</span> |
---|
65 | 0010 <span class="comment">% ByError error in the dipole field relative to the design value</span> |
---|
66 | 0011 <span class="comment">% K quadrupole K-value for combined funtion bends</span> |
---|
67 | 0012 <span class="comment">% PassMethod name of the function to use for tracking</span> |
---|
68 | 0013 <span class="comment">% returns assigned address in the FAMLIST that is uniquely identifies</span> |
---|
69 | 0014 <span class="comment">% the family</span> |
---|
70 | 0015 |
---|
71 | 0016 |
---|
72 | 0017 ElemData.FamName = fname; <span class="comment">% add check for identical family names</span> |
---|
73 | 0018 ElemData.Length = L; |
---|
74 | 0019 ElemData.MaxOrder = 3; |
---|
75 | 0020 ElemData.NumIntSteps = 10; |
---|
76 | 0021 ElemData.BendingAngle = A; |
---|
77 | 0022 ElemData.EntranceAngle = A1; |
---|
78 | 0023 ElemData.ExitAngle = A2; |
---|
79 | 0024 ElemData.ByError = 0; |
---|
80 | 0025 ElemData.K = K; |
---|
81 | 0026 |
---|
82 | 0027 ElemData.R1 = diag(ones(6,1)); |
---|
83 | 0028 ElemData.R2 = diag(ones(6,1)); |
---|
84 | 0029 ElemData.T1 = zeros(1,6); |
---|
85 | 0030 ElemData.T2 = zeros(1,6); |
---|
86 | 0031 |
---|
87 | 0032 ElemData.PolynomA = [0 0 0 0]; |
---|
88 | 0033 ElemData.PolynomB = [0 K 0 0]; |
---|
89 | 0034 |
---|
90 | 0035 ElemData.PassMethod = method; |
---|
91 | 0036 |
---|
92 | 0037 <span class="keyword">global</span> FAMLIST |
---|
93 | 0038 z = length(FAMLIST)+1; <span class="comment">% number of declare families including this one</span> |
---|
94 | 0039 FAMLIST{z}.FamName = fname; |
---|
95 | 0040 FAMLIST{z}.NumKids = 0; |
---|
96 | 0041 FAMLIST{z}.KidsList= []; |
---|
97 | 0042 FAMLIST{z}.ElemData= ElemData; |
---|
98 | 0043</pre></div> |
---|
99 | <hr><address>Generated on Mon 21-May-2007 15:26:45 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address> |
---|
100 | </body> |
---|
101 | </html> |
---|