0% found this document useful (0 votes)
83 views

A.A Fondjo. Dynamic Loading On Structures Project

The document analyzes the structural vibration of a 3 degree of freedom system using MATLAB. It presents results for 7 questions, including natural frequencies, mode shapes, displacement responses over time, and maximum displacements, forces and shear forces when an input force is applied. The percentage error between calculated natural frequencies and those obtained from the power spectral density is small, validating the use of PSD to determine natural frequencies.

Uploaded by

Armand Fondjo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views

A.A Fondjo. Dynamic Loading On Structures Project

The document analyzes the structural vibration of a 3 degree of freedom system using MATLAB. It presents results for 7 questions, including natural frequencies, mode shapes, displacement responses over time, and maximum displacements, forces and shear forces when an input force is applied. The percentage error between calculated natural frequencies and those obtained from the power spectral density is small, validating the use of PSD to determine natural frequencies.

Uploaded by

Armand Fondjo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

DEPARTMENT OF CIVIL ENGINEERING,

UNIVERSITY OF THE WITWATERSRAND

CIVN7005

STRUCTURAL DYNAMICS

PROJECT: STRUCTURAL VIBRATION ANALYSIS OF


A 3 DOF SYSTEM USING MATLAB

BY ARMAND AUGUSTIN FONDJO

(STUDENT NO 526196)

LECTURER: DR. K LI
Preface

The structure as given:

Figure 1: Structural layout

m1 500x10 Ns /m
⎡ ⎤
⎢ m2 500x10 Ns /m ⎥
⎢ m3 500x10 Ns /m ⎥
⎢ k1 1.26x10 N/m ⎥
⎢ ⎥
⎢ k2 8.41x10 N/m ⎥
⎢ k3 4.20x10 N/m ⎥
⎢c1 4.2657x10 Ns/m⎥
⎢ ⎥
⎢c2 2.8438x10 Ns/m⎥
⎣c3 1.4219x10 Ns/m⎦

[1]
Results presented for all questions, refers:

Naturan Frequency - Max Max Inertia Max Shear


f3(t)
Question Floor Frequency PSD Displacement Force Force
kN rad rad mm kN kiN
1 0 5.91
1 2 0 13.88
3 0 22.99
1 0 0.482
2 2 0 0.774
3 0 12
1 0 5.65
3 2 0 13.62
3 0 22.82
1 12sin20t 5.65 0.087 10.62 10.89
4 2 12sin20t 13.62 0.098 9.064 6.752
3 12sin20t 19.69 0.224 9.873 7.111
1 12sin5.62t 1.85 30.63 2334.7
5 2 12sin5.62t 5.45 4.266 69.88 202.8
3 12sin5.62t 0.742 186.6 132.9
1 ELC 3.7 152 466
6 2 ELC 5.65 7.77 201.7 282.3
3 ELC 12.62 412.4 190.3
1 2e-5t 0 0.021 0.78 1.955
5.65
7 2 2e-5t 0.043 1.072 1.877
13.38
3 2e-5t 0 0.064 1.814 1.323

[2]
Question 1

Governing equation of motion

!"#$% + '!#$% + (!)#$% *#$%

If damping is neglected:

'ф фΩ

Source - MATLAB code Question 1

0.3 −0.7142 −1.2


ф 10 +0.7 −0.9658 0.8 -
1.2 0.7463 −0.1

5.91 0 0
Ω + 0 13.88 0 -
0 0 22.99

Question 2

x 10
-3 Displacement Response of First Floor vs Time
6
Displacement Response in metres

-2

-4 X: 0.44
Y: -0.004827

-6
0 1 2 3 4 5 6 7 8 9 10
Time in seconds

[3]
Displacement Response of Second Floor vs Time
0.01
Displacement Response in metres

0.005

-0.005
X: 0.48
Y: -0.007746

-0.01
0 1 2 3 4 5 6 7 8 9 10
Time in seconds

Displacement Response of Thrid Floor vs Time

0.01
Displacement in metres

0.005

-0.005

-0.01
0 5 10 15
Time in seconds

Question 3

Conversion of hertz to radians – w1(radians) = 2πf1

First Floor
1.5

1
Magnitude

0.5

0
0 1 2 3 4 5 6
Frequency in Hertz

[4]
Second Floor
3

2.5

2
Magnitude

1.5

0.5

0
0 1 2 3 4 5 6
Frequency in Hertz

Third Floor
4.5

3.5

3
Magnitude

2.5

1.5

0.5

0
0 1 2 3 4 5 6
Frequency in Hertz

Frequency –
Frequency - PSD
Floor eigenvalue %error
radians radians
1 5.91 5.694266 -4.40
2 13.88 13.6245432 -1.87
3 22.99 22.8223432 -0.74

The percentage error is small, thus it is acceptable to use Power Spectral Density as measure of
natural frequency.

Question 4
.

Frequency - Max Max Inertia Max Shear


f3(t)
Floor PSD Displacement Force Force
kN radians mm N N
1 12sin20t 5.65 0.087 10620 10890
2 12sin20t 13.62 0.098 9064 6752
3 12sin20t 19.69 0.224 9873 7111

[5]
-5
x 10
First Floor
10

8 X: 1.31
Y: 8.692e-005

6
Displacement [m]

-2

-4

-6

-8
0 1 2 3 4 5 6 7 8 9 10
time [s]

