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 plotcod_alex</title> |
---|
6 | <meta name="keywords" content="plotcod_alex"> |
---|
7 | <meta name="description" content="PLOTCOD Closed Orbit Distortion"> |
---|
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">mml</a> > <a href="index.html">at</a> > plotcod_alex.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 mml/at <img alt=">" border="0" src="../../right.png"></a></td></tr></table>--> |
---|
19 | |
---|
20 | <h1>plotcod_alex |
---|
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>PLOTCOD Closed Orbit Distortion</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 varargout = plotcod(RING,DP) </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">PLOTCOD Closed Orbit Distortion |
---|
31 | PLOTCOD(RING,DP) finds and plots closed orbit for a given momentum |
---|
32 | deviation DP. It calls FINDORBIT4 which assumes a lattice |
---|
33 | with NO accelerating cavities and NO radiation |
---|
34 | |
---|
35 | INPUTS |
---|
36 | 1. RING - At structure |
---|
37 | 2. DP - Energy offset |
---|
38 | |
---|
39 | OUTPUTS (Optional) |
---|
40 | 1. orbit - (x,px,y,py) closed orbit along the ring |
---|
41 | |
---|
42 | See Also <a href="plotbeta.html" class="code" title="function varargout = plotbeta(varargin)">plotbeta</a></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 varargout = plotcod(RING,DP)</a> |
---|
57 | 0002 <span class="comment">%PLOTCOD Closed Orbit Distortion</span> |
---|
58 | 0003 <span class="comment">% PLOTCOD(RING,DP) finds and plots closed orbit for a given momentum</span> |
---|
59 | 0004 <span class="comment">% deviation DP. It calls FINDORBIT4 which assumes a lattice</span> |
---|
60 | 0005 <span class="comment">% with NO accelerating cavities and NO radiation</span> |
---|
61 | 0006 <span class="comment">%</span> |
---|
62 | 0007 <span class="comment">% INPUTS</span> |
---|
63 | 0008 <span class="comment">% 1. RING - At structure</span> |
---|
64 | 0009 <span class="comment">% 2. DP - Energy offset</span> |
---|
65 | 0010 <span class="comment">%</span> |
---|
66 | 0011 <span class="comment">% OUTPUTS (Optional)</span> |
---|
67 | 0012 <span class="comment">% 1. orbit - (x,px,y,py) closed orbit along the ring</span> |
---|
68 | 0013 <span class="comment">%</span> |
---|
69 | 0014 <span class="comment">% See Also plotbeta</span> |
---|
70 | 0015 |
---|
71 | 0016 <span class="comment">% Written by Andrei Terebilo</span> |
---|
72 | 0017 <span class="comment">% Modified by Laurent S. Nadolski</span> |
---|
73 | 0018 <span class="comment">% March 27, 2005 - Default input arguments added</span> |
---|
74 | 0019 |
---|
75 | 0020 <span class="keyword">switch</span> nargin |
---|
76 | 0021 <span class="keyword">case</span> 0 |
---|
77 | 0022 <span class="keyword">global</span> THERING; |
---|
78 | 0023 RING = THERING; |
---|
79 | 0024 DP = 0.0; <span class="comment">% on mometum closed orbit</span> |
---|
80 | 0025 <span class="keyword">case</span> 1 |
---|
81 | 0026 DP = 0; <span class="comment">% on momentum closed orbit</span> |
---|
82 | 0027 <span class="keyword">otherwise</span> |
---|
83 | 0028 <span class="comment">%do nothing</span> |
---|
84 | 0029 <span class="keyword">end</span> |
---|
85 | 0030 |
---|
86 | 0031 |
---|
87 | 0032 localspos = findspos(RING,1:length(RING)+1); |
---|
88 | 0033 orbit = findorbit4(RING,DP,1:length(RING)+1); |
---|
89 | 0034 <span class="comment">%orbit = findorbit6(RING,1:length(RING)+1);</span> |
---|
90 | 0035 |
---|
91 | 0036 plot(localspos,orbit(1,:)*1e3,<span class="string">'.-r'</span>); |
---|
92 | 0037 title(<span class="string">'Closed Orbit Distortion'</span>) |
---|
93 | 0038 hold on |
---|
94 | 0039 plot(localspos,orbit(3,:)*1e3,<span class="string">'.-b'</span>); |
---|
95 | 0040 hold off |
---|
96 | 0041 |
---|
97 | 0042 A = axis; |
---|
98 | 0043 A(1:2) = [0, localspos(end)]; |
---|
99 | 0044 axis(A); |
---|
100 | 0045 |
---|
101 | 0046 legend(<span class="string">'Horizontal'</span>,<span class="string">'Vertical'</span>); |
---|
102 | 0047 xlabel(<span class="string">'s - position [m]'</span>); |
---|
103 | 0048 ylabel(<span class="string">'orbit [mm]'</span>); |
---|
104 | 0049 |
---|
105 | 0050 grid on |
---|
106 | 0051 |
---|
107 | 0052 <span class="keyword">if</span> nargout > 0 |
---|
108 | 0053 varargout{1} = orbit; |
---|
109 | 0054 <span class="keyword">end</span></pre></div> |
---|
110 | <hr><address>Generated on Mon 21-May-2007 15:29:18 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address> |
---|
111 | </body> |
---|
112 | </html> |
---|