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 | |
---|
1 | function 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 | |
---|
10 | if nargin < 1 |
---|
11 | error('Syntax is mcf2(RING)'); |
---|
12 | elseif ~iscell(RING) |
---|
13 | error('argument is not a AT RING') |
---|
14 | end |
---|
15 | |
---|
16 | dP = 1e-6; |
---|
17 | fpp = findorbit4(RING, dP/2+delta); |
---|
18 | fpm = findorbit4(RING,-dP/2+delta); |
---|
19 | % Build initial condition vector that starts |
---|
20 | % on the fixed point |
---|
21 | x0p = [fpp; delta+dP/2; 0]; |
---|
22 | |
---|
23 | X0m = [fpm; delta-dP/2;0]; |
---|
24 | |
---|
25 | % Track X0 for 1 turn |
---|
26 | T = ringpass(RING,[X0m x0p]); |
---|
27 | % Calculate alpha |
---|
28 | RingLength = findspos(RING,length(RING)+1); |
---|
29 | a = (T(6,2)-T(6,1))/(dP*RingLength); |
---|
30 | |
---|
Note: See
TracBrowser
for help on using the repository browser.