-4
x 10
Second Floor
2

1.5
Displacement [m]

0.5

-0.5
X: 1.87
Y: -9.803e-005

-1
0 1 2 3 4 5 6 7 8 9 10
time [s]

-4
x 10
Third Floor
3
X: 0.22
Y: 0.0002235

2
Displacement [m]

-1

-2

-3
0 1 2 3 4 5 6 7 8 9 10
time [s]

[6]
4
x 10
First Floor
1.5
X: 0.56
Y: 1.062e+004

1
Inertia Force [N]

0.5

-0.5

-1
0 1 2 3 4 5 6 7 8 9 10
time [s]

Second Floor
6000

4000

2000
Inertia Force [N]

-2000

-4000

-6000

-8000 X: 0.33
Y: -9064

-10000
0 1 2 3 4 5 6 7 8 9 10
time [s]

Third Floor
10000
X: 0.31
Y: 9783

8000
Inertia Force [N]

6000

4000

2000

-2000
0 1 2 3 4 5 6 7 8 9 10
time [s]

[7]
4
x 10
First Floor
1.5

1 X: 1.31
Y: 1.095e+004
Shear Force [N]

0.5

-0.5

-1
0 1 2 3 4 5 6 7 8 9 10
time [s]

Second Floor
8000

6000 X: 0.72
Y: 6752

4000
Shear Force [N]

2000

-2000

-4000

-6000

-8000
0 1 2 3 4 5 6 7 8 9 10
time [s]

4
x 10
Third Floor
1.5

1
Shear Force [N]

0.5

-0.5

-1
0 1 2 3 4 5 6 7 8 9 10
time [s]

[8]
Q4 PSD

Frequency -
f3(t) Frequency - PSD
Story Eigenvalue
kN radians radians
1,2,3 12sin20t 5.91 5.65
1,2,3 12sin20t 13.88 13.62
1,2,3 12sin20t 22.99 19.69

Second Floor
0.1

0.08
Abs. Magnitude

0.06

0.04

0.02

0
0 1 2 3 4 5 6 7 8 9 10
Frequency in Hertz

Three natural frequencies experienced

Question 5
Max Max Inertia
f3(t) Max Shear Force
Floor Displacement Force
kN mm N N
1 12sin5.62t 1.85 30630 2334700
2 12sin5.62t 4.266 69880 202800
3 12sin5.62t 0.742 186600 132900

[9]
-3
x 10
First Floor
2
X: 9.29
Y: 0.00185
1.5

1
Displacement [m]

0.5

-0.5

-1

-1.5

-2
0 2 4 6 8 10 12 14 16 18 20
time [s]

-3
x 10
Second Floor
5
Displacement [m]

X: 9.84
Y: -0.004266

-5
0 2 4 6 8 10 12 14 16 18 20
time [s]

-3
x 10
Third Floor
8
X: 9.29
Y: 0.00742
6

4
Displacement [m]

-2

-4

-6

-8
0 2 4 6 8 10 12 14 16 18 20
time [s]

[10]
4
x 10
First Floor
4

2
Inertia Force [N]

-1

-2
X: 9.29
Y: -3.036e+004
-3

-4
0 2 4 6 8 10 12 14 16 18 20
time [s]

4
x 10
Second Floor
8
X: 9.83
6 Y: 6.988e+004

4
Inertia Force [N]

-2

-4

-6

-8
0 2 4 6 8 10 12 14 16 18 20
time [s]

5
x 10
Third Floor
2

1.5

1
Inertia Force [N]

0.5

-0.5

-1

-1.5 X: 9.85
Y: -1.866e+005

-2
0 2 4 6 8 10 12 14 16 18 20
time [s]

[11]
5
x 10
First Floor
3

Shear Force [N] 2

-1

X: 9.84
-2 Y: -2.334e+005

-3
0 2 4 6 8 10 12 14 16 18 20
time [s]

5
x 10
Second Floor
3

2
Shear Force [N]

-1
X: 9.29
Y: -2.028e+005
-2

-3
0 2 4 6 8 10 12 14 16 18 20
time [s]

5 Third Floor
x 10
1.5
X: 9.84
Y: 1.329e+005
1
Shear Force [N]

0.5

-0.5

-1

-1.5
0 2 4 6 8 10 12 14 16 18 20
time [s]

[12]
PSD

Second Floor
8

6
Abs. Magnitude

5 X: 0.8667
Y: 4.185

0
0 1 2 3 4 5 6 7 8 9 10
Frequency in Hertz

Only one peak is experienced, peak at first natural frequency

Question 6

f3(t) Max Displacement Max Inertia Force Max Shear Force


Floor

kN mm N N

1 12sin5.62t 3.7 152000 466000

2 12sin5.62t 7.77 201700 282300

3 12sin5.62t 12.62 412400 190300

-3
x 10
First Floor
3

2
Displacement [m]

-1

-2

-3 X: 1.58
Y: -0.003698

-4
0 2 4 6 8 10 12 14 16 18 20
time [s]

[13]
-3
x 10
Second Floor
6

4
Displacement [m]
2

-2

-4

-6
X: 0.56
Y: -0.007777

-8
0 2 4 6 8 10 12 14 16 18 20
time [s]

Third Floor
0.015

0.01
Displacement [m]

0.005

-0.005

-0.01 X: 0.52
Y: -0.01268

