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:
806 bytes
|
Line | |
---|
1 | function alpha = mcf(RING) |
---|
2 | %MCF - Calculates momentum compaction factor (MCF) of RING |
---|
3 | % |
---|
4 | % INPUTS |
---|
5 | % 1. RING - Cell describing the RING in AT |
---|
6 | % |
---|
7 | % OUTPUTS |
---|
8 | % 1. alpha - Momentum compaction factor |
---|
9 | |
---|
10 | % |
---|
11 | % Modified by Laurent S. Nadolski |
---|
12 | % Symmetry around 0 added for computing (second order finite difference) |
---|
13 | |
---|
14 | if nargin < 1 |
---|
15 | error('Syntax is mcf(RING)'); |
---|
16 | elseif ~iscell(RING) |
---|
17 | error('argument is not a AT RING') |
---|
18 | end |
---|
19 | |
---|
20 | dP = 1e-6; |
---|
21 | coddpn = findorbit4(RING,-dP/2); % negative offset |
---|
22 | coddpp = findorbit4(RING,+dP/2); % positive offset |
---|
23 | |
---|
24 | % Build initial condition vector that starts |
---|
25 | % on the fixed point |
---|
26 | X0dPp = [coddpp; dP/2; 0]; |
---|
27 | X0dPn = [coddpn;-dP/2;0]; |
---|
28 | |
---|
29 | % Tracks X0 over 1 turn |
---|
30 | T = ringpass(RING,[X0dPn X0dPp]); |
---|
31 | |
---|
32 | % Calculates alpha |
---|
33 | L0 = findspos(RING,length(RING)+1); |
---|
34 | alpha = (T(6,2)-T(6,1))/(dP*L0); |
---|
35 | |
---|
Note: See
TracBrowser
for help on using the repository browser.