SULI Log 2003
Wednesday, July 30, 2003
 
Professor Thomas M. Cover

I e-mailed this guy after receiving an e-mail from Chun-Xi Wang regarding Principal Component Analysis.

Some Ideas To Think About
The FFT of the BPM matrix is the key. We can quickly isolate the betatron frequency, so why do we use SVD? Because we don’t care about the frequency—it is only a tool. What yields the orbits is the amplitude. I am exploring SVD because the current MIA model does not SVD enhance data. I would like to explore how much error this causes relative to the “actual” case and the SVD-enhanced case.

We are also now thinking about phase. We have a “toy” (as Dr. Yan called it) to model noisy BPMs. We can explore the betatron phase by tan^-1(sinlike/coslike), or tan^-1(B/A). Note, this is different from the BPM phase that I inserted into my ideal BPM data matrix.

Things to play with in my “toy”: Right now the period is perfect for periodic motion. What if I change the period? What is the significance of the BPM phase and the angular frequency? I might as well change my variable names to better see this in my equations.

What about the eigenvectors in V? What do those mean? What do they mean when they are chopped off?

 
INTERESTING! See "explorations using SVD" file that i made!
Tuesday, July 29, 2003
 
Questions:
1. Am I doing the right thing by "chopping" the last mode? Or should I just set it equal to zero?
Monday, July 28, 2003
 
Preliminary results (using findBetaAuto):
Bxx=2.3153
Bxy=2.3162
Byx=2.7687
Byy=2.3180
 
function [trim]=findTrim(fxx, xbuferXs)
% function [trim]=findTrim(cfxx)
% July 28, 2003 by Philip Tanedo
% originally from findBetaAuto
% made into a separate function
% ...for use with findBetaAutoSC

tempPeak=0;
tempIndex=0;
i=0;
[tempIndex, tempPeak]=findPeak(fxx);
peakVec(i+1)=abs(tempPeak);
for(i=1:15)
temp=xbuferXs;
for(j=1:i)
temp=BotRowChop(temp); % fine-tuning the frequency
end
fxx=fft(temp);
fxx=TopRowChop(fxx); % chop closed orbit
[tempIndex, tempPeak]=findPeak(fxx);
peakVec(i+1)=abs(tempPeak);
end
[tempIndex, tempPeak]=findPeak(peakVec);
trim=tempIndex-1; % because of note above: to accoun for zeroth trim, index is i+1
disp(['TRIM = ', num2str(trim) ]);

 
function [beta]=findBetaAuto(xbuferXs, label)
% function [beta]=findBetaAuto(xbuferXs, label)
% July 28, 2003 by Philip Tanedo
% MODIFIED version of findBeta
% Automates as many processes as possible
% Returns betatron oscillation for fxx
% Preconditions:
% ...flipBuf.mat has been loaded, 'tools' added to path
% Procedure:
% 0. fxx=fft(XbuferXs)
% 1. kill closed orbit
% 2. plot all for user
% 3. prompt user for reasonable data
% 4. close all
% 5. plot representation of frequency increments
% 6. prompt user for reasonable size
% 7. adjust size
% 8. isolate peak frequency
% 9. return peak frequency as betatron frequency
% NOTE: can also be used w/ noisy data to extract
% ...noise frequency when noise is bigger than betatron

% 0
fxx = fft(xbuferXs);

% 1
fxx=TopRowChop(fxx);

% 2
% graphAllFC(fxx, label);

% 3
disp('Please select a reasonable plot to use as key');
choice=input('Index: ');

% 4
close all;

% STEPS 5 and 6 from original findBeta function are commented out
% see below for modification (automate)

% % 5
% i=0;
% figure;
% plot(abs(fxx(:,choice)));
% legend(num2str(choice), 0);
% xlabel('Frequency')
% ylabel('Magnitude (complex)')
% title(['BPM frequency content for BPM#s: ' num2str(choice) ' TRIM VALUE: ' num2str(i)])
%
% for(i=1:15)
%
% temp=xbuferXs;
% for(j=1:i)
% temp=BotRowChop(temp); % fine-tuning the frequency
% end
%
% fxx=fft(temp);
% fxx=TopRowChop(fxx); % chop closed orbit
%
% figure
%
% plot(abs(fxx(:,choice)));
% legend(num2str(choice), 0);
% xlabel('Frequency')
% ylabel('Magnitude (complex)')
% title(['BPM frequency content for BPM#s: ' num2str(choice) ' TRIM VALUE: ' num2str(i)])
% end
%
% % 6 -- note: I could automate this step, as well
% disp('Please select a reasonable plot to use as key');
% trim=input('Trim Value: ');

