请教有关逆迭代法的程序
<P>K=0.25*;<BR>M=./16;<BR>q=2;<BR><BR>function =nidiedaifa(K,M,q)</P><P>alafa=zeros(q-1,1);<BR>freque=zeros(q,1);<BR>eigvec=zeros(q,q);</P>
<P>XN0H=zeros(q,1);</P>
<P>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% initial vector , important!<BR>XN0=ones(q,1);<BR>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<BR><BR><BR>for i=1:1:q<BR>if i==1<BR>XN1=XN0;<BR>else<BR>j=i-1;<BR>alafa(j)=eigvec(:,j)'*M*XN0;<BR>XN0H=XN0;<BR>for m=1:1:j<BR>XN0H=XN0H-alafa(m)*eigvec(:,m); %%%%%%%%%%%%%%%%%%%%%%%%%Gram-Schmidt 正交化<BR> end<BR>XN1=XN0H;<BR>end<BR><BR>XNH=inv(K)*M*XN1;<BR>XN=XNH./(sqrt(XNH'*M*XNH));<BR>LAM0=(XNH'*K*XNH)./(XNH'*M*XNH);</P>
<P>rate=0.1;</P>
<P>while (rate>1.0e-6)<BR> XN1=XN;<BR> XNH=inv(K)*M*XN1;<BR> XN=XNH./(sqrt(XNH'*M*XNH));<BR> LAM=(XNH'*K*XNH)./(XNH'*M*XNH);<BR> rate=abs((LAM-LAM0)/LAM);<BR> LAM0=LAM;<BR>end<BR>freque(i)=LAM;<BR>eigvec(:,i)=XN;<BR>end<BR><BR><BR>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<BR>上面的逆迭代法求特征值的程序,为什么总收敛于一个最小的特征值,我已经进行了Schmidt正交化了啊.如果我把初始迭代向量XN0=ones(q,1);改成XN0=zeros(q,1);XN0(q-1,1)=1;,又可以收敛到不同的特征值了.这到底是什么原因?哪位高人能告诉我初始迭代向量的选取方法吗?使结果收敛于不同的特征值和特征向量.</P>
页:
[1]