文档介绍:升磁过程降磁过程输入电压传感器输出输入电压传感器输出 0 30 1 29 2 28 3 27 4 26 5 25 6 24 7 23 8 22 9 21 10 20 11 19 12 18 13 17 14 16 15 15 16 14 17 13 18 12 19 11 20 10 21 9 22 8 23 7 24 6 25 5 26 4 27 3 28 2 29 1 30 0 电磁铁加电压和去电压时的曲线及模型: load load u1=rise(:,1); f1=rise(:,2); u2=down(:,1); f2=down(:,2); 使用曲线拟合的方法辨识电磁铁模型: a=polyfit(u1,f1,4) f11=polyval(a,u1); a= - - - b=polyfit(u2,f2,4) f21=polyval(b,u2); b= - - - 曲线比较: 拟合后的电磁铁模型曲线: 使用系统辨识的方法的到的模型: 升磁曲线: na=2;nb=2;nc=1;nk=0; m1=armax(z1,[na,nb,nc,nk]) Discrete-time IDPOLY model: A(q)y(t) = B(q)u(t) + C(q)e(t) A(q) =1- (+-) q^-1 + (+-) q^-2 B(q) = - (+-) + (+-) q^-1 C(q) =1- (+-) q^-1 Estimated using ARMAX from data set z1 Loss function and FPE Sampling interval: 1 去磁曲线: Discrete-time IDPOLY model: A(q)y(t) = B(q)u(t) + C(q)e(t) A(q) =1- (+-) q^-1 + (+-) q^-2 B(q) = - (+-) + (+-) q^-1 C(q) =1- (+-) q^-1 Estimated using ARMAX from data set z2 Loss function and FPE Sampling interval: 1M atlab 程序: close all clear all clc load load u1=rise(:,1); f1=rise(:,2); u2=down(:,1); f2=down(:,2); figure(1); set(figure(1),'name',' 采集得到的数据'); plot(u1,f1,'g',u2,f2,'r') hold on a=polyfit(u1,f1,4) f11=polyval(a,u1); plot(u1,f11,'b') b=polyfit(u2,f2,4) f21=polyval(b,u2); plot(u2,f21,'k') figure(2) set(figure(2),'name',' 拟合得到的曲线'); plot(u1,f11,'b') hold on plot(u2,f21,'r') z1=[f1,u1]; z2=[f2,u2]; m=2; switch m case 1 m1=n4sid(z1,