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 findelemm44</title> |
---|
6 | <meta name="keywords" content="findelemm44"> |
---|
7 | <meta name="description" content="FINDELEMM44 numerically finds the 4x4 transfer matrix of an element"> |
---|
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="index.html">atphysics</a> > findelemm44.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/atphysics <img alt=">" border="0" src="../../right.png"></a></td></tr></table>--> |
---|
19 | |
---|
20 | <h1>findelemm44 |
---|
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>FINDELEMM44 numerically finds the 4x4 transfer matrix of an element</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 M44 = findelemm44(ELEM, MethodName, orbit_in) </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">FINDELEMM44 numerically finds the 4x4 transfer matrix of an element |
---|
31 | FINDELEM44(ELEM, METHODNAME, ORBITIN) |
---|
32 | ELEM - the element data structure |
---|
33 | METHODNAME - name of the pass-method function |
---|
34 | ORBITIN - 6-by-1 phase space coordinates at the entrance |
---|
35 | The transvese matrix is momentum-dependent, |
---|
36 | the 5-th component of ORBITIN is used as the DP value |
---|
37 | |
---|
38 | See also <a href="findelemm66.html" class="code" title="function M66 = findelemm66(ELEM, MethodName, orbit_in);">FINDELEMM66</a></pre></div> |
---|
39 | |
---|
40 | <!-- crossreference --> |
---|
41 | <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2> |
---|
42 | This function calls: |
---|
43 | <ul style="list-style-image:url(../../matlabicon.gif)"> |
---|
44 | </ul> |
---|
45 | This function is called by: |
---|
46 | <ul style="list-style-image:url(../../matlabicon.gif)"> |
---|
47 | </ul> |
---|
48 | <!-- crossreference --> |
---|
49 | |
---|
50 | |
---|
51 | <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2> |
---|
52 | <div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function M44 = findelemm44(ELEM, MethodName, orbit_in)</a> |
---|
53 | 0002 <span class="comment">%FINDELEMM44 numerically finds the 4x4 transfer matrix of an element</span> |
---|
54 | 0003 <span class="comment">% FINDELEM44(ELEM, METHODNAME, ORBITIN)</span> |
---|
55 | 0004 <span class="comment">% ELEM - the element data structure</span> |
---|
56 | 0005 <span class="comment">% METHODNAME - name of the pass-method function</span> |
---|
57 | 0006 <span class="comment">% ORBITIN - 6-by-1 phase space coordinates at the entrance</span> |
---|
58 | 0007 <span class="comment">% The transvese matrix is momentum-dependent,</span> |
---|
59 | 0008 <span class="comment">% the 5-th component of ORBITIN is used as the DP value</span> |
---|
60 | 0009 <span class="comment">%</span> |
---|
61 | 0010 <span class="comment">% See also FINDELEMM66</span> |
---|
62 | 0011 |
---|
63 | 0012 <span class="comment">% See if step size for numerical differentiation</span> |
---|
64 | 0013 <span class="comment">% is set globally. Otherwise use 1e-7</span> |
---|
65 | 0014 <span class="keyword">global</span> NUMDIFPARAMS |
---|
66 | 0015 <span class="comment">% Transverse</span> |
---|
67 | 0016 <span class="keyword">if</span> isfield(NUMDIFPARAMS,<span class="string">'XYStep'</span>) |
---|
68 | 0017 dt = NUMDIFPARAMS.XYStep'; |
---|
69 | 0018 <span class="keyword">else</span> |
---|
70 | 0019 dt = 1e-7; |
---|
71 | 0020 <span class="keyword">end</span> |
---|
72 | 0021 |
---|
73 | 0022 |
---|
74 | 0023 <span class="comment">% Build a diagonal matrix of initial conditions</span> |
---|
75 | 0024 D4 = [dt*eye(4);zeros(2,4)]; |
---|
76 | 0025 <span class="comment">% Add to the orbit_in</span> |
---|
77 | 0026 |
---|
78 | 0027 RIN = orbit_in*ones(1,8) + [D4, -D4]; |
---|
79 | 0028 <span class="comment">% Propagate through the element</span> |
---|
80 | 0029 ROUT = feval(MethodName,ELEM,RIN); |
---|
81 | 0030 <span class="comment">% Calculate numerical derivative</span> |
---|
82 | 0031 M44 = [(ROUT(1:4,1:4)-ROUT(1:4,5:8))./(2*dt)];</pre></div> |
---|
83 | <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> |
---|
84 | </body> |
---|
85 | </html> |
---|