资源简介

方崇智《过程辨识》一书中各种辨识方法的总结及matlab仿真实现。同时还有模型阶次确定方法的仿真。

资源截图

代码片段和文件信息

clear all;%清理工作间变量
 L=1024;
 y1=1;y2=1;y3=1;y4=0;
 for i=1:1024
     x1=xor(y3y4);
     x2=y1;
     x3=y2;
     x4=y3;
     y(i)=y4;
     if y(i)==0u(i)=-1;%如果M序列的值为“0“时辨识的输入信号取“-1”
      else u(i)=1;%当M序列的值为“1“时辨识的输入信号取“1”
      end%小循环结束
      y1=x1;y2=x2;y3=x3;y4=x4;%为下一次的输入信号做准备
      end%大循环结束,产生输入信号u 
      
      A=179; x0=11; M=2^35;  KM=1024;a=0;
      N=12; miu=0;sigma=1;
      b=sqrt(N/12);
      for k=1:KM
          for j=1:N
         x2=A*x0;  
         x1=mod (x2M);   
         v(j)=x1/M;
         a=a+v(j);
         x0=x1;
          end
          eita(:k)=miu+[sigma*(a-N/2)]/b;
          a=0;
      end
      v=eita;%%白噪声
      
z=zeros(11024); %定义输出观测值的长度  
z(2)=0;z(1)=0;%取z的前两个初始值为零  
for k=3:1024 
z(k)=1.5*z(k-1)-0.7*z(k-2)+u(k-1)+0.5*u(k-2)+v(k); %用输出值作为观测值

kk=k-2;
zz(kk:)=z(k)‘;
end
zz

for k=4:1024 
z(k)=1.5*z(k-1)-0.7*z(k-2)+u(k-1)+0.5*u(k-2)+v(k); %用输出值作为观测值

kkk=k-3;
zzz(kkk:)=z(k)‘;
end
zzz;
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 构造数据矩阵
      for k1=3:L; 
          h1=[z(k1-1)u(k1-1)]‘;
          k=k1-2;
          H11(k:)=h1‘;% na=1nb=1
      end
     
      
      for k2=3:L; 
          h2=[z(k2-1)u(k2-1)u(k2-2)]‘ ;
          k=k2-2;
          H12(k:)=h2‘;% na=1nb=2
      end

      
      for k3=3:L; 
          h3=[z(k3-1)z(k3-2)u(k3-1)]‘ ;
          k=k3-2;
          H21(k:)=h3‘;% na=2nb=1
      end
   

      for k4=3:L; 
          h4=[z(k4-1)z(k4-2)u(k4-1)u(k4-2)]‘;
          k=k4-2;
          H22(k:)=h4‘;% na=2nb=2
      end
     
      
      for k5=4:L; 
          h5=[z(k5-1)z(k5-2)z(k5-3)u(k5-1)]‘;
          k=k5-3;
          H31(k:)=h5‘;% na=3nb=1
      end
   
      for k6=4:L; 
          h6=[z(k6-1)z(k6-2)z(k6-3)u(k6-1)u(k6-2)]‘;
          k=k6-3;
          H32(k:)=h6‘;% na=3nb=2
      end  
      
      for k7=4:L; 
          h7=[z(k7-1)z(k7-2)z(k7-3)u(k7-1)u(k7-2)u(k7-3)]‘;
          k=k7-3;
          H33(k:)=h7‘;% na=3nb=3
      end   
      
      for k8=4:L; 
          h8=[z(k8-1)u(k8-1)u(k8-2)u(k8-3)]‘;
          k=k8-3;
          H13(k:)=h8‘;% na=1nb=3
      end       
      
      for k9=4:L; 
          h9=[z(k9-1)z(k9-2)u(k9-1)u(k9-2)u(k9-3)]‘;
          k=k9-3;
          H23(k:)=h9‘;% na=2nb=3
      end      
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%计算AIC定阶准则
      c11=inv(H11‘*H11)*H11‘*zz;
      d11=1/L*(zz-H11*c11)‘*(zz-H11*c11);
      AIC(11)=L*log(d11)+2*(1+1);

      c12=inv(H12‘*H12)*H12‘*zz;
      d12=1/L*(zz-H12*c12)‘*(zz-H12*c12);
      AIC(12)=L*log(d12)+2*(1+2);
      
      c21=inv(H21‘*H21)*H21‘*zz;
      d21=1/L*(zz-H21*c21)‘*(zz-H21*c21);
      AIC(21)=L*log(d21)+2*(2+1);
      
      c22=inv(H22‘*H22)*H22‘*zz;
      d22=1/L*(zz-H22*c22)‘*(zz-H22*c22);
      AIC(22)=L*log(d22)+2*(2+2);
      
      c31=inv(H31‘*H31)*H31‘*zzz;
      d31=1/L*(zzz-H31*c31)‘*(zzz-H31*c31);
      AIC(31)=L*log(d31)+2*(3+1);
     

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       3880  2009-05-24 22:52  辨识\c(z)=1-1.5(z-1)+0.7(z-2)AIC定阶法\AIC_jieci.m

     文件       1451  2009-05-24 22:56  辨识\c(z)=1-1.5(z-1)+0.7(z-2)一次性完成\onetimeone.m

     文件       1962  2009-05-24 22:53  辨识\c(z)=1-1.5(z-1)+0.7(z-2)行列式定阶法\hanglieshi.m

     文件       2321  2009-05-24 21:21  辨识\c(z)=1-1.5(z-1)+0.7(z-2)递推完成\rwlsone.m

     文件       3060  2009-05-24 22:55  辨识\c(z)=1bayes法\bayes.m

     文件       3033  2009-05-24 22:55  辨识\c(z)=1一次性完成\onetimetwo.m

     文件       2934  2009-05-24 21:26  辨识\c(z)=1极大似然法\rmlone.m

     文件       2705  2009-05-24 21:20  辨识\c(z)=1递推完成\xinzengguang.m

     文件        904  2009-05-24 22:49  辨识\M序列和逆M序列\M_xulie.m

     文件      11528  2009-05-25 21:49  辨识\白噪声\noise.mat

     文件      11528  2009-05-25 21:34  辨识\白噪声\noise.mat.mat

     文件        603  2009-05-25 21:49  辨识\白噪声\white.m

     文件     520192  2010-11-15 18:33  辨识\系统辨识作业.doc

     文件        690  2009-05-24 23:01  辨识\辨识m文件说明.txt

     目录          0  2010-08-12 14:42  辨识\c(z)=1-1.5(z-1)+0.7(z-2)AIC定阶法

     目录          0  2010-08-12 14:42  辨识\c(z)=1-1.5(z-1)+0.7(z-2)一次性完成

     目录          0  2010-08-12 14:42  辨识\c(z)=1-1.5(z-1)+0.7(z-2)行列式定阶法

     目录          0  2010-08-12 14:42  辨识\c(z)=1-1.5(z-1)+0.7(z-2)递推完成

     目录          0  2010-08-12 14:42  辨识\c(z)=1bayes法

     目录          0  2010-08-12 14:42  辨识\c(z)=1一次性完成

     目录          0  2010-08-12 14:42  辨识\c(z)=1极大似然法

     目录          0  2010-08-12 14:42  辨识\c(z)=1递推完成

     目录          0  2010-08-12 14:42  辨识\M序列和逆M序列

     目录          0  2010-08-12 14:42  辨识\白噪声

     目录          0  2010-11-15 18:33  辨识

----------- ---------  ---------- -----  ----

               566791                    25


评论

共有 条评论