-0.015
0 2 4 6 8 10 12 14 16 18 20
time [s]

x 10
5 First Floor
1

0.5
Inertia Force [N]

-0.5

-1
X: 8.68
Y: -1.52e+005
-1.5

-2
0 2 4 6 8 10 12 14 16 18 20
time [s]

[14]
5
x 10
Second Floor
1

Inertia Force [N] 0.5

-0.5

-1

-1.5
X: 9.61
Y: -2.017e+005
-2

-2.5
0 2 4 6 8 10 12 14 16 18 20
time [s]

5
x 10
Third Floor
2

1
Inertia Force [N]

-1

-2

-3
X: 0.56
Y: -4.124e+005
-4

-5
0 2 4 6 8 10 12 14 16 18 20
time [s]

5
x 10
First Floor
4

2
Shear Force [N]

-1

-2

-3

-4 X: 1.58
Y: -4.66e+005

-5
0 2 4 6 8 10 12 14 16 18 20
time [s]

[15]
5
x 10
Second Floor
4

3
Shear Force [N]
2

-1

-2
X: 8.54
Y: -2.823e+005

-3
0 2 4 6 8 10 12 14 16 18 20
time [s]

5
x 10
Third Floor
2.5

1.5
Shear Force [N]

0.5

-0.5

-1

-1.5 X: 8.48
Y: -1.903e+005

-2
0 2 4 6 8 10 12 14 16 18 20
time [s]

[16]
ELC, PSD

Second Floor
5

X: 0.9
Y: 4.555
4
Abs. Magnitude

0
0 0.5 1 1.5 2 2.5 3 3.5 4
Frequency in Hertz

One peak experienced at first natural frequency, only first natural frequency is gotten on the
structure during earthquake.

[17]
Question 7

f3(t) Max Displacement Max Inertia Force Max Shear Force


Floor
kN mm N N
1 2e-5t 0.21 780 1955
2 2e-5t 0.043 1072 1877
3 2e-5t 0.064 1814 1323

x 10
-5 First Floor
2.5

2 X: 0.41
Y: 2.107e-005

1.5
Displacement [m]

0.5

-0.5

-1

-1.5

-2
0 2 4 6 8 10 12 14 16 18 20
time [s]

x 10
-5 Second Floor
5

4 X: 0.42
Y: 4.335e-005

3
Displacement [m]

-1

-2

-3

-4
0 2 4 6 8 10 12 14 16 18 20
time [s]

[18]
x 10
-5 Third Floor
8

6 X: 0.37
Y: 6.411e-005

4
Displacement [m]
2

-2

-4

-6

-8
0 2 4 6 8 10 12 14 16 18 20
time [s]

First Floor
600

400
Inertia Force [N]

200

-200

-400

-600
X: 0.41
Y: -780.4

-800
0 2 4 6 8 10 12 14 16 18 20
time [s]

Second Floor
1000

500
Inertia Force [N]

-500

X: 0.43
Y: -1072
-1000

-1500
0 2 4 6 8 10 12 14 16 18 20
time [s]

[19]
Third Floor
2000
X: 0.41
Y: 1814
1500
Inertia Force [N]
1000

500

-500

-1000

-1500
0 2 4 6 8 10 12 14 16 18 20
time [s]

First Floor
3000

2000
Shear Force [N]

1000

-1000
X: 2
Y: -1955

-2000
0 2 4 6 8 10 12 14 16 18 20
time [s]

Second Floor
2000

1500

1000
Shear Force [N]

500

-500

-1000

-1500 X: 0.43
Y: -1877

-2000
0 2 4 6 8 10 12 14 16 18 20
time [s]

[20]
Third Floor
1500

1000
Shear Force [N]
500

-500

-1000 X: 0.24
Y: -1323

-1500
0 2 4 6 8 10 12 14 16 18 20
time [s]

PSD

Second Floor
0.03

0.025
Abs. Magnitude

0.02

0.015

0.01

0.005
X: 2.133
Y: 0.0006421

0
0 1 2 3 4 5 6
Frequency in Hertz

Two peaks produced. Corresponding to the first and second natural frequency.

[21]
KEYS PROGRAMME

[22]
Question No 1 - Natural Frequencies

m1 = 500e3
m2 = 500e3
m3 = 500e3 %m1, m2,m3 in Ns^2/m
k1 = 1.26e8
k2 = 8.41e7
k3 = 4.20e7 %k1,k2,k3 in N/m

M = [m1 0 0; 0 m2 0; 0 0 m3] %Mass matrix


K = [k1+k2 -k2 0; -k2 k2+k3 -k3; 0 -k3 k3] %Stiffness matrix

[V,D] = eig(K,M) %Solution for eigenvalue problem - natural


frequencies and modeshapes

omega1 = sqrt(D(1,1))
omega2 = sqrt(D(2,2))
omega3 = sqrt(D(3,3)) % Natural frequencies

Mode1 = V(:,1)
Mode2 = V(:,2)
Mode3 = V(:,3) %mode shapes

[23]
Question 2 –

m1 = 500e3
m2 = 500e3
m3 = 500e3 %m1, m2,m3 in Ns^2/m
k1 = 1.26e8
k2 = 8.41e7
k3 = 4.20e7 %k1,k2,k3 in N/m

M = [m1 0 0; 0 m2 0; 0 0 m3] %Mass matrix