% 5 and 6 automated

trim=findTrim(fxx, xbuferXs);

% 7
close all;

temp=xbuferXs;
for(j=1:trim)
temp=BotRowChop(temp); % fine-tuning the frequency
end
fxx=real(fft(temp));
fxx=TopRowChop(fxx); % chop closed orbit

% 8
% [pindex, pvalue]=findPeak(fxx);

% but now what does this mean at all?
% finding the right frequency should be trivial

% DESIGN NOTE
% I will design this function to find the complex frequency
% I think this should be good enough to find the sin/cos freq
% Otherwise, I can always modify new functions

% Below code is cited from
% "Spectral Analysis using the FFT" by Bret Ninness
% http://www.ee.newcastle.edu.au/brett/elec2400/matlab4.pdf
% Page 2

% Start citation
temp=size(fxx);
ws=2*pi/temp(1);
wnorm=-pi:ws:pi;
wnorm=wnorm(1:temp(1));
% flip's comment: this is a nifty idea!
% I should have incorporated something like that last line in my
% ... "chop" functions
% End

%fsxx: fft shift of fxx
fsxx=fftshift(fxx);
[spindex, spvalue]=findPeak(fsxx);
beta=abs(wnorm(spindex));
 
Things to remember: for the discrete fourier transform, there is a max resolution!
 
Writing FFT script. A little bit tedious. How do I convert from FFT frequency to "real" frequency?
Friday, July 25, 2003
 
Introduction

In May of 2003, physicists and engineers at the Stanford Linear Accelerator Center were able to achieve record-breaking, peak luminosity in the PEP-II positron/electron storage rings. (Woods) This unprecedented improvement was due in part to a statistical technique called Model Independent Analysis (MIA), which evaluates data without a priori information about the underlying physical apparatus. In order to understand the mechanism by which MIA is able to analyze PEP-II beam data, however, it is useful to first be able to model a simplified particle accelerator in terms of linear optics.

In such a representation, we consider the trace of a particle’s transverse position (x and y coordinates as the particle travels in the z-direction) in 4-dimensional phase space (x and y position along with respective momenta). By representing each lattice element, such as a focusing-defocusing quadrupole magnet, by a matrix transformation acting on a phase space vector, we can extract turn-by-turn maps for the particle’s phase-space position. One can decompose these turn-by-turn maps, or local transfer matrices, into simple rotations in normalized, decoupled phase space, which makes the beam dynamics much simpler mathematically.

Unfortunately, in the real machine we are unable to directly quantify particles’ momenta, and are limited to the data acquired from beam position monitors (BPMs) to determine the center of the electron beam. With what appears to be a mathematical sleight of hand, however, one may still extract the local transfer matrix from this information. BPM data along a given axis (x or y) may be represented as an n x m matrix where n is the number of consecutive-turn measurements and m is the number of BPMs. By exciting the beam’s two eigenplanes and extracting sine-like and cosine-like orbits for each excitation, one collects four linearly-independent orbits which completely determine the linear optics of the system. For example, the data from the excitation of the beam’s first eigenplane results in two data matrices, one representing the x position of the beam at each x-sensitive BPM and the other representing the corresponding y position at each y-sensitive BPM. (In PEP-II not every BPM records both x and y data.) As eigenplane one lies closer to the x-axis of the BPMs, it is a much clearer source of information about the sine-like and cosine-like frequency of betatron oscillations.

BPM noise is removed from the data through the use of FFT and SVD, which also provide a way to identify noisy BPMs and even extract dispersion from synchrotron modes. To fit data, one assumes the longitudinal position of the beam’s magnets are fixed and known. BPM errors and the precise strength of each magnet are then treated as variables and a numerical algorithm is iterated to fit the clean BPM data with those variables. The machine’s ideal lattice is used as an initial guess for the algorithm. To fit data, one assumes the longitudinal position of the beam’s magnets are fixed and known. BPM errors and the precise strength of each magnet are then treated as variables and a numerical algorithm is iterated to fit the clean BPM data with those variables. The machine’s ideal lattice is used as an initial guess for the algorithm. To fit data, one assumes the longitudinal position of the beam’s magnets are fixed and known. BPM errors and the precise strength of each magnet are then treated as variables and a numerical algorithm is iterated to fit the clean BPM data with those variables. The machine’s ideal lattice is used as an initial guess for the algorithm. To fit data, one assumes the longitudinal position of the beam’s magnets are fixed and known. BPM errors and the precise strength of each magnet are then treated as variables and a numerical algorithm is iterated to fit the clean BPM data with those variables. The machine’s ideal lattice is used as an initial guess for the algorithm.

