|
楼主可以参考下面这个主题的回复:
关于频响函数估计H1,H2,H3,H4的问题
在这个帖子的回复中,我粘贴的matlab程序可供参考。改造一下这个matlab程序,就可以自己进行计算了。再次粘贴下:
--------------------------------------------------------------------------------------
美国辛辛那提大学结构动力学实验室的R.J.Allemang教授提供的计算频响函数(H1,H2,Hv估算子)的matlab源码
,感兴趣的,可以复制到matlab程序,保存后,调试、运行,体会一下。
% v3_frf.m
%
% This is a script file to compute H1, H2 and Hv
% for a known sdof system given the mass, damping and
% stiffness terms in dimensionless units. The output
% includes frequency domain plots of the frequency
% response functions.
%
%**********************************************************************
% Author: Randall J. Allemang
% Date: 18-Apr-94
% Structural Dynamics Research Lab
% University of Cincinnati
% Cincinnati, Ohio 45221-0072
% TEL: 513-556-2725
% FAX: 513-556-3390
% E-MAIL: randy.allemang@uc.edu
%*********************************************************************
%
clg, clear
plt=input('Store plots to file (Yes=1): (0)');if isempty(plt),plt=0;end;
mass=input('Mass value: (10)');if isempty(mass), mass=10;end;
stiff=input('Stiffness value: (16000)');if isempty(stiff),stiff=16000;end;
damp=input('Damping value: (1)'); if isempty(damp),damp=1;end;
omega=linspace(0,100,500);
Hmethod=menu('FRF Computation','H (Theory)','H1 Algorithm', ...
'H2 Algorithm','Hv Algorithm','Hv Algorithm','Exit')
%
s=j*omega;
H=1.0./(mass.*s.*s+damp.*s+stiff);
%
GXX=zeros(1,500);
GFF=zeros(1,500);
GXF=zeros(1,500);
GFX=zeros(1,500);
% 求平均功率谱
for Navg=1:25
F=rand(1,500)+j.*rand(1,500);
X=H.*F;
GFF=GFF+F.*conj(F);
GXX=GXX+X.*conj(X);
GXF=GXF+X.*conj(F);
GFX=GFX+F.*conj(X);
end;
%
if(Hmethod==1)
fig1=figure(1);
semilogy(omega,abs(H))
xlabel('Frequency (Hz)'),ylabel('Log Magnitude'),grid
title('Theoretical FRF')
pause
fig2=figure(2);
plot(omega,360./(2.*pi).*angle(H))
xlabel('Frequency (Hz)'),ylabel('Phase (Deg)'),grid
title('Theoretical FRF')
pause
end
%
if(Hmethod==2)
H1=GXF./GFF;
fig3=figure(3);
semilogy(omega,abs(H1))
xlabel('Frequency (Hz)'),ylabel('Log Magnitude'),grid
title('H1 FRF Algorithm')
pause
fig4=figure(4);
plot(omega,360./(2.*pi).*angle(H1))
xlabel('Frequency (Hz)'),ylabel('Phase (Deg)'),grid
title('H1 FRF Algorithm')
pause
end
%
if(Hmethod==3)
H2=GXX./GFX;
fig5=figure(5);
semilogy(omega,abs(H2))
xlabel('Frequency (Hz)'),ylabel('Log Magnitude'),grid
title('H2 FRF Algorithm')
pause
fig6=figure(6);
plot(omega,360./(2.*pi).*angle(H2))
xlabel('Frequency (Hz)'),ylabel('Phase (Deg)'),grid
title('H2 FRF Algorithm')
pause
end
%Hv估计
if(Hmethod==4)
for ii=1:500;
G=[GXX(1,ii),GFX(1,ii);GXF(1,ii),GFF(1,ii)];
[x,d]=eig(G);
orig_lambda=diag(d);
[Y,I]=sort(real(orig_lambda));
lambda=orig_lambda(I);
psi=x(:,I);
Hv(1,ii)=-psi(2,1)/psi(1,1);
end;
fig7=figure(7);
semilogy(omega,abs(Hv))
xlabel('Frequency (Hz)'),ylabel('Log Magnitude'),grid
title('Hv FRF Algorithm')
pause
fig8=figure(8);
plot(omega,360./(2.*pi).*angle(Hv))
xlabel('Frequency (Hz)'),ylabel('Phase (Deg)'),grid
title('Hv FRF Algorithm')
pause
end
%Hv估计
if(Hmethod==5)
for ii=1:500;
G=[GFF(1,ii),GXF(1,ii);GFX(1,ii),GXX(1,ii)];
[x,d]=eig(G);
orig_lambda=diag(d);
[Y,I]=sort(real(orig_lambda));
lambda=orig_lambda(I);
psi=x(:,I);
Hv(1,ii)=-psi(1,1)/psi(2,1);
end;
fig9=figure(9);
semilogy(omega,abs(Hv))
xlabel('Frequency (Hz)'),ylabel('Log Magnitude'),grid
title('Hv FRF Algorithm')
pause
fig10=figure(10);
plot(omega,360./(2.*pi).*angle(Hv))
xlabel('Frequency (Hz)'),ylabel('Phase (Deg)'),grid
title('Hv FRF Algorithm')
pause
end
%
if(Hmethod==6)
break
end
if plt==1
print -deps -f1 v3_frfa.eps
print -deps -f2 v3_frfb.eps
print -deps -f3 v3_frfc.eps
print -deps -f4 v3_frfd.eps
print -deps -f5 v3_frfe.eps
print -deps -f6 v3_frff.eps
print -deps -f7 v3_frfg.eps
print -deps -f8 v3_frfh.eps
print -deps -f9 v3_frfi.eps
print -deps -f10 v3_frfj.eps
end
|
评分
-
3
查看全部评分
-
|