atwiggler implementation #1030
Replies: 3 comments 6 replies
-
|
@marlibgin2 I can provide a python example but I suppose this is not what you are looking for... maybe @oscarxblanco could help? |
Beta Was this translation helpful? Give feedback.
-
|
Hi @marlibgin2 , However, about the ring construction I couldn't find any function in matlab called I leave you here below a FODO example (not using cellcat), let me know if it works. The purpose of this example was checking any tunes difference between a FODO with wiggler set to Bmax=0, and without that wiggler. clear;
%% FODO
the_length = 0.4;
QF = {atmultipole("QF", 0.5, [0 0],[0,1.2])};
drift_length = 0.5;
Dr = {atdrift("Dr", drift_length)};
HalfDr = {atdrift("Dr2", drift_length/2)};
Dr3 = {atdrift("Dr3", 0.00)};
Dr4 = {atdrift("Dr4", the_length)}; %0.4
QD = {atquadrupole("QD", 0.5, -1.2)};
Bend = {atsbend("Bend", 1, 2 * pi / 20)};
RP = {atringparam('fodo',1e9)};
FODOcell = [ ...
RP, HalfDr, Bend, Dr, QF, Dr, Bend, Dr, QD, Dr3, Dr4 ...
];
FODOcell = atsetenergy(FODOcell,1e9);
%% get tune
[t,c] = tunechrom(FODOcell);
%% Wiggler
und = atwiggler('und',Dr4{1}.Length,Dr4{1}.Length/100,0,1000);
%% replace one element
uFODOcell = FODOcell;
uFODOcell{length(FODOcell)} = und;
%% get tune
[t1,c1] = tunechrom(uFODOcell);
%% get tune difference
dd = t1-t;
I would also suggest to update AT matlab because there was a missing step in the integrator which is solved in #1013. |
Beta Was this translation helpful? Give feedback.
-
|
@marlibgin2 , if you don't mind to have a double copy of AT matlab and in order to avoid unnecessary modifications on your system I would suggest to clone again the project (which is not heavy), do the installation (cd atmat; atpath; atmexall) and try it out. It should give you no errors. I don't think this is related to the properties R1,R2,T1,T2. It seems to me there is an incongruity between the compiled executable and the matlab ring construction, which we should be able to trace back in case there are backwards incompatibilities. If you prefer not to clone the project again. I would suggest to take note on the current git commit you are, then pull the newest master, and compile it with atmex. I have used a lot of git jargon in this message, let me know if it is clear. Otherwise I could describe it in more detail. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi I am trying to introduce an ID into a bare lattice without ... IDs. I have decided to use atwiggler, however every attempt to create a "stable" lattice seems to fail. This is the element I am introducing, if I interpret correctly the structure
it is 1m long, with an undulator period of 2cm, and a peak field of 0T. I have zeroed the field to simplify the case
IDh = atwiggler('IDh', 50*0.02, 0.02, 0, 3.0e9, 'GWigSymplecticPass');
I build an achromat as
achrRF_ID = cellcat( IDh, LS_ID, GS,MC1,GE, SS, ...
GS,UC1,GE, ...
GS,UC2,GE, ...
GS,UC3,GE, ...
GS,UC4,GE, ...
GS,UC5,GE, ShortStr_RF, ...
GS,flip(MC2),GE, ...
flip(LS_ID), IDh );
In the .m file that generates the achromat there is a calculation of the main parameters:
[RD, ~] = atlinopt(ring,0,1:numel(ring)+1);
Here I get a plethora of errors
I am kind of lost.
If this does not ring a bell at all ... can I beg someone to pass me an example of a real lattice with an atwiggler element in the structure?
Thanks for your attention
Marco
Beta Was this translation helpful? Give feedback.
All reactions