Skip to content

Commit 75fcd4f

Browse files
committed
computes the rdts with energy offset dp
1 parent 0cf8b03 commit 75fcd4f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

atmat/atphysics/NonLinearDynamics/computeRDT.m

+11-3
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,35 @@
66
%
77
% RDT=computeRDT(ring, index, varargin)
88
%
9+
% INPUTS
910
% ring is the AT lattice
1011
% index is the vector of indexes where one wants to compute RDTs
1112
% The additional arguments can be up to five strings:
1213
% chromatic, coupling, geometric1, geometric2 and tuneshifts
14+
%
15+
% OPTIONS (order does not matter)
16+
% dp: Default 0. Energy offset to calculate the optics parameters.
1317
%
14-
% example:
18+
% EXAMPLES
1519
% RDT=computeRDT(ring, indexBPM, 'geometric1', 'tuneshifts');
1620
% creates an array of structs (the length of the array is the number of
1721
% indexes where you want to compute driving terms) with first order
1822
% geometric driving terms and tune shifts with amplitude.
1923
% The driving terms are complex numbers, the tune shifts are real.
2024
%
25+
% RDT=computeRDT(ring, indexBPM, 'geometric1', 'dp',0.01);
26+
% Calculate the first order geometric RDTs using the optics with
27+
% 0.01 energy offset.
2128

2229
naddvar=length(varargin);
30+
[dp,args] = getoption(varargin,'dp',0);
2331
chromatic=0;
2432
coupling=0;
2533
geometric1=0;
2634
geometric2=0;
2735
tuneshifts=0;
2836
for ii=1:naddvar
29-
switch varargin{ii}
37+
switch args{ii}
3038
case 'chromatic'
3139
chromatic=1;
3240
case 'coupling'
@@ -55,7 +63,7 @@
5563

5664
indDQSO=findcells(ring,'Class','Bend','Quadrupole','Sextupole','Octupole','Multipole');
5765

58-
[~,AVEBETA,AVEMU,AVEDISP,~,~]=atavedata(ring,0,1:length(ring));
66+
[~,AVEBETA,AVEMU,AVEDISP,~,~]=atavedata(ring,dp,1:length(ring));
5967

6068
Lin=atlinopt(ring,0,1:(length(ring)+1));
6169

0 commit comments

Comments
 (0)