如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
离散系统的递推辨识(完整版)实用资料(可以直接使用,可编辑完整版实用资料,欢迎下载)11-7-16上午5:13E:\STUDY\ModelPredictiveControl\RealTimeIdentification\ControlFile.m1of1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%根据薛定宇,陈阳泉《控制数学问题的Matlab求解》例题编写%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%clearall;closeall;clc;ts=0.005;%samplingtimenum=1;%theorderoftheidentifiedsystemden=2;alpha=1000;%theweightingcoefficientlam=0.8;%theforgettingfactornum1=[-10.3];%transferfunctionofProcess1den1=[11.50.9];num2=[-1.72-0.2];%transferfunctionofProcess2den2=[1-0.50.3];sim('IdentificationBlock',10);plot(tout,yout);ylim([-22]);legend('dena_1','dena_2','numb_0','numb_1');11-7-16上午5:08E:\STUDY\ModelPredictiveControl\Real...\S_FunctionOfRealtimeIdentifacation.m1of1function[sys,x0,str,ts]=S_FunctionOfRealtimeIdentifacation(t,x,u,flag,num,den,alpha,lam)switchflagcase0[sys,x0,str,ts]=Initialization(num,den,alpha);case2sys=StateUpdate(x,u,num,den,lam);case3sys=x(1:num+den+1);case{1,4,9}sys=[];otherwiseerror(['UnhandledFlag=',num2str(flag)]);endfunction[sys,x0,str,ts]=Initialization(num,den,alpha)sizes=simsizes;sizes.NumContStates=0;sizes.NumDiscStates=(num+den+1)*(num+den+2);sizes.NumOutputs=num+den+1;sizes.NumInputs=22;sizes.DirFeedthrough=0;sizes.NumSampleTimes=1;sys=simsizes(sizes);P0=alpha^2*eye(num+den+1);x0=[zeros(num+den+1,1);P0(:)];str=[];ts=[-10];functionsys=StateUpdate(x,u,num,den,lam)Psi=[-u(13:12+den);u(1:num+1)];theta=x(1:num+den+1);P=reshape(x(num+den+2:end),num+den+1,num+den+1);K=P*Psi/(lam+Psi'*P*Psi);theta_new=theta+K*(u(12)-Psi'*theta);P_new=(P-K*Psi'*P)/lam;sys=[theta_new;P_new(:)];IdentificationBlockfile:///C:/Users/Vince426/AppData/Local/Temp/IdentificationBlock.html1of72021/7/165:05IdentificationBlockfile:///C:/Users/Vince426/AppData/Local/Temp/IdentificationBlock.html2of72021/7/165:05IdentificationBlockfile:///C:/Users/Vince426/AppData/Local/Temp/IdentificationBlock.html3of72021/7/165:05Ident