马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
%matrix iteration method
%this method assumes that the frequencies are distrinv and well
%seprated that w1<w2<w3...
%base princile:according to the expansion theorem:
%X1=c1*u1+c2*u2+c3*u3...... =C*Uwhitch ui is eigenvector
%conbine with D*X=r*X
%we obtain: X(r+1)=D*Xr=[c1/w1^2*r,c2/w2^2r,c3/w3^2r....]*U
%since the natrual frequences are assumed to be w1<w2<w3...
%so we can neglect the second to end
%X(r+1)=(c1/w1^2*r )*u1
%so :w1^2=Xr/X(r+1); 终止条件Xr=X(r+1); X(r+1)就是对应的一阶阵型。because D*Xr=r*Xr
%为计算第R+1阶的特征向量和特征值,应用正交条件消去前R阶
%Ci=ui*M*X/ui*M*ui 当ui是第i个阵型的正则化后的阵型ui*M*ui=1;X是假设的阵型,Ci是第i个阵型对该假设阵型的贡献量
function [R,XX]=matrix_interation(K,M,number,accuracy)
if nargin<3;warndlg('wrong inpiut');end
if nargin<4; accuracy=0.001;end
D=K*M;
for n=1:1:number %number is the need solved digenvector
Xold=ones(size(D,2),1);erro=10^4;
while erro>=accuracy
Xnew=D*Xold;
r=Xnew(1);
Xnew=Xnew/Xnew(1);
erro=norm((Xnew-Xold),2);
Xold=Xnew;
end
Xs=Xold/sqrt(Xold.'*M*Xold);
D=D-r*Xs*Xs.'*M; %消去前面几项,更新D矩阵
%%%保存各个阵型和固有频率
R(n)=r;
XX(:,n)=Xs;
end
R=sqrt(1./R);
XX=XX;
end
%note:
%1)the actual number of interations necessary to find the value of w1 to
%within a desired degree of accuracy depends on how colsely the arbitrary
%trail vector X1 resembles the fundamental mode X1 and how well w1 and w2
%are separated
%2)has a district advandge:没有计算误差
%3)has a unsual case the trail X1 is exactly proportional to oneof Xi.
|