简谐激励下的响应图和bode
function harmomnically_excited_vobration(M,K,C,F0,W,T)%response of a damped system under harmonic force
%eqution: m*ddx+C*dx+K*x=F0*cos(w*t)
%we assume solutionXp(t)=X*cos(wt-q)
%from vectorial representation :
%we can obtain: X=F0/sqrt(((K-M*w^2)^2+C^2*w^2));
% q=atan(C*w/(K-M*w^2));
%where X and Q are constands to be determined
%plot response
clc
clear all;
M=10;K=4000;w=10;F0=100;C=20;
if nargin<6 T=0:0.01:20;end
T=0:0.001:1.6;
A=F0/sqrt((K-M*w^2)^2+(C*w)^2);
q=atan(C*w/(K-M*w^2));
X=A.*cos(w.*T-ones(size(T))*q);
figure(1)
plot(T,X,'r');grid on; title('response of a damped system under harmonic force');
xlabel('time');ylabel('displacement')
%plot bode piture
%wn=sqrt(K/M);
%e=C/(2*sqrt(K/M)); as damped radio
%r=w/wn frequency radio
% dst=F0/Kmeans that deflection under the static force F0
%Ax=X/dst=1/(sqrt((1-r^2)^2+(2*e*r)^2)); means that amplitude radio
%q=atan(2*e*r/(1-r^2));
wn=sqrt(K/M);w=; %discusion the frequency
if length(w)~=1;
e=[ 0.2,0.5 0.8,1,5];%discussion only five situation
for n=1:1:length(e)
r=w/wn;
a=(ones(size(r))-r.^2).^2;
b=(2*e(n).*r).^2 ;
Ax=ones(size(a))./sqrt(a+b);
a=ones(size(r))-r.^2;
q=atan(2*e(n)*r./a);
q1=q*180./pi;
figure(2)
plot(r,Ax,'r');grid on;hold on;xlabel('frequency radio');ylabel('amplitude radio');
%figure(3)
%plot(r,q1,'r');grid on;hold on;xlabel('frequency radio');ylabel('phase angle');
end
end
%now we know the max value is Ax=1/(2*e*sqrt(1-e^2)) (3)
% when w=wn.we get Ax=1/2*eso if the maximum amplifude is know ,the
% damping radio canbe found by equation(3)
%diff(Ax,t)=0 when r=0
原创 or 转贴 !? 个人专业有限, 看似像分享!? 是吗?
若是, 若能稍作简易说明下相关输入/输出/算法, 甚至举例, 或许更适合学习! 个人浅见
页:
[1]