Commit 59db3541 authored by Simone Liuzzo's avatar Simone Liuzzo

tune resonse anlytic corrected

parent 150d5cae
......@@ -40,11 +40,20 @@ end
if isfield(qemres,'quadtuneresponse')
resptune=qemres.quadtuneresponse;
else
disp('computing analytic tune response to quadrupole gradients')
% dnu = - beta/4/pi * dkl
qind = qemres.qcoridx;
[l,~,~]=atlinopt(mach,0,qind);
betas = [arrayfun(@(a)a.beta(1),l,'un',1);arrayfun(@(a)a.beta(2),l,'un',1)];
L = cellfun(@(a)a.Length,mach(qind),'un',1)';
dTunes_dq = betas /4 /pi .*L; % dQhv/dKn
qemres.quadtuneresponse = dTunes_dq;
resptune = dTunes_dq;
% numeric version
% [resptune]=qemtunederiv(mach,qemres.dpp,@setk,1.e-3,...
% [qemres.qcoridx]);
[resptune]=qemtunederiv(mach,qemres.dpp,@setk,1.e-3,...
[qemres.qcoridx]);
qemres.quadtuneresponse = resptune;
% qemres.quadtuneresponse = resptune;
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment