You are on page 1of 4

TITLE: - Simulation (using suitable Matlab) of total response of SDOF damped system to

harmonic excitation by solving differential equation numerically.

MATLAB program for finding response due to harmonic force


clc
close all
%****************************************************
m=6;
k=8;
wn=sqrt(k/m);
c1=2;
u(1)=.25;
udot(1)=.5;
% give magnitude of harmonic force

%give excited frequency of the force


for i=1:1
f=input('harmonic force =');
w=input('excited frequency of the force =');
end
%****************************************************
beta=w/wn;
cc=2*sqrt(k*m);
rho=c1/cc;
wd=wn*sqrt(1-rho^2);
wba=rho*wn;
rhoba=rho/sqrt(1-rho^2);
b0=2.0*rho*wn;
b1=wd^2-wn^2;
b2=2.0*wba*wd;
dt=0.02;
t(1)=0;
for i=2:1500
t(i)=(i-1)*dt;
s=exp(-rho*wn*t(i))*sin(wd*t(i));
c=exp(-rho*wn*t(i))*cos(wd*t(i));
sdot=-wba*s+wd*c;
cdot=-wba*c-wd*s;
sddot=-b1*s-b2*c;
cddot=-b1*c+b2*s;
a1=c+rhoba*s;
a2=s/wd;
d=-2.0*f*(rho*beta)/(k*(1-beta^2)^2+(2*rho*beta)^2);
e=f*(1-beta^2)/(k*(1-beta^2)^2+(2*rho*beta)^2);
u(i)=a1*u(1)+a2*udot(1)-d*(c+wba*s/wd)-e*w*s/wd;
v(i)=d*(cos(w*t(i)))+e*sin(w*t(i));
x(i)=u(i)+v(i);
end

figure(1)
plot(t,x)
xlabel('time');
ylabel('displacement');
title('time - displacement')
OUTPUT

Condition 1

mass=6
stiffness=8
harmonic force =4
excited frequency of the force =1
Condition 2

mass=6
stiffness=8
harmonic force =9
excited frequency of the force =5
Condition 3

mass=6
stiffness=8
harmonic force =12
excited frequency of the force =9

You might also like