K = [k1+k2 -k2 0; -k2 k2+k3 -k3; 0 -k3 k3] %Stiffness matrix

c1 = 4.2657e5
c2 = 2.8438e5
c3 = 4.219e5 %Question 2 - c1,c2,c3 in Ns/m

C = [c1+c2 -c2 0; -c2 c2+c3 -c3; 0 -c3 c3] %Damping matrix

D = inv(M) %Inverse of the mass matrix %Range


Kutta%
X0 = [0;0;0.012] %Initial Displacement condition
DX0 = [0;0;0] %Initial Velocity
Tao = 0.01; %Time step interval
h = Tao/2;
Xrk(:,1)=X0;
Yrk(:,1)=DX0;
F0=0;
N=300;
for i=1:N
t(i) = (i-1)*Tao;
T1 = t(i);
X1 = Xrk(:,i);
Y1 = Yrk(:,i);
rk1=[0,0,0]';
F1 = D*(rk1-K*X1- C*Y1);

T2 = t(i) + h;
X2 = Xrk(:,i) + Y1*h;
Y2 = Yrk(:,i) + F1*h;
rk2=[0,0,0]';
F2 = D*(rk2-K*X2- C*Y2);

T3 = t(i) + h;

[24]
X3 = Xrk(:,i) + Y2*h;
Y3 = Yrk(:,i) + F2*h;
rk3=[0,0,0]';
F3 = D*(rk3-K*X3- C*Y3);

T4 = t(i) + Tao ;
X4 = Xrk(:,i) + Y3*h;
Y4 = Yrk(:,i) + F3*h;
rk4=[0,0,0]';
F4 = D*(rk4-K*X4- C*Y4);

Xrk(:,i+1) = Xrk(:,i) + (Tao/6)*(Y1+2*Y2 +2*Y3 + Y4);


Yrk(:,i+1) = Yrk(:,i) + (Tao/6)*(F1+2*F2 +2*F3 + F4);
t(i+1) = t(i);
x1= Xrk(1,:);
x2= Xrk(2,:);
x3= Xrk(3,:);

end

figure
plot(t,x1)
ylabel('Displacement in metres'), grid on
xlabel('Time in seconds')
title('Displacement vs Time Response Response of First Floor')

figure
plot(t,x2)
ylabel('Displacement in metres'), grid on
xlabel('Time in seconds')
title('Displacement vs Time Response Response of Second Floor')

figure
plot(t,x3)
ylabel('Displacement in metres'), grid on
xlabel('Time in seconds')
title('Displacement vs Time Response Response of Third Floor')

[25]
Question 3 - Spectral Analysis using the FFT Method

m1 = 500e3
m2 = 500e3
m3 = 500e3 %m1, m2,m3 in Ns^2/m
k1 = 1.26e8
k2 = 8.41e7
k3 = 4.20e7 %k1,k2,k3 in N/m

M = [m1 0 0; 0 m2 0; 0 0 m3] %Mass matrix


K = [k1+k2 -k2 0; -k2 k2+k3 -k3; 0 -k3 k3] %Stiffness matrix

c1 = 4.2657e5
c2 = 2.8438e5
c3 = 4.219e5 %Question 2 - c1,c2,c3 in Ns/m

C = [c1+c2 -c2 0; -c2 c2+c3 -c3; 0 -c3 c3] %Damping matrix

D = inv(M) %Inverse of the mass matrix


X0 = [0;0;0.01] %Initial Displacement condition
DX0 = [0;0;0] %Initial Velocity
Tao = 0.01; %Time step interval
h = Tao/2;
Xrk(:,1)=X0;
Yrk(:,1)=DX0;
F0=0;
N=3000;
for i=1:N
t(i) = (i-1)*Tao;
T1 = t(i);
X1 = Xrk(:,i);
Y1 = Yrk(:,i);
rk1=[0,0,0]';
F1 = D*(rk1-K*X1- C*Y1);

T2 = t(i) + h;
X2 = Xrk(:,i) + Y1*h;
Y2 = Yrk(:,i) + F1*h;
rk2=[0,0,0]';
F2 = D*(rk2-K*X2- C*Y2);

T3 = t(i) + h;
X3 = Xrk(:,i) + Y2*h;

[26]
Y3 = Yrk(:,i) + F2*h;
rk3=[0,0,0]';
F3 = D*(rk3-K*X3- C*Y3);

T4 = t(i) + Tao ;
X4 = Xrk(:,i) + Y3*h;
Y4 = Yrk(:,i) + F3*h;
rk4=[0,0,0]';
F4 = D*(rk4-K*X4- C*Y4);

Xrk(:,i+1) = Xrk(:,i) + (Tao/6)*(Y1+2*Y2 +2*Y3 + Y4);


Yrk(:,i+1) = Yrk(:,i) + (Tao/6)*(F1+2*F2 +2*F3 + F4);
t(i+1) = t(i);
x1= Xrk(1,:);
x2= Xrk(2,:);
x3= Xrk(3,:);
f(i+1)=(i-1)*(1/Tao)/N;
end

%Fourier Transform - taken as the powerspectral

y1 = abs(fft(x1));
y2 = abs(fft(x2));
y3 = abs(fft(x3));

figure
plot(f,y3),axis([0 6 0 4.5])
ylabel('Magnitude'), grid on
xlabel('Frequency in Hertz')
title('Third Floor')

