source: MML/trunk/at/doc_html/at/atphysics/findthickmpoleraddiffm.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: 6.0 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 findthickmpoleraddiffm</title>
6  <meta name="keywords" content="findthickmpoleraddiffm">
7  <meta name="description" content="FINDTHICKMPOLERADDIFFM">
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; findthickmpoleraddiffm.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>findthickmpoleraddiffm
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>FINDTHICKMPOLERADDIFFM</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 [Bcum, Mcum, r] = findthickmpoleraddifm(rin, PolynomA, PolynomB,L, irho, E0, max_order,num_steps) </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">FINDTHICKMPOLERADDIFFM</pre></div>
31
32<!-- crossreference -->
33<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
34This function calls:
35<ul style="list-style-image:url(../../matlabicon.gif)">
36<li><a href="findthinmpoleraddiffm.html" class="code" title="function [B66, M, rout] = findthinmpoleraddiffm(rin, PolynomA, PolynomB, L, irho, E0, max_order)">findthinmpoleraddiffm</a>        FINDTHINMPOLERADDIFFM</li></ul>
37This function is called by:
38<ul style="list-style-image:url(../../matlabicon.gif)">
39<li><a href="findelemraddiffm.html" class="code" title="function [B, M, r] = findelemraddiffm(ELEM,rin, varargin);">findelemraddiffm</a>        FINDELEMRADDIFFM</li></ul>
40<!-- crossreference -->
41
42<h2><a name="_subfunctions"></a>SUBFUNCTIONS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
43<ul style="list-style-image:url(../../matlabicon.gif)">
44<li><a href="#_sub1" class="code">function [M, rout] = driftm66(L,r);</a></li></ul>
45<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
46<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [Bcum, Mcum, r] = findthickmpoleraddifm(rin, PolynomA, PolynomB,L, irho, E0, max_order,num_steps)</a>
470002 <span class="comment">%FINDTHICKMPOLERADDIFFM</span>
480003
490004 <span class="comment">% Fourth order-symplectic integrator constants</span>
500005 <span class="keyword">persistent</span> DRIFT1 DRIFT2 KICK1 KICK2
510006 <span class="keyword">if</span> isempty(DRIFT1)
520007     DRIFT1   = 0.6756035959798286638;
530008     DRIFT2   = -0.1756035959798286639;
540009     KICK1    =  1.351207191959657328;
550010     KICK2    = -1.702414383919314656;
560011 <span class="keyword">end</span>
570012
580013
590014
600015 SL = L/num_steps;
610016 L1 = SL*DRIFT1;
620017 L2 = SL*DRIFT2;
630018 K1 = SL*KICK1;
640019 K2 = SL*KICK2;
650020
660021 Mcum = eye(6);
670022 Bcum = zeros(6);
680023 r = rin;
690024
700025 <span class="keyword">for</span> m=1:num_steps <span class="comment">% Loop over slices</span>
710026     
720027     [M, r] = <a href="#_sub1" class="code" title="subfunction [M, rout] = driftm66(L,r);">driftm66</a>(L1,r);
730028     Bcum = M*Bcum*M';
740029     Mcum = M*Mcum;
750030     
760031     [B, M, r] = <a href="findthinmpoleraddiffm.html" class="code" title="function [B66, M, rout] = findthinmpoleraddiffm(rin, PolynomA, PolynomB, L, irho, E0, max_order)">findthinmpoleraddiffm</a>(r, PolynomA, PolynomB, K1, irho, E0, max_order);
770032     Bcum = M*Bcum*M' + B;
780033     Mcum = M*Mcum;
790034     
800035     [M, r] = <a href="#_sub1" class="code" title="subfunction [M, rout] = driftm66(L,r);">driftm66</a>(L2,r);
810036     Bcum = M*Bcum*M';
820037     Mcum = M*Mcum;
830038     
840039     [B, M, r] = <a href="findthinmpoleraddiffm.html" class="code" title="function [B66, M, rout] = findthinmpoleraddiffm(rin, PolynomA, PolynomB, L, irho, E0, max_order)">findthinmpoleraddiffm</a>(r, PolynomA, PolynomB, K2, irho, E0, max_order);
850040     Bcum = M*Bcum*M' + B;
860041     Mcum = M*Mcum;
870042                 
880043     [M, r] = <a href="#_sub1" class="code" title="subfunction [M, rout] = driftm66(L,r);">driftm66</a>(L2,r);
890044     Bcum = M*Bcum*M';
900045     Mcum = M*Mcum;
910046     
920047     [B, M, r] = <a href="findthinmpoleraddiffm.html" class="code" title="function [B66, M, rout] = findthinmpoleraddiffm(rin, PolynomA, PolynomB, L, irho, E0, max_order)">findthinmpoleraddiffm</a>(r, PolynomA, PolynomB, K1, irho, E0, max_order);
930048     Bcum = M*Bcum*M' + B;
940049     Mcum = M*Mcum;
950050     
960051     [M, r] = <a href="#_sub1" class="code" title="subfunction [M, rout] = driftm66(L,r);">driftm66</a>(L1,r);
970052     Bcum = M*Bcum*M';
980053     Mcum = M*Mcum;
990054
1000055 <span class="keyword">end</span>
1010056
1020057
1030058 <a name="_sub1" href="#_subfunctions" class="code">function [M, rout] = driftm66(L,r);</a>
1040059 <span class="comment">% transfer matrix of a drift - map linearized at r</span>
1050060
1060061 Pnorm = 1/(1+r(5));
1070062 NormL = L*Pnorm;
1080063 M = eye(6);
1090064 M([7 21]) = NormL;
1100065
1110066
1120067 M([1 3],5) = -NormL*r([2,4])*Pnorm;
1130068 M(6,[2 4]) = -M([1 3],5)';
1140069 M(6,5) =  -NormL*Pnorm*sum(r([2,4]).^2);
1150070
1160071 rout = r;
1170072 rout([1 3]) = r([1 3]) + r([2 4])*NormL;
1180073 rout(6) = r(6) + NormL*Pnorm*sum(r([2,4]).^2)/2;
1190074</pre></div>
120<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>
121</body>
122</html>
Note: See TracBrowser for help on using the repository browser.