Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

AE 5311 Structural Dynamics

Homework #1
Dhruv Deshpande SN=26
1000958328

Code
%% AE 5311 Structural Dynamics Homework 1
%% Dhruv Deshpande SN=26
clear all
clc
%% Please note!!!
%Mass and Spring constant were changed from 1800 lbs and 4200 lb/ft to
%1.8 lb and 4.2 lb/ft because there was no effect of damping on earlier values
m=1.800*0.453592;%kg
k=4.200*0.453592/0.3048;%N/m
%% Problem 1
c=[0;0.25;1;1.5]; %damping factor
wn=sqrt(k/m);
cc=2*m*wn;
zeta=c/cc
wd=sqrt(1-zeta.^2)*wn;
% Define the initial conditions
u0=0.5*0.3048/12;%ft
v0=4*0.3048/12;%ft
tn=2*pi/wn;%natural period
dt=tn/20;
t=0:dt:5*tn;%5 undamped periods
A=u0;B=(v0+u0*zeta*wn)/wd;
disp('UI1=exp(-zeta*wn*t).*(A*cos(wd*t)+B*sin(wd*t))')
UI1=exp(-zeta*wn*t).*(A*cos(wd*t)+B*sin(wd*t));
% Plotting figures
figure(1)
plot(t,UI1(1,:),'b-','linewidth',2)
hold on
plot(t,UI1(2,:),'r-.','linewidth',2)
plot(t,UI1(3,:),'g--','linewidth',2)
plot(t,UI1(4,:),'m:','linewidth',2)
xlabel('\bfTime')
ylabel('\bfResponse')
title('\bfProblem 1:Responses due to IC')
legend('\bfDisplacement for c=0','\bfDisplacement for c=0.25',...
'\bfDisplacement for c=1','\bfDisplacement for c=1.5','location','south')
grid on
%% Problem 2
p0=420*0.453592; %step force
c=[0;0.25];
wn=sqrt(k/m);
cc=2*m*wn;
zeta=c/cc;
wd=sqrt(1-zeta.^2)*wn;
tn=2*pi/wn;%natural period
dt=tn/20;
t=0:dt:5*tn;%5 undamped periods
A=u0;B=(v0+u0*zeta*wn)/wd;
disp('UI2=p0*(1-exp(-zeta*wn*t).*(A*cos(wd*t)+B*sin(wd*t)))/k')
UI2=p0*(1-exp(-zeta*wn*t).*(A*cos(wd*t)+B*sin(wd*t)))/k;
% Plotting figures
figure(2)
plot(t,UI2(1,:),'b-','linewidth',2)
hold on
plot(t,UI2(2,:),'r-.','linewidth',2)
xlabel('\bfTime')
ylabel('\bfResponse')
title('\bfProblem 2:Responses due to Step input')
legend('\bfDisplacement for c=0','\bfDisplacement for c=0.25',...

'location','south')
grid on
%% Problem 3
a0=42;a1=0;a2=0.42;
c=[0;0.25];
b00=zeros(2,99);
b0=(a0*k^2-a1*c*k-2*m*a2*k+2*a2*c.^2)/k^3;
b0=[b0 b00];
b1=(a1*k-2*a2*c)/k^2;
b20=zeros(1,1);
b2=a2/k;
b2=[b2;b20];
wn=sqrt(k/m);
cc=2*m*wn;
zeta=c/cc;
wd=sqrt(1-zeta.^2)*wn;
tn=2*pi/wn;%natural period
dt=tn/20;
t=linspace(0,5*tn);%5 undamped periods
A=-a0;B=-(a1+zeta*wn*a0)/wd;
up=b0+b1*t+b2*t.^2;
uc=exp(-zeta*wn*t).*(A*cos(wd*t)+B*sin(wd*t));
UI3=up+uc;
% Plotting figures
figure(3)
plot(t,UI3(1,:),'b-','linewidth',2)
hold on
plot(t,UI3(2,:),'r-.','linewidth',2)
xlabel('\bfTime')
ylabel('\bfResponse')
title('\bfProblem 3:Responses due to quadratic input')
legend('\bfDisplacement for c=0','\bfDisplacement for c=0.25',...
'location','south')
grid on

OUTPUT
zeta =

0
0.0553
0.2213
0.3320

UI1=exp(-zeta*wn*t).*(A*cos(wd*t)+B*sin(wd*t))
UI2=p0*(1-exp(-zeta*wn*t).*(A*cos(wd*t)+B*sin(wd*t)))/k

RESPONSES
Problem 1:Responses due to IC

0.04
0.03
0.02

Response

0.01
0
-0.01
-0.02

Displacement for
Displacement for
Displacement for
Displacement for

-0.03
-0.04

6
Time

c=0
c=0.25
c=1
c=1.5
8

10

12

10

12

Problem 2:Responses due to Step input

32

31.5

Response

31

30.5

30

29.5

29

Displacement for c=0


Displacement for c=0.25
0

6
Time

Problem 3:Responses due to quadratic input

50
40
30

Response

20
10
0
-10
-20
-30
Displacement for c=0
Displacement for c=0.25

-40
-50

6
Time

10

12

You might also like