figure
plot(f,y1),axis([0 6 0 1.5])
ylabel(' Magnitude'), grid on
xlabel('Frequency in Hertz')
title('First Floor')

figure
plot(f,y2),axis([0 6 0 3])
ylabel(' Magnitude'), grid on
xlabel('Frequency in Hertz')
title('Second Floor')

[27]
Question 4.

Design Parameters
M = mass matrix in Ns^2/m
K = stiffness matrix in N/m
C = damping matrix in Ns/m

M1 = 500E3
M2 = 500E3
M3 = 500E3
K1 = 1.26E8
K2 = 8.41E7
K3 = 4.20E7
C1 = 4.2657E5
C2 = 2.0430E5
C3 = 1.4219E5

M = [M1,0,0;0,M2,0;0,0,M3] %Three degrees of freedom system mass


matrix
K = [K1+K2,-K2,0;-K2,K2+K3,-K3;0,-K3,K3] %Three degrees of freedom system
stiffness matrix
C = [C1+C2,-C2,0;-C2,C2+C3,-C3;0,-C3,C3] %Three degrees of freedom
system damping matrix

D = inv(M)
X0 = [0;0;0]
DX0 = [0;0;0]
Tao = 0.01;
h = Tao/2;
Xrk(:,1)=X0;
Yrk(:,1)=DX0;
F0=0;
N=5000;
for i=1:N
t(i) = (i-1)*Tao;
T1 = t(i);
X1 = Xrk(:,i);
Y1 = Yrk(:,i);
rk1=[0,0,12*sin(20*T1)]';
F1 = D*(rk1-K*X1- C*Y1);

[28]
T2 = t(i) + h;
X2 = Xrk(:,i) + Y1*h;
Y2 = Yrk(:,i) + F1*h;
rk2=[0,0,12*sin(20*T2)]';
F2 = D*(rk2-K*X2- C*Y2);

T3 = t(i) + h;
X3 = Xrk(:,i) + Y2*h;
Y3 = Yrk(:,i) + F2*h;
rk3=[0,0,12*sin(20*T3)]';
F3 = D*(rk3-K*X3- C*Y3);

T4 = t(i) + Tao ;
X4 = Xrk(:,i) + Y3*h;
Y4 = Yrk(:,i) + F3*h;
rk4=[0,0,12*sin(20*T4)]';
F4 = D*(rk4-K*X4- C*Y4);

Xrk(:,i+1) = Xrk(:,i) + (Tao/6)*(Y1+2*Y2 +2*Y3 + Y4);


Yrk(:,i+1) = Yrk(:,i) + (Tao/6)*(F1+2*F2 +2*F3 + F4);
t(i+1) = t(i);
x1= Xrk(1,:);
x2= Xrk(2,:);
x3= Xrk(3,:);
f(i+1)=(i-1)*(1/Tao)/N;
end

% Q4.1(a) Displacement
figure
plot(t,Xrk(1,:))
ylabel('Displacement [m]'), grid on
xlabel('time [s]')
title('1st Storey')

figure
plot(t,Xrk(2,:))
ylabel('Displacement [m]'), grid on
xlabel('time [s]')
title('2nd Storey')

figure
plot(t,Xrk(3,:))
ylabel('Displacement [m]'), grid on
xlabel('time [s]')

[29]
title('3rd Storey')

% Q4.1(b) Maximum Inertia Force


y1= Yrk(1,:);
y2= Yrk(2,:);
y3= Yrk(3,:);

Inert1 = 0-((K1+K2)*x1)+(K2*x2)-((C1+C2)*y1)+(C2*y2);
Inert2 = 0+(K2*x1)-((K2+K3)*x2)+(K3*x3)+(C2*y1)-((C2+C3)*y2)+(C3*y3);
Inert3 = 12*sin(20*t(i))+(K3*x2)-(K3*x3)+(C3*y2)-(C3*y3);

figure
plot(t,Inert1)
ylabel('Inertia Force [N]'), grid on
xlabel('time [s]')
title('1st Storey')

figure
plot(t,Inert2)
ylabel('Inertia Force [N]'), grid on
xlabel('time [s]')
title('2ND Storey')

figure
plot(t,Inert3)
ylabel('Inertia Force [N]'), grid on
xlabel('time [s]')
title('3RD Storey')

% Q4.1(c) Maximum Shear Force

Shear1 = (x1)*K1;
Shear2 = (x1-x2)*K2;
Shear3 = (x1-x3)*K3;

figure
plot(t,Shear1)
ylabel('Shear Force [N]'), grid on
xlabel('time [s]')
title('1st Storey')

figure
plot(t,Shear2)
ylabel('Shear Force [N]'), grid on

[30]
xlabel('time [s]')
title('2ND Storey')

figure
plot(t,Shear3)
ylabel('Shear Force [N]'), grid on
xlabel('time [s]')
title('3RD Storey')

% Q4.2 FFT of each storey

z1 = abs(fft(x1));
z2 = abs(fft(x2));
z3 = abs(fft(x3));

figure
plot(f,z3),axis([0 10 0 3.5e-4])
ylabel('Abs. Magnitude'), grid on
xlabel('Frequency [Hertz]')
title('3rd Storey freq')

figure
plot(f,z1),axis([0 10 0 1.5e-4])
ylabel('Abs. Magnitude'), grid on
xlabel('Frequency [Hertz]')
title('1st Storey freq')

