Professional Documents
Culture Documents
1. Main Program
clear all;
clc;
global n hs h W Wt Z I Sag R Ah VB soil
n=input('Enter the number of stories: ');
hs=input('Enter the story height in m: ');
h=n*hs;
Wt=0;
disp('Enter the story Weights in kN(from bottom to top):');
for i=1:n
a=sprintf('W%i ',i);
W(i)=input(a);
Wt=Wt+W(i);
end;
z=[ 0 .1 .16 .24 .36];
zone=input('Enter the zone(2/3/4/5): ');
Z=z(zone);
I=input('Enter the Importance factor(1/1.5): ');
R=input('Enter the Response reduction factor: ');
soil=input('Enter the solil type(1/2/3) : ');
choice = questdlg('Do the building have brick infil ?','Brick infil','Yes','No',
'No');
ch=strcmp(choice,'No');
if ch==1
T=.075*h^.75;
Q=load_calc(T);
disp(['Design Seismic Base Shear= ' num2str(VB)]);
Qx=Q;
VBx=VB;
SSx(1)=VB;
for j=1:n-1
SSx(j+1)=SSx(j)-Qx(j);
end
Qy=Q;
VBy=VB;
SSy(1)=VB;
for j=1:n-1
SSy(j+1)=SSy(j)-Qy(j);
end
else
dx=input('Enter the base dimension along X in m: ');
dy=input('Enter the base dimension along Y in m: ');
Tx=.09*h/sqrt(dx);
Qx=load_calc(Tx);
disp(['Design Seismic Base Shear in X= ' num2str(VB)]);
VBx=VB;
Ty=.09*h/sqrt(dy);
Qy=load_calc(Ty);
disp(['Design Seismic Base Shear in Y= ' num2str(VB)]);
VBy=VB;
SSx(1)=VBx;
for j=1:n-1
SSx(j+1)=SSx(j)-Qx(j);
end
end
SSy(1)=VBy;
for j=1:n-1
SSy(j+1)=SSy(j)-Qy(j);
end
story=1:n;
f = figure('Position', [100 100 752 250]);
t = uitable('Parent', f, 'Position', [25 50 700 200], 'Data', [story' Qx' SSx' Qy'
SSy']);
t.ColumnName = {'Story', 'Force X','Story shear X','Force Y', 'Story shear Y'};
Out put:
Enter the
Enter the
Enter the
W1 353.16
W2 323.73
W3 274.68
Enter the
Enter the
Enter the
Enter the
number of stories: 3
story height in m: 3
story Weights in kN(from bottom to top):
zone(2/3/4/5): 3
Importance factor(1/1.5): 1
Response reduction factor: 3
solil type(1/2/3) : 2
%no of stories
%seismic weight in kN
%stiffness in N/m
%mass matrix
K=[k1+k2
-k2
0
%stiffness matrix
-k2
0
k2+k3 -k3
-k3
k3 ];
[R D]=eig(K,M);
for i=1:n
w(i)=sqrt(D(i,i));
T(i)=(2*pi)/w(i);
R(:,i)=R(:,i)/R(1,i);
end
disp('Natural frequencies');
disp(w);
disp('Time periods');
disp(T);
disp('Modal matrix, R=');
disp('
Mode 1
Mode 2
disp(R);
Mode 3 ');
for i=1:n
alfa(i)=1/sqrt((R(:,i))'*M*R(:,i));
f(:,i)=alfa(i)*R(:,i);
end
%zone(2/3/4/5)
%Importance factor(1/1.5)
%Response reduction factor
%solil type(1/2/3)
for k=1:n
for i=1:n
Q(i,k)=A(k)*f(i,k)*P(k)*W(i);
end
end
disp('Lateral forces at each floor in each mode');
disp('
Mode 1
Mode 2
Mode 3 ');
disp(Q);
%Calculation of story shear in each mode
for k=1:n
V(n+1,k)=0;
for i=n:-1:1
V(i,k)=V(i+1,k)+Q(i,k);
end
end
V(n+1,:)=[];
disp('Story shear forces at each floor in each mode');
disp('
Mode 1
Mode 2
Mode 3 ');
disp(V);
VB_bar=input('Enter the base shear obtained from equivalent static method: ');
%Modal Combination
%SRSS
disp('----Modal Combination by SRSS method----');
for i=1:n
SRSS=0;
for k=1:n
SRSS=SRSS+V(i,k)^2;
end
Vsrss(i)=sqrt(SRSS);
end
disp('Net Story shear forces at each floor');
disp('
floor 1
floor 2
floor 3 ');
disp(Vsrss);
if Vsrss(1)<VB_bar
Vsrss=Vsrss*(VB_bar/Vsrss(1));
end
disp('Corrected Story shear forces at each floor');
disp('
floor 1
floor 2
floor 3 ');
disp(Vsrss);
%Calculation of net Lateral forces at each floor
Qsrss(n)=Vsrss(n);
for i=n:-1:2
Qsrss(i-1)=Vsrss(i-1)-Vsrss(i);
end
disp('Net Lateral forces at each floor');
disp('
floor 1
floor 2
floor 3 ');
disp(Qsrss);
%SQC
disp('----Modal Combination by SQC method----');
eta=.05;
%damping ratio
for j=1:n
for i=1:n
beta(j,i)=w(i)/w(j);
end
end
for j=1:n
for i=1:n
r(i,j)=(8*eta^2*(1+beta(i,j))*(beta(i,j)^1.5))/((1beta(i,j)^2)^2+4*eta^2*beta(i,j)*(1+beta(i,j))^2);
end
end
for i=1:n
Vsqc(i)=sqrt(V(i,:)*r*V(i,:)');
end
disp('Net Story shear forces at each floor');
disp('
floor 1
floor 2
floor 3 ');
disp(Vsqc);
if
Vsqc(1)<VB_bar
Vsqc=Vsqc*(VB_bar/Vsqc(1));
end
disp('Corrected Story shear forces at each floor');
disp('
floor 1
floor 2
floor 3 ');
disp(Vsqc);
%Calculation of net Lateral forces at each floor
Qsqc(n)=Vsqc(n);
for i=n:-1:2
Qsqc(i-1)=Vsqc(i-1)-Vsqc(i);
end
disp('Net Lateral forces at each floor');
disp('
floor 1
floor 2
floor 3 ');
disp(Qsqc);
Out put:
Natural frequencies
15.8938
41.2954
Time periods
0.3953
58.9091
0.1522
0.1067
Modal matrix, R=
Mode 1
Mode 2
1.0000
1.0000
1.8893
0.4759
2.4255
-0.9670
Mode 3
1.0000
-1.2414
0.6096
Story
Equivalent Static
Method
SQC
5.44
13.86
13.94
19.94
22.83
22.86
38.06
26.75
26.64