系统辨识 ARXmodel matlab仿真实验

The object model to be identified is:

在这里插入图片描述

Where v(k) is zero mean white noise. ARX modeling and correlation analysis were carried out for the above objects respectively, and impulse and step responses were obtained by comparing the two methods.The simulation curve is shown in figure 1.

The M program code is:

% Fourth order object ARX modeling and correlation analysis and comparison
clear;
clc;
clf;
A=[1 -0.4 0.5 0.2 0.1]; 
B=[0 1 0.6 0.3 0.2]; 
th0=poly2th(A,B) ; 
% th0 = Discrete-time ARX model:  A(z)y(t) = B(z)u(t) + e(t)
%  A(z) = 1 - 0.4 z^-1 + 0.5 z^-2 + 0.2 z^-3 + 0.1 z^-4               
%  B(z) = z^-1 + 0.6 z^-2 + 0.3 z^-3 + 0.2 z^-4  
u=idinput (500,'rbs'); 
% Generate a binary random signal
y=idsim ([u, randn(500,1)],th0); 
% Calculate the response of the system, th0 is the polynomial model established above, u is the input, randn is the noise.
z=[y u]; 
ir= cra(z); 
% Calculate the impulse response estimation of the system, where z = [y, u], that is to say, contains the output input information.
% At this point, the impulse response estimation has been completed, and the signal data is stored in the ir.
% The following is the impulse response directly obtained through simulation, which is used to verify the above results
th=arx (z,[4 4 1]) ; 
% This is an ARX model
% The following [4, 4, 1] represents the order of ar model
imp=[1;zeros(19,1)]; 
irth=idsim(imp,th); 
% Simulated Impulse responses
figure,plot(ir,'--') ;
hold on;
plot(irth,'r') 
legend('correlational analysis method','ARX modeling') 
title('Impulse responses') 
% Simulated Step responses
figure,plot(cumsum(ir),'--') ; 
hold on
plot(cumsum(irth),'y') 
legend('correlational analysis method','ARX modeling') 
title('Step responses')

ARX response curves obtained by modeling and correlation analysis:

请添加图片描述
请添加图片描述
请添加图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值