Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BeamDynamics
matutil
Commits
f9b2cd6f
Commit
f9b2cd6f
authored
Oct 13, 2018
by
beamdyn
Browse files
corrected bug in fitted quadrupole selection
parent
7b0d6db1
Changes
2
Hide whitespace changes
Inline
Side-by-side
qem/qemderivAnalytic.m
View file @
f9b2cd6f
...
...
@@ -80,17 +80,21 @@ disp('ANALYTIC QEMPANEL Response V2')
varidx
);
qind
=
find
(
atgetcells
(
mach
,
'Class'
,
'Quadrupole'
))
'
;
% response matrix computed always at all quadrupoles
quadforresponse
=
find
(
ismember
(
qind
,
varidx
));
% quadrupoles to use for fit amoung all
dispfunc
(
2
,
3
);
for
i
b
=
1
:
nq
for
i
q
=
1
:
nq
ib
=
quadforresponse
(
iq
);
% use only selected quadrupoles
rha
=
dX_dq
(:,:,
ib
);
rva
=
dY_dq
(:,:,
ib
);
dxdqa
=
[
-
dDx_dq
(:,
ib
);
0
;
0
]/
dval
(
i
b
);
% analytic, no tune dispersion derivative very different from
dresp
(:,
i
b
)
=
[
rha
(:);
rva
(:);
dxdqa
];
dxdqa
=
[
-
dDx_dq
(:,
ib
);
0
;
0
]/
dval
(
i
q
);
% analytic, no tune dispersion derivative very different from
dresp
(:,
i
q
)
=
[
rha
(:);
rva
(:);
dxdqa
];
rhsa
=
dXY_ds
(:,:,
ib
);
rvsa
=
dYX_ds
(:,:,
ib
);
dxdqsa
=
[
-
dDy_ds
(:,
ib
)]/
dval
(
i
b
);
% analytic, no tune dispersion derivative very different from
drespskew
(:,
i
b
)
=
[
rhsa
(:);
rvsa
(:);
dxdqsa
];
dxdqsa
=
[
-
dDy_ds
(:,
ib
)]/
dval
(
i
q
);
% analytic, no tune dispersion derivative very different from
drespskew
(:,
i
q
)
=
[
rhsa
(:);
rvsa
(:);
dxdqsa
];
end
...
...
sem/semderivAnalytic.m
View file @
f9b2cd6f
...
...
@@ -57,15 +57,19 @@ resp=zeros(nbpm*(nhst+nvst),nq);
respa
=
resp
;
LQ
=
atgetfieldvalues
(
mach
,
fitlist
,
'Length'
);
for
ib
=
1
:
nq
qind
=
find
(
atgetcells
(
mach
,
'Class'
,
'Quadrupole'
))
'
;
% response matrix computed always at all quadrupoles
quadforresponse
=
find
(
ismember
(
qind
,
fitlist
));
% quadrupoles to use for fit amoung all
for
iq
=
1
:
nq
% rv=vqb(:,ib)*hkq(ib,:); % ATTENTION
% rh=hqb(:,ib)*vkq(ib,:);
% resp(:,ib)=[rv(:);rh(:)];
ib
=
quadforresponse
(
iq
);
% use only selected quadrupoles
rva
=
dYX_ds
(:,:,
ib
);
% ANALYTIC
rha
=
dXY_ds
(:,:,
ib
);
respa
(:,
i
b
)
=
[
rva
(:);
rha
(:)]
.
/
LQ
(
i
b
);
%FACTOR LQ length of quadrupoles to make the 2 response identical.
dispfunc
(
i
b
,
nq
);
respa
(:,
i
q
)
=
[
rva
(:);
rha
(:)]
.
/
LQ
(
i
q
);
%FACTOR LQ length of quadrupoles to make the 2 response identical.
dispfunc
(
i
q
,
nq
);
end
% % to test several times, run in command line >> global semres; semres=rmfield(semres,'quadresponse');
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment