Response of Sdof System Subjected Impulse Loading: Matlab Coding
Response of Sdof System Subjected Impulse Loading: Matlab Coding
MATLAB CODING
clear all
clc
m=101.3211836;
k=1000;
Po=30;
t1=3; t2=10;
w=sqrt(k/m);
Pt=0:0.01:Po;
time1=0:.01:t1;
time2=t1:.01:t2;
for i=1:length(Pt)
xt(i)=t1;
end;
for j=1:length(time1)
Pt2(j)=Po;
xt1(j)=Po/k*(1-cos(w*time1(j)));
end;
for l=1:length(time2)
xt2(l)=(Po/k*(1-cos(w*t1))*cos(w*(time2(l)-
t1)))+((Po/k)*sin(w*t1)*sin(w*(time2(l)-t1)));
end;
subplot(2,1,1)
plot(time1,Pt2,'k','linewidth',2);
grid on
title('Response of SDOF System Subjected to Rectangular Impulse');
xlabel('TIME (sec)'); ylabel('P(t)');
axis([0 t2 0 Po*2]);
hold on
plot(xt,Pt,'k','linewidth',2);
subplot(2,1,2)
plot(time1,xt1,'k','linewidth',2);
grid on
xlabel('TIME (sec)'); ylabel('RESPONSE');
Hold on
plot(time2,xt2,'k','linewidth',2);
Response of SDOF System Subjected to Rectangular Impulse
60
40
P(t)
20
0
0 1 2 3 4 5 6 7 8 9 10
TIME (sec)
0.1
0.05
RESPONSE
-0.05
-0.1
0 1 2 3 4 5 6 7 8 9 10
TIME (sec)
20
0
0 1 2 3 4 5 6 7 8 9 10
TIME (sec)
0.1
0.05
RESPONSE
-0.05
-0.1
0 1 2 3 4 5 6 7 8 9 10
TIME (sec)
Sin wave Impulse (Undamped)
MATLAB CODING
clear all
clc
m=101.3211836;
k=1000;
w=sqrt(k/m);
Po=30;
w_bar=0.4*w
beta=w_bar/w
t1=pi()/w_bar; t2=10;
time1=0:.01:t1;
time2=t1:.01:t2;
for i=1:length(time1)
F(i)=Po*sin(w_bar*time1(i));
xt1(i)=(Po/(k*(1-beta^2)))*(sin(w_bar*time1(i))-
(beta*sin(w*time1(i))));
end;
for j=1:length(time2)
xt2(j)=(Po/(k*(1-beta^2)))*((sin(w*(time2(j)-t1))*((-
beta*cos(pi()/beta))-beta))-((beta*sin(pi()/beta)*cos(w*((time2(j)-
t1))))));
end;
subplot(2,1,1)
plot(time1,F,'k','linewidth',2);
grid on
title('Response of SDOF System Subjected to Half Sin Wave Impulse');
xlabel('TIME (sec)'); ylabel('F(t)');
axis([0 t2 -50 50]);
subplot(2,1,2)
plot(time1,xt1,'k','linewidth',2);
grid on
xlabel('TIME (sec)'); ylabel('RESPONSE');
Hold on
plot(time2,xt2,'k','linewidth',2);
-50
0 1 2 3 4 5 6 7 8 9 10
TIME (sec)
0.05
RESPONSE
-0.05
0 1 2 3 4 5 6 7 8 9 10
TIME (sec)