matlab codes vibration

4
1.Amplitude and phase angle of sdof system (forced harmonic): Mat lab code: m=1; zeta=0.1:0.1:1; k=1; wn=sqrt(k/m); w=logspace(-1,1,400); rad2deg=180/pi; s=j*w; for cnt=1:length(zeta) xfer(cnt,:)=(1/m)./(s.^2+2*zeta(cnt)*wn*s+wn^2); mag(cnt,:)=abs(xfer(cnt,:)); phs(cnt,:)=angle(xfer(cnt,:))*rad2deg; end for cnt=1:length(zeta) figure(1) loglog(w,mag(cnt,:),'k-') title('SDOF frequency response magnitudes for zeta=0.2to1.0in steps of0.2') xlabel('Frequency(rad/sec)') ylabel('Magnitude') grid hold on end hold off for cnt=1:length(zeta) figure(2) semilogx(w,phs(cnt,:),'k-') title('SDOF frequency response phases for zeta=0.2to1.0 in steps of0.2') xlabel('Frequency(rad/sec)') ylabel('Phase') grid hold on end hold off

Upload: akinojohnkennedy

Post on 23-Dec-2015

3 views

Category:

Documents


0 download

DESCRIPTION

vibration

TRANSCRIPT

Page 1: Matlab Codes vibration

1.Amplitude and phase angle of sdof system (forced harmonic):

Mat lab code:

m=1; zeta=0.1:0.1:1;k=1; wn=sqrt(k/m);w=logspace(-1,1,400);rad2deg=180/pi;s=j*w; for cnt=1:length(zeta) xfer(cnt,:)=(1/m)./(s.^2+2*zeta(cnt)*wn*s+wn^2);mag(cnt,:)=abs(xfer(cnt,:)); phs(cnt,:)=angle(xfer(cnt,:))*rad2deg;endfor cnt=1:length(zeta)figure(1) loglog(w,mag(cnt,:),'k-') title('SDOF frequency response magnitudes for zeta=0.2to1.0in steps of0.2')xlabel('Frequency(rad/sec)')ylabel('Magnitude')gridhold onendhold offfor cnt=1:length(zeta)figure(2) semilogx(w,phs(cnt,:),'k-') title('SDOF frequency response phases for zeta=0.2to1.0 in steps of0.2')xlabel('Frequency(rad/sec)')ylabel('Phase')gridhold onendhold off

Page 2: Matlab Codes vibration

10-1

100

101

10-3

10-2

10-1

100

101

SDOF frequency response magnitudes for zeta=0.2to1.0in steps of0.2

Frequency(rad/sec)

Mag

nitu

de

10-1

100

101

-180

-160

-140

-120

-100

-80

-60

-40

-20

0SDOF frequency response phases for zeta=0.2to1.0 in steps of0.2

Frequency(rad/sec)

Pha

se

Page 3: Matlab Codes vibration

Magnitude Plots: base excitation: Displacement transmissibility

Mat lab code:

>> syms z wn w f0A=[wn^2-w^2 2*z*wn*w;-2*z*wn*w wn^2-w^2];x=[f0; 0];An=inv(A)*x An = -(f0*(w^2 - wn^2))/(w^4 + 4*w^2*wn^2*z^2 - 2*w^2*wn^2 + wn^4) (2*f0*w*wn*z)/(w^4 + 4*w^2*wn^2*z^2 - 2*w^2*wn^2 + wn^4) >> pretty(An) +- -+ | 2 2 | | f0 (w - wn ) | | - --------------------------------- | | 4 2 2 2 2 2 4 | | w + 4 w wn z - 2 w wn + wn | | | | 2 f0 w wn z | | --------------------------------- | | 4 2 2 2 2 2 4 | | w + 4 w wn z - 2 w wn + wn | +- -+

r=linspace(0,3,500);ze=[0.01;0.05;0.1;0.20;0.50];X=sqrt( ((2*ze*r).^2+1) ./ ( (ones(size(ze))*(1-r.*r).^2) + (2*ze*r).^2) );figure(1)plot(r,20*log10(X))

Page 4: Matlab Codes vibration

0 0.5 1 1.5 2 2.5 3-20

-10

0

10

20

30

40

Frequency ratio r

X/Y

(dB

)