The data on BPM gains and tilt from several sets of data can be analyzed for statistical patterns. Such an analysis was done on the BPM error data for April 29th, 2003 (pre-processed by MIA), and the results show that some BPMs have consistent systemic errors. These errors, along with data about noisy and bad BPMs from the FFT and SVD procedures, are being presented to the PEP-II BPM Working Group with a reccomendation for recalibration.

While the scope of this project is limited to pedagogical exploration of linear optics due to time constraints, I strongly hope to continue this project with the purpose of using MIA to find an analytical method to determine the Courant parameter and betatron oscillations in the eigenplanes of a coupled system.

References

Woods, H. R. (2003).
PEP-II Attains Record Beam Luminosity. Interaction Point.
May 16, 2003.

Thursday, July 24, 2003
 
I isolated my ringing-in-the-middle BPMS along with my noisy BPM. And I'm having a lot more fun plotting stuff on matlab! Things are fun again.

I would still like to study the frequency shizzle, however. I wonder if I can find someone who can help me with that. (How to interpret frequency content)

Maybe i'll look at that old printout I had.
Speaking of which--reminder: get old printouts and materials.
 
Went back and finished an old project: custom 4x4 ideal lattice creation. It might come in handy some time in the future. I could always customize a design to form an "idealized" linear PEP-II with no energy consideration. Of course... then it would be the same as any other machine of similar idealization.

Back to those fourier transforms.
 
I'm frustrated by oscillating between believing that I have nothing to write about, and having everything in the world to write about. I'm either writing an article for the Stanford Daily or an encyclopedia.
 
Here's something cool that I forgot to mention from yesterday:

PEPII uses RF frequency microwaves to regulate the beam and keep it "bunched up." It is conventional to think of the waveguides as slowing down the electrons ahead of the bunch and speeding up those behind it.

While this is the net effect, what actually happens is that the electrons ahead of the bunch are sped up, causing relativistic effects and making the particle more massive. Massive particles have more intertia and do not turn as tightly, and thus are relegated to a slightly larger (radius) orbit. The size of this larger orbit overcompensates for the higher speed, and the particle falls behind to join the rest of the bunch.

Pretty neat, huh?

My questions about what i'm doing.

MIA DATA
(1) BPM gains and tilt. Easy to compute, simple statistics.
(2) BPM data
(a) Identify bad, dead BPMS
(b) Extract clean signal
(c) Find eigenplane

Questions:
How does this all lead to higher luminosity?
What is my overreaching goal?
So even if i can make a linear optics representation--which is only an academic contribution--what is really done to modify the machine?
What is nonlinear optics?
Wednesday, July 23, 2003
 
Assignments:
* Use SVD (After eliminating closed orbit) and compare results to FFT

NOTE: don't worry too much about getting rid of the funky spikes on the end, just use the spikes that are correct

* try using FFT and SVD together

Some values:
range of betatron oscillations: .5-.7
range of synchrotron oscillation: .03

Food for thought: figure out what the freakin' units are on an FFT'd function. They should be something like __*2pi = angular frequency.

Long term project:
Can I extract eigenplane 1 and 2 data from bpm data? (This is publishable work)
 
What do I do with the two dead BPMs that I found?
 
I can do it--I can do it--I can do it--I can do it--I can do it--I can do it!!

I have to filter by coinciding peaks first!!
Then I can make a vector of coinciding peak and then use the SAME "chop of at a certain discrimination fraction" technique that I've been doing all this time.
 
Yesterday: Talk by Andrei Linde. He's an *excellent* speaker and absolutely hilarious.

Today, goals:
1. program to take noise out of bpm data
2. program to convert clean frequency content into clean signal
3. analyze clean signal
4. SVD enhance
5. analyze enhanced signal
Tuesday, July 22, 2003
 
Rahul just taught be a little about convolution (and he recommended another book for me to learn FFT from). Very cool stuff!
 
Observations from playing with april 29 bpm data:
Funny xbuferX results for BPM 1 (xcomTags(1)) and 318 (xcomTags(196)).

Why are they at such a different range?
 
Finished the main part of my BPM error program. I think I'll go back to playing with FFT and the BPM data. I wonder what else there is for me out there?

Powered by Blogger