马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
下面是一个求多自由度有阻尼转子固有频率的程序,运行后总有这样的错误??? Strings passed to EVAL cannot contain function declarations.不知道是怎么回事啊,麻烦大家帮忙看看!谢谢了!
m=[1,2,0,0;0,0,1,2;12,13,0,0;0,0,12,13]
d=[2,3,0,0;0,0,3,4;12,13,15,16;15,16,17,18]
k=[13,14,0,0;0,0,15,16;21,25,0,0,;0,0,31,40]
function [v,w,zeta]=vbr_sf(m,d,k)
%vbr sf vbr sf(m,d,k)
% [v,w,zeta]=vbr4(m,d,k)
% funtion vbr sf finds the mode shapes and natural frequencies of
% a linear second order matric equation.
% [v,w]=vbr sf(m,f) finds the mode shapes amd natural frequencies
% for the undamped case.
if nargin==2
k=d;
[v,w]=eig(m\k);
w=sqrt(w);
end
if nargin==3
if norm(d/m*k-k/m*d<1e-8*norm(k/m*d))
disp('Damping is proportional,eigenvectors are real.')
[v,w]=eig(m\k);
w=sqrt(w);
zeta=(v'*m*v)\(v'*d*v)/2/w;
else
disp('Damping is non-proportional,eigenvectors are complex.')
a=[0*k eye(length(k));-m\k -m\d];
[v,w1]=eig(a);
w=abs(w1);
zeta=-real(w1)/w;
end
end
w=diag(w)
zeta=diag(zeta) |