递推最小二乘辨识 matlab实现
A. The selected model
The system model:
B. Identification algorithm used
1.Recursive least squares identification. 2.Recursive least square identification with forgetting factor: Take the forgetting factor
clear all
close all
clc
a=[1 -1.3 0.5]';b=[0.8 0.3]';d=3; %实际系统参数与纯迟延
na=length(a)-1;nb=length(b)-1; %%na,nb 为输出输入系数矩阵 A,B 的阶数
L=2000;%仿真长度
uk=zeros(d+nb,1);yk=zeros(na,1); %输入输出初始化
yk_m=zeros(na,1); %模型输出
u=randn(L,1); %输入信号,采用方差为1的白噪声序列
xi=sqrt(0.1)*randn(L,1); %干扰信号,采用方差为0.1的白噪声序列
thetae_1=zeros(na+nb+1,1); %参数初值
P=10^6*eye(na+nb+1