cece!
i at etna
NewCivil.com i
i | ae [eon eer ent
ness Method
Ali Moeinadini Yel dum CetecLined
RY Borin (cum aaai ttc oan atd AVRO CHM MTEC athe Ronan Croat
PC Ret mee Cente ety CRU os Gmee crete tt
SSS ut ROM co ketene! PE UElnOut ana aaI nao)
So Occ ea oc coon CUcom
2D Truss Analysis Using Stiffness Method
This program is able to analyze all
types of 2-D trusses (with all degree of
freedom) using stiffness method
(matrix analysis) under any kind
ofconcentrated nodal loadings (Fx,
Fy) and submit values of supportive
reactions, nodal displacements, axial
forces and element stresses and
strains as MATLAB output. General
feature of this program includes one
“m-file* and an “Excel” input file
which to run this program both of
them (truss.m and Truss.xls) must be
saved in MATLAB directory.
Meanwhile notice that input file
(Truss.xls) must be saved as “Excel
2003”. Using this program is very easy
and user friendly (ie. for each new
example adjust input file and then
save it. In entering file, some
questions are asked and some tables
exist which are related to problem
inputs. In this file, variables are shown
in blue color). Then using MATLAB
software run "truss.m" file, later you
can see results in MATLAB’s command
window.
Finally, to test this program, different
Examples are given which in these ,
examples program outputs are
compared with the results from
ABAQUS or ANSYS _ software.
Similarity of results shows that this
program works without any
deficiencies as well as these two
softwares.Suerte NewCivil.com
2D truss analysis using stiffness method (matrix analysis)
"Sobhan Rostani € Ali Moeinadini"
cle
clear 3
SInput data
NWex1sread(*Tr
Nosxisread(*
Conem#leread
NP=xlsread(*
Foren
ADefinition of Global stiffness submatrixes for each element:
for i<1:NB
LG
cos (4)
sqrt ¢ (X (Dir (4, 3) )~K (Dix (4,.2))) 92+ (¥ (Dix (4, 3))-¥ (Dir (4,29) 192
X(Dir (4,3) )-K (Dir (4,29) )/L(L) +
¥ (Dir 4,3) )-¥ (Dir (4,2)))/L()7
i=1:NE
S(L)=B(A)*AG)/LG)
Kil (:,2/4)=8(4)*[(cos(i))*2 sin(i) "cos (i) sein (i) *cos(i) (sin(i))*2);
Kiz(:, ale
kal (, 23 04)5
Kaas, etic 3
end
SDefinition of structure stiffness matrix(plant of submatrixes)
jar03 (2*NN, 2°NN:
nel :NB
sir (ny 2)3
jepirin,3)3
K(Q*i-1 244, 2¢i-1:24i)=kLL (2, z¢n)+ K(QMW1E244, 212A)
K(244 A2(2,2,n)3
K(2*4-1:244,2¢1-1:2¢4)@k21 (2, ten)
K(Q*}-1:243,2*)-1:2*} )k22 (2, ten)+ K(24}-12244 2244)
End
Sefinition of primary external nodal forces vector
Fezeros(2*NN,1)7
for 4-1iNP
re2*Fore(is1)i
Fore(i,2)7
Fore(i,337