-
Notifications
You must be signed in to change notification settings - Fork 6
/
modal_shapes.m
31 lines (26 loc) · 916 Bytes
/
modal_shapes.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function Vloc = modal_shapes(modes,geom)
Nmodes = size(modes.A,1);
%find least squared solution for each mode shape
Vloc = zeros(size(geom.r,1),Nmodes);
for j = 1:Nmodes
Aj = permute(modes.A(j,:,:),[3 2 1]);
%find driving point hammer test with the largest response
max_curr = -Inf;
kMax = 1;
for k = 1:length(geom.iAcc)
if any(geom.bModeAcc(:,j))
iDrivePt = find(geom.bDrivePt(:,k) & geom.bModeAcc(k,j));
else
iDrivePt = find(geom.bDrivePt(:,k));
end
if ~isempty(iDrivePt) && abs(Aj(k,iDrivePt)) > max_curr
kMax = k;
iMax = iDrivePt;
max_curr = Aj(k,iDrivePt);
end
end
fprintf('Using acc %d for mode %d\n',kMax,j)
Phi = Aj ./ sqrt(Aj(kMax,iMax));
Phi = abs(Phi) .*sign(real(Phi));
Vloc(:,j) = [Phi(kMax,geom.iFromHam) Phi(geom.iFromAcc,iMax).'];
end