figure
plot(f,z2),axis([0 10 0 1.5e-4])
ylabel('Abs. Magnitude'), grid on
xlabel('Frequency [Hertz]')
title('2nd Storey freq')

[31]
Question 5 -

m1 = 500e3
m2 = 500e3
m3 = 500e3 %m1, m2,m3 in Ns^2/m
k1 = 1.26e8
k2 = 8.41e7
k3 = 4.20e7 %k1,k2,k3 in N/m

M = [m1 0 0; 0 m2 0; 0 0 m3] %Mass matrix


K = [k1+k2 -k2 0; -k2 k2+k3 -k3; 0 -k3 k3] %Stiffness matrix

c1 = 4.2657e5
c2 = 2.8438e5
c3 = 4.219e5

C = [c1+c2 -c2 0; -c2 c2+c3 -c3; 0 -c3 c3] %Damping matrix

D = inv(M) %Inverse of the mass matrix


X0 = [0;0;0] %Initial Displacement condition
DX0 = [0;0;0] %Initial Velocity
Tao = 0.01; %Time step interval
h = Tao/2;
Xrk(:,1)=X0;
Yrk(:,1)=DX0;
F0=0;
N=3000;
for i=1:N
t(i) = (i-1)*Tao;
T1 = t(i);
X1 = Xrk(:,i);
Y1 = Yrk(:,i);
rk1=[0,0,12000*sin(5.62*T1)]';
F1 = D*(rk1-K*X1- C*Y1);

T2 = t(i) + h;
X2 = Xrk(:,i) + Y1*h;
Y2 = Yrk(:,i) + F1*h;
rk2=[0,0,12000*sin(5.62*T2)]';
F2 = D*(rk2-K*X2- C*Y2);

T3 = t(i) + h;
X3 = Xrk(:,i) + Y2*h;

[32]
Y3 = Yrk(:,i) + F2*h;
rk3=[0,0,12000*sin(5.62*T3)]';
F3 = D*(rk3-K*X3- C*Y3);

T4 = t(i) + Tao ;
X4 = Xrk(:,i) + Y3*h;
Y4 = Yrk(:,i) + F3*h;
rk4=[0,0,12000*sin(5.62*T4)]';
F4 = D*(rk4-K*X4- C*Y4);

Xrk(:,i+1) = Xrk(:,i) + (Tao/6)*(Y1+2*Y2 +2*Y3 + Y4);


Yrk(:,i+1) = Yrk(:,i) + (Tao/6)*(F1+2*F2 +2*F3 + F4);
t(i+1) = t(i);
x1= Xrk(1,:);
x2= Xrk(2,:);
x3= Xrk(3,:);
f(i+1)=(i-1)*(1/Tao)/N;
end

% Displacement
figure
plot(t,Xrk(1,:))
ylabel('Displacement [m]'), grid on
xlabel('time [s]')
title('First Floor')

figure
plot(t,Xrk(2,:))
ylabel('Displacement [m]'), grid on
xlabel('time [s]')
title('Second Floor')

figure
plot(t,Xrk(3,:))
ylabel('Displacement [m]'), grid on
xlabel('time [s]')
title('Third Floor')

% Maximum Inertia Force


y1= Yrk(1,:);
y2= Yrk(2,:);
y3= Yrk(3,:);

Inert1 = 0-((k1+k2)*x1)+(k2*x2)-((c1+c2)*y1)+(c2*y2);

[33]
Inert2 = 0+(k2*x1)-((k2+k3)*x2)+(k3*x3)+(c2*y1)-((c2+c3)*y2)+(c3*y3);
Inert3 = 12000*sin(5.62*t(i))+(k3*x2)-(c3*x3)+(c3*y2)-(c3*y3);

figure
plot(t,Inert1)
ylabel('Inertia Force [N]'), grid on
xlabel('time [s]')
title('First Floor')

figure
plot(t,Inert2)
ylabel('Inertia Force [N]'), grid on
xlabel('time [s]')
title('Second Floor')

figure
plot(t,Inert3)
ylabel('Inertia Force [N]'), grid on
xlabel('time [s]')
title('Third Floor')

% Maximum Shear Force

Shear1 = (x1)*k1;
Shear2 = (x1-x2)*k2;
Shear3 = (x2-x3)*k3;

figure
plot(t,Shear1)
ylabel('Shear Force [N]'), grid on
xlabel('time [s]')
title('First Floor')

figure
plot(t,Shear2)
ylabel('Shear Force [N]'), grid on
xlabel('time [s]')
title('Second Floor')

figure
plot(t,Shear3)
ylabel('Shear Force [N]'), grid on
xlabel('time [s]')
title('Third Floor')

[34]
% Fourier Transform

z1 = abs(fft(x1));
z2 = abs(fft(x2));
z3 = abs(fft(x3));

figure
plot(f,z3),axis([0 10 0 8])
ylabel('Abs. Magnitude'), grid on
xlabel('Frequency in Hertz')
title('Third Floor')

figure
plot(f,z1),axis([0 10 0 8])
ylabel('Abs. Magnitude'), grid on
xlabel('Frequency in Hertz')
title('First Floor')

figure
plot(f,z2),axis([0 10 0 8])
ylabel('Abs. Magnitude'), grid on
xlabel('Frequency in Hertz')
title('Second Floor')

[35]
Question 6 - ELC

