source: MML/trunk/at/doc_html/at/atphysics/mcf2.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.2 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 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 &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; mcf2.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>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
31shift</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>
35This 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>
38This 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>
460002 <span class="comment">%MCF2(RING) calculates momentum compaction factor of RING versus energy</span>
470003 <span class="comment">%shift</span>
480004 <span class="comment">%</span>
490005 <span class="comment">%</span>
500006
510007 <span class="comment">%</span>
520008 <span class="comment">% Modified by Laurent S. Nadolski</span>
530009
540010 <span class="keyword">if</span> nargin &lt; 1
550011     error(<span class="string">'Syntax is mcf2(RING)'</span>);
560012 <span class="keyword">elseif</span> ~iscell(RING)
570013     error(<span class="string">'argument is not a AT RING'</span>)
580014 <span class="keyword">end</span>
590015
600016 dP = 0.000001;
610017 fp0 = <a href="findorbit4.html" class="code" title="function orbit = findorbit4(RING,dP,varargin);">findorbit4</a>(RING,0+delta);
620018 fp = <a href="findorbit4.html" class="code" title="function orbit = findorbit4(RING,dP,varargin);">findorbit4</a>(RING,dP+delta);
630019 <span class="comment">% Build initial condition vector that starts</span>
640020 <span class="comment">% on the fixed point</span>
650021 X0dP = fp;
660022 X0dP(5) = dP+delta;
670023 X0dP(6) = 0;
680024
690025 X0 = [fp0;delta;0];
700026
710027 <span class="comment">% Track X0 for 1 turn</span>
720028 T = ringpass(RING,[X0 X0dP]);
730029 <span class="comment">% Calculate alpha</span>
740030 RingLength = <a href="findspos.html" class="code" title="function spos = findspos(LINE,REFPTS)">findspos</a>(RING,length(RING)+1);
750031 a = (T(6,2)-T(6,1))/(dP*RingLength);
760032</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> &copy; 2003</address>
78</body>
79</html>
Note: See TracBrowser for help on using the repository browser.