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 elementpassdemo</title> |
---|
6 | <meta name="keywords" content="elementpassdemo"> |
---|
7 | <meta name="description" content="ELEMENTPASSDEMO self-running tutorial"> |
---|
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">atdemos</a> > elementpassdemo.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/atdemos <img alt=">" border="0" src="../../right.png"></a></td></tr></table>--> |
---|
19 | |
---|
20 | <h1>elementpassdemo |
---|
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>ELEMENTPASSDEMO self-running tutorial</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>This is a script file. </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">ELEMENTPASSDEMO self-running tutorial |
---|
31 | 1. Phase-Space tracking variables |
---|
32 | 2. Tracking through individual elements |
---|
33 | 3. Method - Element consistencyclear all</pre></div> |
---|
34 | |
---|
35 | <!-- crossreference --> |
---|
36 | <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2> |
---|
37 | This function calls: |
---|
38 | <ul style="list-style-image:url(../../matlabicon.gif)"> |
---|
39 | <li><a href="spear2.html" class="code" title="function spear2">spear2</a> SPEAR2 example lattice definition file</li></ul> |
---|
40 | This function is called by: |
---|
41 | <ul style="list-style-image:url(../../matlabicon.gif)"> |
---|
42 | </ul> |
---|
43 | <!-- crossreference --> |
---|
44 | |
---|
45 | |
---|
46 | <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2> |
---|
47 | <div class="fragment"><pre>0001 <span class="comment">%ELEMENTPASSDEMO self-running tutorial</span> |
---|
48 | 0002 <span class="comment">% 1. Phase-Space tracking variables</span> |
---|
49 | 0003 <span class="comment">% 2. Tracking through individual elements</span> |
---|
50 | 0004 <span class="comment">% 3. Method - Element consistencyclear all</span> |
---|
51 | 0005 clc |
---|
52 | 0006 echo on |
---|
53 | 0007 <span class="comment">% The term 'tracking' in Accelerator Physics refers to numerical simulation</span> |
---|
54 | 0008 <span class="comment">% of particle motion in phase-space as it passes through an accelerator</span> |
---|
55 | 0009 <span class="comment">%</span> |
---|
56 | 0010 <span class="comment">% MATLAB Accelerator Toolbox uses 6-by-1 column vectors to represent</span> |
---|
57 | 0011 <span class="comment">% Individual particles in phase space with components [x px y py delta ct]'</span> |
---|
58 | 0012 <span class="comment">% For example:</span> |
---|
59 | 0013 R = [0.01 0 0.01 0 0 0]' |
---|
60 | 0014 |
---|
61 | 0015 <span class="comment">% 6-by-N matrixes are used to represent groups of N particles</span> |
---|
62 | 0016 <span class="comment">%</span> |
---|
63 | 0017 RRR = [R 2*R 3*R] |
---|
64 | 0018 |
---|
65 | 0019 pause <span class="comment">% Press any key to continue</span> |
---|
66 | 0020 clc |
---|
67 | 0021 <span class="comment">% In Accelerator Toolbox tracking is built upon an open-ended</span> |
---|
68 | 0022 <span class="comment">% collection of functions that track particles through</span> |
---|
69 | 0023 <span class="comment">% individual accelerator elements</span> |
---|
70 | 0024 <span class="comment">%</span> |
---|
71 | 0025 <span class="comment">% Examle: Load spear2 lattice</span> |
---|
72 | 0026 <a href="spear2.html" class="code" title="function spear2">spear2</a> |
---|
73 | 0027 <span class="comment">%</span> |
---|
74 | 0028 <span class="comment">% Second element in spear2 lattice is a drift space</span> |
---|
75 | 0029 SOMEDRIFT = THERING{2} |
---|
76 | 0030 whos SOMEDRIFT |
---|
77 | 0031 <span class="comment">% SOMEDRIFT is a MATLAB structure</span> |
---|
78 | 0032 <span class="comment">% Now use function DRIFTPASS to track through SOMEDRIFT</span> |
---|
79 | 0033 pause <span class="comment">% Press any key to continue</span> |
---|
80 | 0034 clc |
---|
81 | 0035 driftpass(SOMEDRIFT,R) |
---|
82 | 0036 <span class="comment">%</span> |
---|
83 | 0037 <span class="comment">% DRIFTPASS and other tracking functions in accelerator Toolbox</span> |
---|
84 | 0038 <span class="comment">% accept matrix input to simultaneously track many particles</span> |
---|
85 | 0039 <span class="comment">%</span> |
---|
86 | 0040 driftpass(SOMEDRIFT,RRR) |
---|
87 | 0041 <span class="comment">% Obviously in a drift space particle momentums don't change</span> |
---|
88 | 0042 <span class="comment">%</span> |
---|
89 | 0043 <span class="comment">% Try this</span> |
---|
90 | 0044 DriftPass(SOMEDRIFT,[0 0.01 0 0.02 0 0]'), |
---|
91 | 0045 |
---|
92 | 0046 pause <span class="comment">% Press any key to continue</span> |
---|
93 | 0047 clc |
---|
94 | 0048 <span class="comment">% Accelerator Toolbox provides an open endeed collection</span> |
---|
95 | 0049 <span class="comment">% of functions that track through elements using various</span> |
---|
96 | 0050 <span class="comment">% field models.</span> |
---|
97 | 0051 <span class="comment">%</span> |
---|
98 | 0052 <span class="comment">% For example with a more interesting element QUADRUPOLE</span> |
---|
99 | 0053 <span class="comment">% the user can use different methods</span> |
---|
100 | 0054 <span class="comment">% implemented as different pass-functions:</span> |
---|
101 | 0055 |
---|
102 | 0056 SOMEQUAD = THERING{5}; |
---|
103 | 0057 <span class="comment">% ______________________________________________________</span> |
---|
104 | 0058 QuadLinearPass(SOMEQUAD,R) |
---|
105 | 0059 <span class="comment">% ______________________________________________________</span> |
---|
106 | 0060 StrMPoleSymplectic4Pass(SOMEQUAD,R) |
---|
107 | 0061 <span class="comment">% ______________________________________________________</span> |
---|
108 | 0062 StrMPoleSymplectic4RadPass(SOMEQUAD,R) |
---|
109 | 0063 |
---|
110 | 0064 pause <span class="comment">% Press any key to continue</span> |
---|
111 | 0065 clc |
---|
112 | 0066 <span class="comment">% The choice of a proper model depends on</span> |
---|
113 | 0067 <span class="comment">%</span> |
---|
114 | 0068 <span class="comment">% 1. The problem</span> |
---|
115 | 0069 <span class="comment">%</span> |
---|
116 | 0070 <span class="comment">% 2. Speed-accuracy trade-off</span> |
---|
117 | 0071 <span class="comment">% For example:</span> |
---|
118 | 0072 <span class="comment">% StrMPoleSymplectic4Pass (4-th order integrator)</span> |
---|
119 | 0073 <span class="comment">% is slower but more accurate</span> |
---|
120 | 0074 <span class="comment">% than StrMPoleSymplectic2Pass (2-nd order integrator)</span> |
---|
121 | 0075 <span class="comment">% 3. Physical considerations</span> |
---|
122 | 0076 <span class="comment">% For example:</span> |
---|
123 | 0077 <span class="comment">% DRIFTPASS assumes a field-free region which is</span> |
---|
124 | 0078 <span class="comment">% NOT a good model for a quadrupole magnet</span> |
---|
125 | 0079 <span class="comment">% 4. Element-Method consistency</span> |
---|
126 | 0080 <span class="comment">% Element data gets passed to a pass-function as the first argument</span> |
---|
127 | 0081 <span class="comment">% Pass-function attempts to use the field with specific name:</span> |
---|
128 | 0082 <span class="comment">% For example:</span> |
---|
129 | 0083 <span class="comment">% QUADLINEARPASS needs fields 'Length' and 'K' ...</span> |
---|
130 | 0084 <span class="comment">% If the element is a drift it does not have 'K' field</span> |
---|
131 | 0085 <span class="comment">% If in the above examples we tried QUADLINEARPASS(SOMEDRIFT,R)</span> |
---|
132 | 0086 <span class="comment">% MATLAB would ungracefully stop excecution</span> |
---|
133 | 0087 <span class="comment">% !!! This feature puts responsibility for consistency between</span> |
---|
134 | 0088 <span class="comment">% Pass-functions used and elements ON THE USER. Small price to</span> |
---|
135 | 0089 <span class="comment">% pay for flexibility !!!</span> |
---|
136 | 0090 <span class="comment">%</span> |
---|
137 | 0091 pause <span class="comment">% Press any key to continue</span> |
---|
138 | 0092 clc |
---|
139 | 0093 <span class="comment">% Available and extensively tested methods in Accelerator Toolbox 1.0</span> |
---|
140 | 0094 <span class="comment">%</span> |
---|
141 | 0095 <span class="comment">% AperturePass</span> |
---|
142 | 0096 <span class="comment">% BendLinearPass</span> |
---|
143 | 0097 <span class="comment">% BndMPoleSymplectic4Pass</span> |
---|
144 | 0098 <span class="comment">% BndMPoleSymplectic4RadPass</span> |
---|
145 | 0099 <span class="comment">% DriftPass</span> |
---|
146 | 0100 <span class="comment">% IdentityPass</span> |
---|
147 | 0101 <span class="comment">% QuadLinearPass</span> |
---|
148 | 0102 <span class="comment">% StrMPoleSymplectic4Pass</span> |
---|
149 | 0103 <span class="comment">% StrMPoleSymplectic4RadPass</span> |
---|
150 | 0104 <span class="comment">% ThinCavityPass</span> |
---|
151 | 0105 <span class="comment">% ThinCorrectorPass</span> |
---|
152 | 0106 <span class="comment">%</span> |
---|
153 | 0107 <span class="comment">% The names were ment to be long and self-explanatory and end with 'Pass'</span> |
---|
154 | 0108 <span class="comment">%</span> |
---|
155 | 0109 <span class="comment">% Calling syntax is allways for all element pass-functions is the same</span> |
---|
156 | 0110 <span class="comment">%</span> |
---|
157 | 0111 <span class="comment">% These files are originally written in C and converted to MATLAB mex-functions</span> |
---|
158 | 0112 <span class="comment">% They are located (together with source codes and some with help files)</span> |
---|
159 | 0113 <span class="comment">% in ..\simulator\element</span> |
---|
160 | 0114 |
---|
161 | 0115 pause <span class="comment">% Press any key to finish</span> |
---|
162 | 0116 clc |
---|
163 | 0117 |
---|
164 | 0118 echo off |
---|
165 | 0119 clc</pre></div> |
---|
166 | <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> |
---|
167 | </body> |
---|
168 | </html> |
---|