clear
fid=fopen('c:\ELC.dat');
[a,n2]=fscanf(fid,'%e',[2,inf]);
n1=length(a);
for j=1:n1
t(j)=a(1,j);
aa(j)=a(2,j);
end
fclose(fid);

g=9.81; %m/s2

m1 = 500e3
m2 = 500e3
m3 = 500e3 %m1, m2,m3 in Ns^2/m
k1 = 1.26e8
k2 = 8.41e7
k3 = 4.20e7 %k1,k2,k3 in N/m

M = [m1 0 0; 0 m2 0; 0 0 m3] %Mass matrix


K = [k1+k2 -k2 0; -k2 k2+k3 -k3; 0 -k3 k3] %Stiffness matrix

c1 = 4.2657e5
c2 = 2.8438e5
c3 = 4.219e5

C = [c1+c2 -c2 0; -c2 c2+c3 -c3; 0 -c3 c3] %Damping matrix

D = inv(M) %Inverse of the mass matrix


X0 = [0;0;0] %Initial Displacement condition
DX0 = [0;0;0] %Initial Velocity
Tao = 0.01; %Time step interval
h = Tao/2;
Xrk(:,1)=X0;
Yrk(:,1)=DX0;
F0=0;
N=3000;
for i=1:N
t(i) = (i-1)*Tao;
T1 = t(i);
X1 = Xrk(:,i);

[36]
Y1 = Yrk(:,i);
if t<=8
rk1=-g*aa(j)*[m1;m2;m3];
else
rk1=[0;0;0];
end
F1 = D*(rk1-K*X1- C*Y1);

T2 = t(i) + h;
X2 = Xrk(:,i) + Y1*h;
Y2 = Yrk(:,i) + F1*h;
if t<=8
rk2=-g*aa(j)*[m1;m2;m3];
else
rk2=[0;0;0];
end
F2 = D*(rk2-K*X2- C*Y2);

T3 = t(i) + h;
X3 = Xrk(:,i) + Y2*h;
Y3 = Yrk(:,i) + F2*h;
if t<=8
rk3=-g*aa(j)*[m1;m2;m3];
else
rk3=[0;0;0];
end
F3 = D*(rk3-K*X3- C*Y3);

T4 = t(i) + Tao ;
X4 = Xrk(:,i) + Y3*h;
Y4 = Yrk(:,i) + F3*h;
if t<=8
rk4=-g*aa(j)*[m1;m2;m3];
else
rk4=[0;0;0];
end
F4 = D*(rk4-K*X4- C*Y4);

Xrk(:,i+1) = Xrk(:,i) + (Tao/6)*(Y1+2*Y2 +2*Y3 + Y4);


Yrk(:,i+1) = Yrk(:,i) + (Tao/6)*(F1+2*F2 +2*F3 + F4);
t(i+1) = t(i);
x1= Xrk(1,:);
x2= Xrk(2,:);
x3= Xrk(3,:);

[37]
f(i+1)=(i-1)*(1/Tao)/N;
end

% Displacement
figure
plot(t,Xrk(1,:))
ylabel('Displacement [m]'), grid on
xlabel('time [s]')
title('First Floor')

figure
plot(t,Xrk(2,:))
ylabel('Displacement [m]'), grid on
xlabel('time [s]')
title('Second Floor')

figure
plot(t,Xrk(3,:))
ylabel('Displacement [m]'), grid on
xlabel('time [s]')
title('Third Floor')

% Maximum Inertia Force


y1= Yrk(1,:);
y2= Yrk(2,:);
y3= Yrk(3,:);

Inert1 = (-g*aa(j)*m1)-((k1+k2)*x1)+(k2*x2)-((c1+c2)*y1)+(c2*y2);
Inert2 = (-g*aa(j)*m2)+(k2*x1)-((k2+k3)*x2)+(k3*x3)+(c2*y1)-((c2+c3)*y2)+(c3*y3);
Inert3 = (-g*aa(j)*m3)+(k3*x2)-(c3*x3)+(c3*y2)-(c3*y3);

figure
plot(t,Inert1)
ylabel('Inertia Force [N]'), grid on
xlabel('time [s]')
title('First Floor')

figure
plot(t,Inert2)
ylabel('Inertia Force [N]'), grid on
xlabel('time [s]')
title('Second Floor')

figure

[38]
plot(t,Inert3)
ylabel('Inertia Force [N]'), grid on
xlabel('time [s]')
title('Third Floor')

% Maximum Shear Force

Shear1 = (x1)*k1;
Shear2 = (x1-x2)*k2;
Shear3 = (x2-x3)*k3;

figure
plot(t,Shear1)
ylabel('Shear Force [N]'), grid on
xlabel('time [s]')
title('First Floor')

figure
plot(t,Shear2)
ylabel('Shear Force [N]'), grid on
xlabel('time [s]')
title('Second Floor')

figure
plot(t,Shear3)
ylabel('Shear Force [N]'), grid on
xlabel('time [s]')
title('Third Floor')

% Fourier Transform

z1 = abs(fft(x1));
z2 = abs(fft(x2));
z3 = abs(fft(x3));

figure
plot(f,z3),axis([0 4 0 8])
ylabel('Abs. Magnitude'), grid on
xlabel('Frequency in Hertz')
title('Third Floor')

figure
plot(f,z1),axis([0 4 0 5])
ylabel('Abs. Magnitude'), grid on

