欢迎来到天天文库
浏览记录
ID:52720263
大小:191.00 KB
页数:8页
时间:2020-03-29
《系统辨识作业.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、系统辨识大作业1利用相关分析法辨识系统脉冲响应1.1Wiener-Hopf方程传递函数<频域)卷积公式<时域)维纳-何甫1.2白噪声如果一个零均值、平稳随机过程的谱密度为常数,称之为白噪声<由白色光联想而得)。其自相关函数:利用脉冲函数的筛分性质可以将求解脉冲响应的问题简化为计算互相关函数的问题。输入
2、白噪声信号的优点:<1)计算简便,不需解卷积方程。<2)白噪声的能量分布在很广的频率范围内,不影响生产过程的正常运行,不会像时域法、频域法那样,使被测对象过分偏离正常状态。b5E2RGbCAP存在问题:<1)白噪声在物理上不易实现。<2)欲得到精确的及需要无限长时间的观测数据及长时间的积分<理论上),这不仅难以做到,而且会产生信号零点漂移,记录仪器零点漂移等新问题。p1EanqFDPw解决途径:找到与白噪声信号的性质近似的,物理上可以实现的周期性的随机信号3、提高计算精度,应多输入几个周期的M序列信号:r常取2~4.又考虑到M序列是二电平伪随机信号:8/8假设系统的传递函数为:设k=120T1=8.3T2=1,用相关分析法对系统脉冲响应进行辨识利用公式进行计算。给系统加阶跃响应后,响应曲线如图,得出结论,N=63。1.3程序clear。r=3。%%%%%%%%%%%%%生成a=1,P=6的M序列%%%%%%%%%%%%%%%%%M=[1111110]。Np=2^6-1。fork=1:252ifM(7>==0u(k>=1。end。ifM(7>==1u(k>=-1。end。f4、ori=7:-1:2M(i>=M(i-1>。endM(1>=M(6>+M(7>。ifM(1>==2M(1>=0。end。end8/8z=y。%%%%%%%%%%%理论输出数据%%%%%%%%%%%%%%%%%%%%%%k=120。T1=8.3。T2=1。T0=1。K=k/(T1*T2>。E1=exp(-T0/T1>。E2=exp(-T0/T2>。x(1>=0。y(1>=0。fork=2:252x(k>=E1*x(k-1>+T1*K*(1-E1>*u(k-1>+T1*K*(T1*(E1-1>+T0>*(u(k>-u(k5、-1>>/T0。DXDiTa9E3dy(k>=E2*y(k-1>+T2*(1-E2>*x(k-1>+T2*(T2*(E2-1>+T0>*(x(k>-x(k-1>>/T0。RTCrpUDGiTend%%%%%%%%%%%%%%%计算互相关函数%%%%%%%%%%%%%%%%%%fork=1:NpR(k>=0。fori=(Np+1>:(r+1>*NpR(k>=R(k>+u(i-k>*z(i>。endRmz(k>=R(k>/(r*Np>。end%%%%%%%%%%%%%%%脉冲响应估计值%%%%%%%%%%%%%%%%%%6、fork=1:Npg(k>=(Rmz(k>-Rmz(Np-1>>*Np/(Np+1>。end%%%%%%%%%%%%%%%%脉冲响应理论值%%%%%%%%%%%%%%%%%K=120。fork=1:Npg0(k>=K*(exp(-k/T1>-exp(-k/T2>>/(T1-T2>。end%%%%%%%%%%%%%%%脉冲响应估计误差%%%%%%%%%%%%%%%plot(1:Np,g,'r*'>holdonplot(1:Np,g0,'.'>legend('脉冲响应估计曲线','脉冲响应理论曲线'>仿真结果如下:8/87、2.最小二乘法辨识系统参数设系统如下:最小二乘法主要运用如下三个公式辨识系统参数:%%%%%%%%%%%%%生成a=1,P=6的M序列%%%%%%%%%%%%%%%%%M=[1111110]。Np=2^6-1。fork=1:63ifM(7>==0u(k>=1。end。ifM(7>==1u(k>=-1。end。fori=7:-1:2M(i>=M(i-1>。endM(1>=M(6>+M(7>。ifM(1>==2M(1>=0。end。End%%%%%%%%%%%%%RLS%%%%%%%%%%%%%%%%%8/8fork=38、:25。%循环变量从3到25y(k>=1.5*y(k-1>-0.7*y(k-2>+u(k-1>+0.5*u(k-2>。%输出采样信号5PCzVD7HxAendc0=[0.0010.0010.0010.0010.001]'。%直接给出被辨识参数的初始值jLBHrnAILgp0=10^6*eye(5,5>。%直接给出初始状态P0,即一个充分大的实数
3、提高计算精度,应多输入几个周期的M序列信号:r常取2~4.又考虑到M序列是二电平伪随机信号:8/8假设系统的传递函数为:设k=120T1=8.3T2=1,用相关分析法对系统脉冲响应进行辨识利用公式进行计算。给系统加阶跃响应后,响应曲线如图,得出结论,N=63。1.3程序clear。r=3。%%%%%%%%%%%%%生成a=1,P=6的M序列%%%%%%%%%%%%%%%%%M=[1111110]。Np=2^6-1。fork=1:252ifM(7>==0u(k>=1。end。ifM(7>==1u(k>=-1。end。f
4、ori=7:-1:2M(i>=M(i-1>。endM(1>=M(6>+M(7>。ifM(1>==2M(1>=0。end。end8/8z=y。%%%%%%%%%%%理论输出数据%%%%%%%%%%%%%%%%%%%%%%k=120。T1=8.3。T2=1。T0=1。K=k/(T1*T2>。E1=exp(-T0/T1>。E2=exp(-T0/T2>。x(1>=0。y(1>=0。fork=2:252x(k>=E1*x(k-1>+T1*K*(1-E1>*u(k-1>+T1*K*(T1*(E1-1>+T0>*(u(k>-u(k
5、-1>>/T0。DXDiTa9E3dy(k>=E2*y(k-1>+T2*(1-E2>*x(k-1>+T2*(T2*(E2-1>+T0>*(x(k>-x(k-1>>/T0。RTCrpUDGiTend%%%%%%%%%%%%%%%计算互相关函数%%%%%%%%%%%%%%%%%%fork=1:NpR(k>=0。fori=(Np+1>:(r+1>*NpR(k>=R(k>+u(i-k>*z(i>。endRmz(k>=R(k>/(r*Np>。end%%%%%%%%%%%%%%%脉冲响应估计值%%%%%%%%%%%%%%%%%%
6、fork=1:Npg(k>=(Rmz(k>-Rmz(Np-1>>*Np/(Np+1>。end%%%%%%%%%%%%%%%%脉冲响应理论值%%%%%%%%%%%%%%%%%K=120。fork=1:Npg0(k>=K*(exp(-k/T1>-exp(-k/T2>>/(T1-T2>。end%%%%%%%%%%%%%%%脉冲响应估计误差%%%%%%%%%%%%%%%plot(1:Np,g,'r*'>holdonplot(1:Np,g0,'.'>legend('脉冲响应估计曲线','脉冲响应理论曲线'>仿真结果如下:8/8
7、2.最小二乘法辨识系统参数设系统如下:最小二乘法主要运用如下三个公式辨识系统参数:%%%%%%%%%%%%%生成a=1,P=6的M序列%%%%%%%%%%%%%%%%%M=[1111110]。Np=2^6-1。fork=1:63ifM(7>==0u(k>=1。end。ifM(7>==1u(k>=-1。end。fori=7:-1:2M(i>=M(i-1>。endM(1>=M(6>+M(7>。ifM(1>==2M(1>=0。end。End%%%%%%%%%%%%%RLS%%%%%%%%%%%%%%%%%8/8fork=3
8、:25。%循环变量从3到25y(k>=1.5*y(k-1>-0.7*y(k-2>+u(k-1>+0.5*u(k-2>。%输出采样信号5PCzVD7HxAendc0=[0.0010.0010.0010.0010.001]'。%直接给出被辨识参数的初始值jLBHrnAILgp0=10^6*eye(5,5>。%直接给出初始状态P0,即一个充分大的实数
此文档下载收益归作者所有