1 | function plottwiss(varargin) |
---|
2 | %PLOTTWISS - Plot the optical functions and tune of the present lattice |
---|
3 | |
---|
4 | |
---|
5 | %[TD, Tune] = twissring(RING,0,1:(length(RING)+1),'chrom'); |
---|
6 | |
---|
7 | [BetaX, BetaY, Sx, Sy, Tune] = modeltwiss('Beta', 'All'); |
---|
8 | [EtaX, EtaY] = modeltwiss('Eta', 'All'); |
---|
9 | |
---|
10 | |
---|
11 | %figure |
---|
12 | clf reset; |
---|
13 | |
---|
14 | plot(Sx, BetaX, '-b'); |
---|
15 | hold on; |
---|
16 | plot(Sy, BetaY, 'r'); |
---|
17 | plot(Sx, 100*EtaX, '-g'); |
---|
18 | plot(Sy, 100*EtaY, '-m'); |
---|
19 | |
---|
20 | xlabel('s - position [meters]'); |
---|
21 | %ylabel('[meters]'); |
---|
22 | title(sprintf('Optical Functions ({\\it \\nu_x} = %5.3f, {\\it \\nu_y} = %5.3f)', Tune(1),Tune(2))); |
---|
23 | |
---|
24 | axis tight; |
---|
25 | |
---|
26 | |
---|
27 | % Plot 1 sector |
---|
28 | a = axis; |
---|
29 | N = getnumberofsectors; |
---|
30 | L = getfamilydata('Circumference'); |
---|
31 | if ~isempty(L) && ~isempty(N) |
---|
32 | a(2) = L / N; |
---|
33 | end |
---|
34 | |
---|
35 | % Make room for the lattice |
---|
36 | DeltaY = a(4) - a(3); |
---|
37 | a(3) = a(3) - .12 * DeltaY; |
---|
38 | axis(a); |
---|
39 | |
---|
40 | |
---|
41 | % Draw the lattice |
---|
42 | a = axis; |
---|
43 | drawlattice(a(3)+.06*DeltaY, .05*DeltaY); |
---|
44 | axis(a); |
---|
45 | hold off; |
---|
46 | |
---|
47 | |
---|
48 | legend('{\it\beta_x [meters]}','{\it\beta_y [meters]}','{\it\eta_x [cm]}','{\it\eta_y [cm]}',0); |
---|
49 | %legend('{\it\beta_x}','{\it\beta_y}','{\it\eta_x \times 100}','{\it\eta_y \times 100}',0); |
---|