本帖最后由 menmen 于 2011-5-16 22:39 编辑
下面是仿真数据构造程序,有什么地方错了吗?为什么用构造的位移响应数据,进行频响函数估计,估计公式为H(w)=Gxf(w)/Gff(w),结果会像上面那样,虚部方向了呢?请高人指点。。。
%系统参数
M1 = 3; M2 = 1; M3 = 2;
K1 = 600; K2 = 600; K3 = 800; K4 = 1000; K5 = 200; K6 = 800;
C1 = 5; C2 = 3; C3 = 4; C4 = 1; C5 = 2; C6 = 1;
%系统矩阵
zeroMatric = zeros(3,3);
Mmatric = [M1 0 0;0 M2 0;0 0 M3];
Kmatric = [K1+K2+K5 -K2 -K5;-K2 K2+K3+K6 -K3;-K5 -K3 K3+K4+K5];
Cmatric = [C1+C2+C5 -C2 -C5;-C2 C2+C3+C6 -C3;-C5 -C3 C3+C4+C5];
%状态空间模型:参数矩阵
A = [zeroMatric eye(3,3);-Mmatric\Kmatric -Mmatric\Cmatric];
B = [zeroMatric;inv(Mmatric)];
C = [eye(6,6)];
D = [zeros(6,3)];
v0 = [0;0;0;0;0;0];%初始状态
%%%%%%%%%%%%系统输入力%%%%%%%%%%%%%%%%%%%
fs = 2000;%Hz
T = 101;%s %数据时长
t = 0:1/fs:T-1/fs;%s %采用时间
x1Input = [randn(size(t))]';%输入力
x2Input = [randn(size(t))]';
x3Input = [randn(size(t))]';
zeroInput = [zeros(size(t))]';%输入力为零
F = [x1Input ,zeroInput,x3Input];%输入力矩阵
[y,v] = lsim(A,B,C,D,F,t); |