Sunteți pe pagina 1din 5

# ANTALYA BILIM UNIVERSITY

HOMEWORK # 1

Prepared by:

## Emre OZKAT – 140204031

2-c) TrussSD Program
>> %Analyze program for statically determined truss system
clc;clear all;
%% Input truss parameters
NM=28; %Number of members
NJ=16; %Number of joints
NR=4; %Number of reaction forces
NF=4; %Number of external forces
if 2*NJ==NM+NR
%% Initilize input vectors
M1=[1,2,3,4,5,1,2,7,3,9,4,4,5,6,7,8,9,9,11,10,11,11,12,12,13,13,14,14];
M2=[2,3,4,5,6,7,7,3,9,4,10,8,8,8,9,10,10,11,10,12,12,13,13,14,14,15,15,16];
RJ=[15,15,16,16];%RJ: Joint ID where the reaction force exposes
RD=[1,0,1,0];%RD: Direction of the reaction force 0: +X, 1:+Y
FJ=[1,1,6,6];%FJ: Joint ID where the external force exposes
FD=[1,0,1,0];%FD: Direction of the external force 0: +X, 1:+Y
FV=[-1.739,0.466,-1.739,0.466];%FV: Value of force
alpha=[0,0,0,0,0,-26.56,-90,26.56,-90,45,-90,-26.56,-90,206.56,-26.56,206.56,0,-90,45,-
90,0,260.53,220.60,279.46,0,-90,231.34,-90]; %Angles of the members
%% Add member force coefficients to the coefficient matrix
A=zeros(2*NJ,2*NJ);
for i=1:NM
A(2*M1(i)-1, i)=cos(alpha(i));
A(2*M1(i), i)=sin(alpha(i));
A(2*M2(i)-1, i)=-cos(alpha(i));
A(2*M2(i), i)=-sin(alpha(i));
end
%% Add reaction force coefficients to the coefficient matrix
for i=1:NR
if RD(i)==0
A(2*RJ(i)-1, i+NM)=1;
else
A(2*RJ(i), i+NM)=1;
end
end
%% Add external force coefficients to the right hand side (Force) vector
F=zeros(1,2*NJ);
for i=1:NF
if FD(i)==0
F(2*FJ(i)-1)=-FV(i);
else
F(2*FJ(i))=-FV(i);
end
end
%% Calculate member forces
f=A\F';
%% Print member forces
for i=1:NM
if f(i)<0
fprintf('Member ID: %d force: %4.2f Dir.: Comp.\n', i,f(i));
else
fprintf('Member ID: %d force: %4.2f Dir.: Ten.\n', i,f(i));
end
end
%% Print reaction forces
for i=1:NR
if f(i+NM)>0
if RD(i)==0
fprintf('Reaction ID: %d force: %4.2f Dir.: +X\n', i,f(i+NM));
else
fprintf('Reaction ID: %d force: %4.2f Dir.: +Y\n', i,f(i+NM));
end
else
if RD(i)==0
fprintf('Reaction ID: %d force: %4.2f Dir.: -X\n', i,f(i+NM));
else
fprintf('Reaction ID: %d force: %4.2f Dir.: -Y\n', i,f(i+NM));
end
end
end
else
disp('System is not statically determined')
end

## Member ID: 1 force: 3.01 Dir.: Ten.

Member ID: 2 force: 3.01 Dir.: Ten.
Member ID: 3 force: 3.01 Dir.: Ten.
Member ID: 4 force: 3.94 Dir.: Ten.
Member ID: 5 force: 3.94 Dir.: Ten.
Member ID: 6 force: -3.89 Dir.: Comp.
Member ID: 7 force: -0.00 Dir.: Ten.
Member ID: 8 force: 0.00 Dir.: Ten.
Member ID: 9 force: -0.00 Dir.: Comp.
Member ID: 10 force: 1.32 Dir.: Ten.
Member ID: 11 force: -0.93 Dir.: Comp.
Member ID: 12 force: 0.00 Dir.: Ten.
Member ID: 13 force: 0.00 Dir.: Ten.
Member ID: 14 force: -3.89 Dir.: Comp.
Member ID: 15 force: -3.89 Dir.: Comp.
Member ID: 16 force: -3.89 Dir.: Comp.
Member ID: 17 force: -4.41 Dir.: Comp.
Member ID: 18 force: -0.81 Dir.: Comp.
Member ID: 19 force: 1.32 Dir.: Ten.
Member ID: 20 force: -3.60 Dir.: Comp.
Member ID: 21 force: -0.91 Dir.: Comp.
Member ID: 22 force: 0.13 Dir.: Ten.
Member ID: 23 force: 0.36 Dir.: Ten.
Member ID: 24 force: -3.89 Dir.: Comp.
Member ID: 25 force: -0.29 Dir.: Comp.
Member ID: 26 force: 0.36 Dir.: Ten.
Member ID: 27 force: 1.49 Dir.: Ten.
Member ID: 28 force: -5.00 Dir.: Comp.
Reaction ID: 1 force: -1.52 Dir.: -Y
Reaction ID: 2 force: -0.93 Dir.: -X
Reaction ID: 3 force: 5.00 Dir.: +Y
Reaction ID: 4 force: -0.00 Dir.: -X
2-d) Sap2000 Program
Frame Member Force
1 T 3.012
2 T 3.012
3 T 3.012
4 T 3.944
5 T 3.944
6 C -3.888
7 -8,88E-16
8 -7,10E-15
9 0
10 T 1.318
11 C -0.932
12 -2,13E-14
13 0
14 C -3.888
15 C -3.889
16 C -3.888
17 C -4.41
18 C -0.807
19 T 1.318
20 C -3.603
21 C -0.89
22 T 0.132
23 C -0.311
24 C -3.601
25 T 0.207
26 C -0.061
27 T 1.318
28 C -4.349

- Base Reactions