Mach742
Mechanical
- Jul 21, 2006
- 1
If I take the fft of the impulse response of
x(t)=(1/(m*wd))*exp(-zeta*wn*t)*sin(wd*t)
I should get
G(jw)=1/(m*(-w^2+wn^2+2*zeta*wn*w*i))]
in the frequency domain. I have not been able to accomplish this using the following code. Anyone have any ideas?
clear
k=25;
m=1;
c=1;
wn=sqrt(k/m);
zeta=c/(2*sqrt(k*m));
fstart=-2.3873; %Start frequency
fend=2.3873; %End frequncy
K=16; %Number of points
f=linspace(fstart,fend,K);
w=2*pi.*f;
delta_f=(fend-fstart)/K;
G=1./(m.*(-w.^2+2.*zeta.*wn.*w.*i+wn.^2));
mag=abs(G);
tstart=0;
tend=10;
N=16;
%%%%%%%%%%%%%%%%%%%%
%%%%%Calculations
wn=sqrt(k/m);
zeta=c./(2.*sqrt(k*m))
wd=wn.*sqrt(1-zeta.^2);
delta_t=(tend-tstart)/N;
t=linspace(tstart,tend,N);
%%%%%%%%%%%%%%%%%%%%
%%%%%%Impulse Response of a 1DOF system
x=exp(-zeta.*wn.*t).*sin(wd.*t)./(m.*wd);
plot(t,x)
FRF=fft(x,N).*delta_t;
magexp=abs(FRF);
figure(1)
semilogy(w,magexp)
hold on
semilogy(w,mag,'k')
legend('exp','theoretical')
figure(2)
irf=ifft(G)./delta_f;
plot(real(irf))
hold on
plot(x,'k')
x(t)=(1/(m*wd))*exp(-zeta*wn*t)*sin(wd*t)
I should get
G(jw)=1/(m*(-w^2+wn^2+2*zeta*wn*w*i))]
in the frequency domain. I have not been able to accomplish this using the following code. Anyone have any ideas?
clear
k=25;
m=1;
c=1;
wn=sqrt(k/m);
zeta=c/(2*sqrt(k*m));
fstart=-2.3873; %Start frequency
fend=2.3873; %End frequncy
K=16; %Number of points
f=linspace(fstart,fend,K);
w=2*pi.*f;
delta_f=(fend-fstart)/K;
G=1./(m.*(-w.^2+2.*zeta.*wn.*w.*i+wn.^2));
mag=abs(G);
tstart=0;
tend=10;
N=16;
%%%%%%%%%%%%%%%%%%%%
%%%%%Calculations
wn=sqrt(k/m);
zeta=c./(2.*sqrt(k*m))
wd=wn.*sqrt(1-zeta.^2);
delta_t=(tend-tstart)/N;
t=linspace(tstart,tend,N);
%%%%%%%%%%%%%%%%%%%%
%%%%%%Impulse Response of a 1DOF system
x=exp(-zeta.*wn.*t).*sin(wd.*t)./(m.*wd);
plot(t,x)
FRF=fft(x,N).*delta_t;
magexp=abs(FRF);
figure(1)
semilogy(w,magexp)
hold on
semilogy(w,mag,'k')
legend('exp','theoretical')
figure(2)
irf=ifft(G)./delta_f;
plot(real(irf))
hold on
plot(x,'k')