source: MML/trunk/at/doc_html/at/atphysics/findelemm44.html @ 4

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

Initial import--MML version from SOLEIL@2013

File size: 4.6 KB
Line 
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 &copy; 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> &gt;  <a href="../index.html">at</a> &gt; <a href="index.html">atphysics</a> &gt; findelemm44.m</div>
16
17<!--<table width="100%"><tr><td align="left"><a href="../../index.html"><img alt="<" border="0" src="../../left.png">&nbsp;Master index</a></td>
18<td align="right"><a href="index.html">Index for at/atphysics&nbsp;<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>
42This function calls:
43<ul style="list-style-image:url(../../matlabicon.gif)">
44</ul>
45This 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>
530002 <span class="comment">%FINDELEMM44 numerically finds the 4x4 transfer matrix of an element</span>
540003 <span class="comment">%  FINDELEM44(ELEM, METHODNAME, ORBITIN)</span>
550004 <span class="comment">%     ELEM          - the element data structure</span>
560005 <span class="comment">%     METHODNAME    - name of the pass-method function</span>
570006 <span class="comment">%     ORBITIN       - 6-by-1 phase space coordinates at the entrance</span>
580007 <span class="comment">%                     The transvese matrix is momentum-dependent,</span>
590008 <span class="comment">%                     the 5-th component of ORBITIN is used as the DP value</span>
600009 <span class="comment">%</span>
610010 <span class="comment">% See also FINDELEMM66</span>
620011
630012 <span class="comment">% See if step size for numerical differentiation</span>
640013 <span class="comment">% is set globally. Otherwise use 1e-7</span>
650014 <span class="keyword">global</span> NUMDIFPARAMS
660015 <span class="comment">% Transverse</span>
670016 <span class="keyword">if</span> isfield(NUMDIFPARAMS,<span class="string">'XYStep'</span>)
680017     dt = NUMDIFPARAMS.XYStep';
690018 <span class="keyword">else</span>
700019     dt =  1e-7;
710020 <span class="keyword">end</span>
720021
730022
740023 <span class="comment">% Build a diagonal matrix of initial conditions</span>
750024 D4 = [dt*eye(4);zeros(2,4)];
760025 <span class="comment">% Add to the orbit_in</span>
770026
780027 RIN = orbit_in*ones(1,8) + [D4, -D4];
790028 <span class="comment">% Propagate through the element</span>
800029 ROUT = feval(MethodName,ELEM,RIN);
810030 <span class="comment">% Calculate numerical derivative</span>
820031 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> &copy; 2003</address>
84</body>
85</html>
Note: See TracBrowser for help on using the repository browser.