马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
clear;
f=linspace(0,8000,100); w=2.*pi.*f; c0=340; p=2700; h=0.0025;
theta=linspace(0,pi/2,100); k0=w./c0;
kx=k0.*sin(theta); ky=k0.*cos(theta);
% define the compliance matrix s
S=[0.01 -0.0046 -0.0046 0 0 0;-0.0046 0.01 -0.0046 0 0 0; -0.0046 -0.0046 0.01 0 0 0;0 0 0 26.7 0 0;0 0 0 0 26.7 0;0 0 0 0 0 26.7];
% define the stiffness matrix C
C=inv(S);
D1=[1 0 0 0 0 0;0 0 0 0 0 1;0 0 0 0 1 0];
D2=[0 0 0 0 0 1;0 1 0 0 0 0;0 0 0 1 0 0];
D3=[0 0 0 0 1 0;0 0 0 1 0 0;0 0 1 0 0 0];
%Define the zero matrix and
A11=zeros(3); A12=eye(3); A=zeros(6,6,100);
%Define the I matrix
I0=zeros(3); I1=eye(3);
G=[0 0 0 1 0 0;0 0 0 0 1 0;0 0 1 0 0 0;0 1 0 0 0 0;1 0 0 0 0 0;0 0 0 0 0 1];
%calulate matrix A
B2=D3*C*(D3'); IVB2=inv(B2);
%Define the I matrix,the subscript in identical to the papers.
I11=[I1 I0;I0 I0]; I21=[I0 I0;I1 I0]; I12=[I0 I1;I0 I0]; I22=[I0 I0;I0 I1];
Itol=[I11 I21;I12 I22]; IVI=inv(Itol);
for j = 1:length(w)
B1(:,:,j)= (i*kx(j)*D1*C*D3')+(i*kx(j)*D3*C*D1')+(i*ky(j)*D2*C*D3')+(i*ky(j)*D3*C*D2');
B0(:,:,j)=(i*kx(j)*i*kx(j)*D1*C*D1')+(i*ky(j)*i*ky(j)*D2*C*D2')+(i*kx(j)*i*ky(j)*D1*C*D2')+(i*ky(j)*i*kx(j)*D2*C*D1');
A21(:,:,j)=-p*w(j)*w(j)*IVB2-IVB2*B0(:,:,j);
A22(:,:,j)=-IVB2*B0(:,:,j);
A(:,:,j)=[A11 A12;A21(:,:,j) A22(:,:,j)];
H(:,:,j)=[i*kx(j)*C*D1'+i*ky(j)*C*D2',C*D3'];
J(:,:,j)=expm(A(:,:,j));
K(:,:,j)=inv(G)*H(:,:,j)*J(:,:,j);
L(:,:,j)=inv(G*I21- H(:,:,j)*I21)
end
请问下高手,我这个程序在计算L矩阵的时候,没办法运行了,在计算复矩阵 G*I21- H(:,:,j)*I21出错,是什么原因,该如何解决
在我计算机上Matlab的错误代码
??? Function 'inv' is not defined for values of class 'double' and attributes 'full 3d complex'.
[ 本帖最后由 ChaChing 于 2010-3-30 21:30 编辑 ] |