So, I now have software that can add a kick map element to the lattice and code to track through.
I am documenting it on wikidot, here. The kick-map addition code is called id_table_global for the one that does it via a global variable, and id_table for the one that directly outputs the element.
The tracking code is called IDTablePass and is based in c code that is compiled to mex code.
I create the kick map using RadiaToTrack Mathematica notebook. I start with a simple planar undulator with a vertical field of 0.76 Tesla, a 35 mm period, and 5 periods. The gap here is 11 mm. After running the und[] routine, one gets an index g to the pointer to the structure. One can then generate the kickmap by running the maketable[] command. One can then output this to a text file, or to a .mat file. The element creation file in Matlab needs to be able to read this file.
We add the element to THERING by issuing the commands:
idtable_global('scw', 1, 'scw31.dat', 6.04, 'IDTablePass')
THERING={THERING{:},FAMLIST{end}.ElemData};
Once the element is in the Matlab structure, one do tracking studies and compute different quantities. One may do linear lattice studies for example to find the changed tune.
The reason why I write this out is that I don't see the result as particularly interesting. Many have computed the tune shift of an undulator before and probably checked an implementation in a tracking code to the formula. This should be implemented in way that it becomes easy to do. It is testing, packaging, and documentation rather than a science or numerical study. Thus, one needs to proceed carefully with respect to the tools. All parts should be easy to use.
In my own case, I implement it both on a laptop and on a PC, and the software is different. So I am in essence implementing it twice. So it goes slowly, but hopefully is clear once its done.
Thursday, February 16, 2012
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment