声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2822|回复: 14

共享有理分式法识别模态参数的程序

[复制链接]
发表于 2007-5-12 10:13 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
看论坛中有些同志在寻找模态参数识别的算法,我就把资源拿出来共享一下,共同学习,共同提高。声明一下,版权不是我的。
该算法实现了模态参数识别的有理多项式拟合算法,用有理多项式来拟合频响函数曲线,其中fitting函数是用来求有理分式分子分母多项式系数,result为求拟合后频响函数以及其极点、留数表示法。
fitting函数如下:
function [P,coeff]=fitting(rec,omega,phitheta,kmax)
% Scripts to compute the orthogonal polynomials required for the Rational
% Fraction Polynomial Method. (This code must be used with rfp.m)
%
% Syntax: [P,coeff]=fitting(rec,omega,phitheta,kmax)
%
% rec      = FRF measurement (receptance).
% omega    = frequency range vector (rad/sec).
% phitheta = weighting function (must be 1 for phi matrix or 2 for theta matrix).  
% kmax     = degree of the polynomial.
% P        = matrix of the orthogonal polynomials evaluated at the frequencies.
% coeff    = matrix used to transform between the orthogonal polynomial coefficients
%            and the standard polynomial.
%
%Reference: Mark H.Richardson & David L.Formenti "Parameter Estimation from
%           Frequency Response Measurements Using Rational Fraction Polynomials",
%           1篒MAC Conference, Orlando, FL. November, 1982.
%**********************************************************************
%Chile, March 2002, Cristian Andres Gutierrez Acu馻, crguti@icqmail.com
%**********************************************************************
if phitheta==1
q=ones(size(omega)); %weighting function for phi matrix
elseif phitheta==2
q=(abs(rec)).^2; %weighting function for theta matrix
else
error('phitheta must be 1 or 2.')
end
R_minus1=zeros(size(omega));
R_0=1/sqrt(2*sum(q)).*ones(size(omega));
R=[R_minus1,R_0]; %polynomials -1 and 0.
coeff=zeros(kmax+1,kmax+2);
coeff(1,2)=1/sqrt(2*sum(q));
%generating the orthogonal polynomials matrix and transform matrix
for k=1:kmax,
Vkm1=2*sum(omega.*R(:,k+1).*R(:,k).*q);
Sk=omega.*R(:,k+1)-Vkm1*R(:,k);
Dk=sqrt(2*sum((Sk.^2).*q));
R=[R,(Sk/Dk)];
coeff(:,k+2)=-Vkm1*coeff(:,k);
coeff(2:k+1,k+2)=coeff(2:k+1,k+2)+coeff(1:k,k+1);
    coeff(:,k+2)=coeff(:,k+2)/Dk;
end
R=R(:,2:kmax+2); %orthogonal polynomials matrix
coeff=coeff(:,2:kmax+2); %transform matrix
%make complex by multiplying by i^k
i=sqrt(-1);
for k=0:kmax,
   P(:,k+1)=R(:,k+1)*i^k; %complex orthogonal polynomials matrix
   jk(1,k+1)=i^k;
end
coeff=(jk'*jk).*coeff; %complex transform matrix
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

result函数如下:
function [alpha,Residuos,Polos]=result(rec,omega,N)

% Script to compute Modal Parameter Estimation from Frequency Response
% Measurements Using Rational Fraction Polynomials Method.
%
% Syntax: [alpha,Residuos,Polos]=result(rec,omega,N)
%
% rec   = FRF measurement (receptance)
% omega = frequency range vector (rad/sec).
% N     = degree of freedom.
% alpha = FRF regenerated (receptance).
%
%Reference: Mark H.Richardson & David L.Formenti "Parameter Estimation from
%           Frequency Response Measurements Using Rational Fraction Polynomials",
%           1篒MAC Conference, Orlando, FL. November, 1982.
%**********************************************************************
%Chile, March 2002, Cristian Andres Gutierrez Acu馻, crguti@icqmail.com
%**********************************************************************
[r,c]=size(omega);
if r<c
omega=omega.'; %omega is now a column
end
[r,c]=size(rec);
if r<c
rec=rec.'; %rec is now a column
end
nom_omega=max(omega);
omega=omega./nom_omega; %omega normalization
m=2*N-1; %number of polynomial terms in numerator
n=2*N; %number of polynomial terms in denominator
%orthogonal function that calculates the orthogonal polynomials
[phimatrix,coeff_A]=fitting(rec,omega,1,m);
[thetamatrix,coeff_B]=fitting(rec,omega,2,n);
[r,c]=size(phimatrix);
Phi=phimatrix(:,1:c); %phi matrix
[r,c]=size(thetamatrix);
Theta=thetamatrix(:,1:c); %theta matrix
T=sparse(diag(rec))*thetamatrix(:,1:c-1);
W=rec.*thetamatrix(:,c);
X=-2*real(Phi'*T);
G=2*real(Phi'*W);
d=-inv(eye(size(X))-X.'*X)*X.'*G;
C=G-X*d;  %{C} orthogonal polynomial coefficients
d2N=1;
D=[d;d2N]; %{D} orthogonal polynomial coefficients
%calculation of FRF (alpha) regenerated
for n=1:length(omega),
   numer=sum(C.'.*Phi(n,:));
   denom=sum(D.'.*Theta(n,:));
   alpha(n)=numer/denom;
end
A=coeff_A*C;
[r,c]=size(A);
A=A(r:-1:1).'; %{A} standard polynomial coefficients
B=coeff_B*D;
[r,c]=size(B);
B=B(r:-1:1).'; %{B} standard polynomial coefficients
%calculation of the poles and residues
[R,P,K]=residue(A,B);
[r,c]=size(R);
for n=1:(r/2),
   Residuos(n,1)=R(2*n-1);
   Polos(n,1)=P(2*n-1);
end
[r,c]=size(Residuos);
Residuos=Residuos(r:-1:1)*nom_omega; %residues
Polos=Polos(r:-1:1)*nom_omega; %poles
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

[ 本帖最后由 ddlluu 于 2007-5-12 10:16 编辑 ]

评分

1

查看全部评分

回复
分享到:

使用道具 举报

 楼主| 发表于 2007-5-12 10:37 | 显示全部楼层

给出一个示例数据

FRF_NOISE.txt 为混有噪声的频响函数,为拟合效果图
检验程序:
plot(w./(2*pi),20*real(log10(FRF_noise)),'b'), hold on,
omega=w(50:450,1);
rec=FRF_noise(50:450,1);
N=3; [alpha,Residuos,Polos]=rfp(rec,omega,N);
plot(omega./(2*pi),20*real(log10(alpha)),'r'), hold off,
未命名.jpg

FRF_NOISE.txt

13.53 KB, 下载次数: 51

回复 支持 1 反对 0

使用道具 举报

发表于 2008-6-4 20:33 | 显示全部楼层
你这个程序,有噪音的话误差很大吧?
发表于 2008-7-31 20:46 | 显示全部楼层
找了好久,十分感谢.正在研究中.有不懂的地方还要向各位请教.
发表于 2008-8-1 15:49 | 显示全部楼层
程序的算法哪里有介绍比较详细的?看了很多,都叫粗糙.另外运行了程序,总是出错.ddlluu能否给出更详细的程序执行过程呢?我matlab也是学习的不深入,谢谢了.
发表于 2008-8-1 18:25 | 显示全部楼层
我现在很需要这样的程序,但是我看不懂,希望楼主对程序多加一些注释
发表于 2009-4-13 11:15 | 显示全部楼层
Fraction Polynomial Method. (This code must be used with rfp.m)


rpf.m 文件呢???楼主
发表于 2009-4-13 15:08 | 显示全部楼层
哪位高手能讲解一下,上面的这段程序??不怎么会用啊
发表于 2009-4-15 10:18 | 显示全部楼层
全部程序和理论背景可从如下网址下载:
http://www.mathworks.com/matlabcentral/fileexchange/3805
发表于 2009-4-18 13:41 | 显示全部楼层

回复 9楼 handful 的帖子

十分感激,不需要注册吧?
发表于 2009-4-18 15:15 | 显示全部楼层
谢谢楼主,但是从结果看,并不是很理想啊......
发表于 2009-4-18 15:28 | 显示全部楼层
close all;clear all;clc;
load FRF_noise.mat
plot(FRF_noise(:,1),20*log10(abs(FRF_noise(:,2))),'b'), hold on,
xlabel('Frequency (rad/sec)'),ylabel('Magnitude (dB)'),
omega=FRF_noise(50:450,1);
rec=FRF_noise(50:450,2);
N=3;
[alpha,par]=rfp(rec,omega,N);
fn=par(:,1) %natural frequencies
xi=par(:,2) %damping ratios
C=[par(:,3),par(:,4)] %modal constant (magnitud,phase)
plot(omega,20*log10(abs(alpha)),'r'), hold off,

其中rec 和omega 是什么意思? N值说是自由度,等于模态阶数不?
发表于 2015-4-6 15:55 | 显示全部楼层
大神,有了频响函数的数据,能否模态参数(模态刚度,质量,阻尼比)具体怎么实现,急求
发表于 2015-4-8 20:49 | 显示全部楼层
高手,真心不会,学习
发表于 2015-4-8 20:53 | 显示全部楼层
ddlluu 发表于 2007-5-12 10:37
FRF_NOISE.txt 为混有噪声的频响函数,未命名.jpg 为拟合效果图
检验程序:
plot(w./(2*pi),20*real(log1 ...

权限不够,看不到
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-11-5 16:13 , Processed in 0.101573 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表