source: MML/trunk/at/atphysics/mcf2.m @ 5

Last change on this file since 5 was 4, checked in by zhangj, 11 years ago

Initial import--MML version from SOLEIL@2013

File size: 692 bytes
Line 
1function a = mcf2(RING,delta)
2%MCF2(RING) calculates momentum compaction factor of RING versus energy
3%shift
4%
5% Warning this is an effective momentum compaction at a given energy
6
7%
8% Modified by Laurent S. Nadolski
9
10if nargin < 1
11    error('Syntax is mcf2(RING)');
12elseif ~iscell(RING)
13    error('argument is not a AT RING')
14end
15
16dP  = 1e-6;
17fpp = findorbit4(RING, dP/2+delta);
18fpm = findorbit4(RING,-dP/2+delta);
19% Build initial condition vector that starts
20% on the fixed point
21x0p = [fpp; delta+dP/2; 0];
22
23X0m = [fpm; delta-dP/2;0];
24
25% Track X0 for 1 turn
26T = ringpass(RING,[X0m x0p]);
27% Calculate alpha
28RingLength = findspos(RING,length(RING)+1);
29a = (T(6,2)-T(6,1))/(dP*RingLength);
30
Note: See TracBrowser for help on using the repository browser.