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 mcf2</title> |
---|
6 | <meta name="keywords" content="mcf2"> |
---|
7 | <meta name="description" content="MCF2(RING) calculates momentum compaction factor of RING versus energy"> |
---|
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> > mcf2.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>mcf2 |
---|
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>MCF2(RING) calculates momentum compaction factor of RING versus energy</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 a = mcf2(RING,delta) </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">MCF2(RING) calculates momentum compaction factor of RING versus energy |
---|
31 | shift</pre></div> |
---|
32 | |
---|
33 | <!-- crossreference --> |
---|
34 | <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2> |
---|
35 | This function calls: |
---|
36 | <ul style="list-style-image:url(../../matlabicon.gif)"> |
---|
37 | <li><a href="findorbit4.html" class="code" title="function orbit = findorbit4(RING,dP,varargin);">findorbit4</a> FINDORBIT4 finds closed orbit in the 4-d transverse phase</li><li><a href="findspos.html" class="code" title="function spos = findspos(LINE,REFPTS)">findspos</a> FINDSPOS returns longitudinal positions of accelerator lattice elements.</li></ul> |
---|
38 | This function is called by: |
---|
39 | <ul style="list-style-image:url(../../matlabicon.gif)"> |
---|
40 | </ul> |
---|
41 | <!-- crossreference --> |
---|
42 | |
---|
43 | |
---|
44 | <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2> |
---|
45 | <div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function a = mcf2(RING,delta)</a> |
---|
46 | 0002 <span class="comment">%MCF2(RING) calculates momentum compaction factor of RING versus energy</span> |
---|
47 | 0003 <span class="comment">%shift</span> |
---|
48 | 0004 <span class="comment">%</span> |
---|
49 | 0005 <span class="comment">%</span> |
---|
50 | 0006 |
---|
51 | 0007 <span class="comment">%</span> |
---|
52 | 0008 <span class="comment">% Modified by Laurent S. Nadolski</span> |
---|
53 | 0009 |
---|
54 | 0010 <span class="keyword">if</span> nargin < 1 |
---|
55 | 0011 error(<span class="string">'Syntax is mcf2(RING)'</span>); |
---|
56 | 0012 <span class="keyword">elseif</span> ~iscell(RING) |
---|
57 | 0013 error(<span class="string">'argument is not a AT RING'</span>) |
---|
58 | 0014 <span class="keyword">end</span> |
---|
59 | 0015 |
---|
60 | 0016 dP = 0.000001; |
---|
61 | 0017 fp0 = <a href="findorbit4.html" class="code" title="function orbit = findorbit4(RING,dP,varargin);">findorbit4</a>(RING,0+delta); |
---|
62 | 0018 fp = <a href="findorbit4.html" class="code" title="function orbit = findorbit4(RING,dP,varargin);">findorbit4</a>(RING,dP+delta); |
---|
63 | 0019 <span class="comment">% Build initial condition vector that starts</span> |
---|
64 | 0020 <span class="comment">% on the fixed point</span> |
---|
65 | 0021 X0dP = fp; |
---|
66 | 0022 X0dP(5) = dP+delta; |
---|
67 | 0023 X0dP(6) = 0; |
---|
68 | 0024 |
---|
69 | 0025 X0 = [fp0;delta;0]; |
---|
70 | 0026 |
---|
71 | 0027 <span class="comment">% Track X0 for 1 turn</span> |
---|
72 | 0028 T = ringpass(RING,[X0 X0dP]); |
---|
73 | 0029 <span class="comment">% Calculate alpha</span> |
---|
74 | 0030 RingLength = <a href="findspos.html" class="code" title="function spos = findspos(LINE,REFPTS)">findspos</a>(RING,length(RING)+1); |
---|
75 | 0031 a = (T(6,2)-T(6,1))/(dP*RingLength); |
---|
76 | 0032</pre></div> |
---|
77 | <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> |
---|
78 | </body> |
---|
79 | </html> |
---|