function [sys,x0,str,ts] = sixy(t,x,u,flag)
K=[0.3225 0 0 -0.1452 0 0;0 419.3744 -19.4200 0 -210.4682 1.3162;0 -19.4200 1.9010 0 1.3162 -0.1534;-0.1452 0 0 0.2909 0 0;0 -210.4682 1.3162 0 419.1379 18.0934;0 1.3162 -0.1534 0 18.0934 2.1058];
M=[0.1554 0 0 0.0388 0 0;0 0.1554 0 0 0.0388 0;0 0 0.1554 0 0 0.0388;0.0388 0 0 0.1554 0 0;0 0.0388 0 0 0.1554 0;0 0 0.0388 0 0 0.1554];
C=[0.0065 0 0 -0.0029 0 0;0 8.3875 -0.3884 0 -4.2094 0.0263;0 -0.3884 0.0380 0 0.0263 -0.0031;-0.0029 0 0 0.0058 0 0;0 -4.2094 0.0263 0 8.3828 0.3619;0 0.0263 -0.0031 0 0.3619 0.0421];
G=eye(6);
A=cat(1,cat(2,zeros(6,6),eye(6)),cat(2,-inv(M)*K,-inv(M)*C));
B=cat(1,zeros(6,6),-inv(M)*G);
C=eye(12);D=zeros(12,6);
switch flag,
case 0,
sizes = simsizes;
sizes.NumContStates = 12;
sizes.NumDiscStates = 0;
sizes.NumOutputs = 12;
sizes.NumInputs = 6;
sizes.DirFeedthrough = 1;
sizes.NumSampleTimes = 1;
sys = simsizes(sizes);
x0=[0.5,0.5,0.5,0.5,0.5,0.5,0,0,0,0,0,0];
str=[];
ts=[0,0];
case 1,
sys=A*x+B*u;
case 3,
sys=C*x+D*u;
case {2,4,9},
sys = [];
end
我的输入是一个6行1列的矩阵,输出是12行1列的矩阵,输出后面接了个DEMUX,也设置为12个输出了,我的设置没问题啊,程序里面的矩阵相乘的行列数也是对应正确的啊,到底是什么问题? |