[39]
xlabel('Frequency in Hertz')
title('First Floor')

figure
plot(f,z2),axis([0 4 0 5])
ylabel('Abs. Magnitude'), grid on
xlabel('Frequency in Hertz')
title('Second Floor')

[40]
Question 7

m1 = 500e3
m2 = 500e3
m3 = 500e3 %m1, m2,m3 in Ns^2/m
k1 = 1.26e8
k2 = 8.41e7
k3 = 4.20e7 %k1,k2,k3 in N/m

M = [m1 0 0; 0 m2 0; 0 0 m3] %Mass matrix


K = [k1+k2 -k2 0; -k2 k2+k3 -k3; 0 -k3 k3] %Stiffness matrix

c1 = 4.2657e5
c2 = 2.8438e5
c3 = 4.219e5

C = [c1+c2 -c2 0; -c2 c2+c3 -c3; 0 -c3 c3] %Damping matrix

D = inv(M) %Inverse of the mass matrix


X0 = [0;0;0] %Initial Displacement condition
DX0 = [0;0;0] %Initial Velocity
Tao = 0.01; %Time step interval
h = Tao/2;
Xrk(:,1)=X0;
Yrk(:,1)=DX0;
F0=0;
N=3000;
for i=1:N
t(i) = (i-1)*Tao;
T1 = t(i);
X1 = Xrk(:,i);
Y1 = Yrk(:,i);
rk1=[0,0,2000*exp(-5*T1)]';
F1 = D*(rk1-K*X1- C*Y1);

T2 = t(i) + h;
X2 = Xrk(:,i) + Y1*h;
Y2 = Yrk(:,i) + F1*h;
rk2=[0,0,2000*exp(-5*T2)]';
F2 = D*(rk2-K*X2- C*Y2);

T3 = t(i) + h;
X3 = Xrk(:,i) + Y2*h;

[41]
Y3 = Yrk(:,i) + F2*h;
rk3=[0,0,2000*exp(-5*T3)]';
F3 = D*(rk3-K*X3- C*Y3);

T4 = t(i) + Tao ;
X4 = Xrk(:,i) + Y3*h;
Y4 = Yrk(:,i) + F3*h;
rk4=[0,0,2000*exp(-5*T4)]';
F4 = D*(rk4-K*X4- C*Y4);

Xrk(:,i+1) = Xrk(:,i) + (Tao/6)*(Y1+2*Y2 +2*Y3 + Y4);


Yrk(:,i+1) = Yrk(:,i) + (Tao/6)*(F1+2*F2 +2*F3 + F4);
t(i+1) = t(i);
x1= Xrk(1,:);
x2= Xrk(2,:);
x3= Xrk(3,:);
f(i+1)=(i-1)*(1/Tao)/N;
end

% Displacement
figure
plot(t,Xrk(1,:))
ylabel('Displacement [m]'), grid on
xlabel('time [s]')
title('First Floor')

figure
plot(t,Xrk(2,:))
ylabel('Displacement [m]'), grid on
xlabel('time [s]')
title('Second Floor')

figure
plot(t,Xrk(3,:))
ylabel('Displacement [m]'), grid on
xlabel('time [s]')
title('Third Floor')

% Maximum Inertia Force


y1= Yrk(1,:);
y2= Yrk(2,:);
y3= Yrk(3,:);

Inert1 = 0-((k1+k2)*x1)+(k2*x2)-((c1+c2)*y1)+(c2*y2);

[42]
Inert2 = 0+(k2*x1)-((k2+k3)*x2)+(k3*x3)+(c2*y1)-((c2+c3)*y2)+(c3*y3);
Inert3 = 2000*exp(-5*t(i))+(k3*x2)-(c3*x3)+(c3*y2)-(c3*y3);

figure
plot(t,Inert1)
ylabel('Inertia Force [N]'), grid on
xlabel('time [s]')
title('First Floor')

figure
plot(t,Inert2)
ylabel('Inertia Force [N]'), grid on
xlabel('time [s]')
title('Second Floor')

figure
plot(t,Inert3)
ylabel('Inertia Force [N]'), grid on
xlabel('time [s]')
title('Third Floor')

% Maximum Shear Force

Shear1 = (x1)*k1;
Shear2 = (x1-x2)*k2;
Shear3 = (x2-x3)*k3;

figure
plot(t,Shear1)
ylabel('Shear Force [N]'), grid on
xlabel('time [s]')
title('First Floor')

figure
plot(t,Shear2)
ylabel('Shear Force [N]'), grid on
xlabel('time [s]')
title('Second Floor')

figure
plot(t,Shear3)
ylabel('Shear Force [N]'), grid on
xlabel('time [s]')
title('Third Floor')

[43]
% Fourier Transform

z1 = abs(fft(x1));
z2 = abs(fft(x2));
z3 = abs(fft(x3));

figure
plot(f,z3),axis([0 10 0 0.05])
ylabel('Abs. Magnitude'), grid on
xlabel('Frequency in Hertz')
title('Third Floor')

figure
plot(f,z1),axis([0 10 0 0.05])
ylabel('Abs. Magnitude'), grid on
xlabel('Frequency in Hertz')
title('First Floor')

figure
plot(f,z2),axis([0 10 0 0.05])
ylabel('Abs. Magnitude'), grid on
xlabel('Frequency in Hertz')
title('Second Floor')

[44]

You might also like