0% found this document useful (0 votes)
114 views6 pages

Open Ended Lab of MATLAB (Truss Design by FEM)

The document describes analyzing a truss structure using MATLAB. It involves developing functions to calculate the elemental stiffness matrix, global stiffness matrix, member forces, and unknown displacements and reactions. The truss has 9 elements connecting 6 nodes. The program is run by inputting material properties, node coordinates, applied loads, and constrained displacements. It outputs the global stiffness matrix, unknown displacements, known/unknown forces, and member forces.

Uploaded by

Hassaan Zakir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
114 views6 pages

Open Ended Lab of MATLAB (Truss Design by FEM)

The document describes analyzing a truss structure using MATLAB. It involves developing functions to calculate the elemental stiffness matrix, global stiffness matrix, member forces, and unknown displacements and reactions. The truss has 9 elements connecting 6 nodes. The program is run by inputting material properties, node coordinates, applied loads, and constrained displacements. It outputs the global stiffness matrix, unknown displacements, known/unknown forces, and member forces.

Uploaded by

Hassaan Zakir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

COLLEGE OF ENGINEERING AND

TECHNOLOGY, SARGODHA

DEPARTMENT OF CIVIL ENGINEERING

OPEN ENDED LAB


STRUCTURAL ENGINEERING (LAB)
SUBMITTED TO : ENGR. HANZALA AKHLAQ
SUBMITTED BY : TAIMOOR RAZA
ROLL NUMBER : BCEF16E028
OPEN ENDED LAB
Task: The given truss is being on the top of a multi-storey structure to hold the window cleaning deck.
The applied forces on the truss is shown above and, in the notes, below. Due to the differential soil settlement the
joint E settles 25mm downward. Develop the complete MATLAB program to find the reaction and member forces
of the truss.
Note: Replaced 5 KN with my own roll no 28.
Solution: A. First of all, Developed the function
for Elemental stiffness Metrix:

1. Numbered all of the nodes and all of the


elements.
2. Identified the Displacement Degrees of
Freedom in Global Directions.
Number all the structural degrees of freedom in
my truss. In a 2D (planar) truss, each node can have a maximum of two degrees of freedom: one in the
global X-direction and one in the global Y -direction.
3. Node Locations;
Wrote the (x, y) coordinates of each node using units consistent with E and A. In other words, if E and A
are given in KPa and mm2, write the (x, y) coordinates in terms of metres.
4. Define each element;
Drew each element of your truss individually and drew the local coordinates in the global directions. For
example, if element number N is a diagonal truss element, and the global directions are X: horizontal and
Y: vertical;
Drew element number I II III IV V VI VII VIII IX like this:

where (0 0),(3 3),(6 3),(9 3),(6 -2),(3 0) are the joint coordinates of the truss element in the global directions. The local
coordinates are always numbered 1 2 3 4 5 6 7 8 9 10 11 12 with 2 4 6 8 10 and 12 pointing in the global Y direction (up)
and with 1 3 5 7 9 and 11 pointing in the global X direction (to the right). Some or all of these twelve coordinates will line
up with the structural degrees of freedom that I identified in step 2., above. And where 1 2 3 4 5 6 are the nodal identities.

5. Element Stiffness Matrices in Global Coordinates, K.

Element Stiffness Matrices in Global Coordinates, K. For each element, find its (4x4) element stiffness matrix, by
evaluating the equations below:

𝐿 = √ (𝑥2 − 𝑥1 )2 − (𝑦2 − 𝑦1 )2

(𝑥2 − 𝑥1 )
𝑙𝑠 =
𝐿

(𝑦2 − 𝑦1 )
𝑙𝑚 =
𝐿

𝑙𝑠 2 𝑙𝑠𝑙𝑚 −𝑙𝑠 2 −𝑙𝑠𝑙𝑚


𝐸𝐴 𝑙𝑠𝑙𝑚 𝑙𝑚2 −𝑙𝑠𝑙𝑚 −𝑙𝑚2 ]
𝐾= [
𝐿 −𝑙𝑠 2 −𝑙𝑠𝑙𝑚 𝑙𝑠 2 𝑙𝑠𝑙𝑚
−𝑙𝑠𝑙𝑚 −𝑙𝑚2 𝑙𝑠𝑙𝑚 𝑙𝑚2
B. Develop the program for the nodal displacement and reactions.
Once the structure stiffness matrix is formed, the global force components F acting on the truss can then be
related to its global displacements D using
F = KD
This equation is referred to as the structure stiffness equation. Since we have always assigned the lowest code
numbers to identify the unconstrained degrees of freedom, this will allow us now to partition this equation in
the following form:
𝐹k 𝐾11 ⋮ 𝐾12 𝐷𝑢
[⋯] = [ ⋯ ⋯ ⋯ ][ ⋯ ]
𝐹𝑢 𝐾21 ⋮ 𝐾22 𝐷𝑘
Fk, Dk = Known external loads and displacements; the loads here exist on the truss as part of the problem, and
the displacements are generally specified as zero due to support constraints such as pins or rollers.
Fk, Du = Unknown loads and displacements; the loads here represent the unknown support reactions, and the
displacements are at joints where motion is unconstrained in a particular direction.
K= Structure stiffness matrix, which is partitioned to be compatible with the partitioning of F and D.
𝐹𝑘 = 𝐾11 ∗ 𝐷𝑢 + 𝐾12 ∗ 𝐷𝑘
𝐹𝑢 = 𝐾21 ∗ 𝐷𝑢 + 𝐾22 ∗ 𝐷𝑘
Provided this is the case Dk ≠ 0, since the one support is displaced 25 mm in global Y axis . Provided this is
the case,
Fk = 𝑲11 ∗Du+𝑲𝟏𝟐 ∗ 𝑫𝑘
Since the elements in the partitioned matrix K11 and K12 represent the total resistance at a truss joint to a unit
displacement in either the x or y direction, then the above equation symbolizes the collection of all the force
equilibrium equations applied to the joints where the external loads are zero or have a known value Fk. Solving
for Du we have;
Du = [K11]-1*(Fk-𝐊12 ∗ 𝐃k)
From this equation we can obtain a direct solution for all the unknown joint displacements; then using with
Fu = K21*Du + K22*Dk
from which the unknown support reactions can be determined.

C. Develop the program for the member forces:


The member forces can be determined through this relation;
f = k’TD
𝟏
𝑨𝑬 𝟏 −𝟏 𝒍𝒔 𝒍𝒎 𝟎 𝟎 𝟐
f1 = 𝑳 [ ][ ][ ]
−𝟏 𝟏 𝟎 𝟎 𝒍𝒔 𝒍𝒎 𝟑
𝟒
f1, f2 , f3 , f4, f5,f6, f7, f8 and f9 are determined.

MATLAB Code:
function k=TaimoorrazaOEL(E,A,cord)
x1=cord([1],[1]);
x2=cord([2],[1]);
y1=cord([1],[2]);
y2=cord([2],[2]);
L=sqrt((x2-x1)^2+(y2-y1)^2);
i=E*A/L;
ls=(x2-x1)/L;
lm=(y2-y1)/L;
k=i*[ls^2,ls*lm,-ls^2,-ls*lm;ls*lm,lm^2,-ls*lm,-lm^2;-ls^2,-ls*lm,ls^2,ls*lm;-ls*lm,-
lm^2,ls*lm,lm^2]

function [Du,Fu]=taimoorrazaa(K1,F,KDOF,KLDOF)
A=size(F);
ULDOF=setdiff(1:A,KLDOF);
Fk=F(ULDOF,:);
K11=K1(ULDOF,ULDOF);
K12=K1(ULDOF,KLDOF)
K21=K1(KLDOF,ULDOF);
K22=K1(KLDOF,KLDOF);
X=K12*KDOF;
Du=(inv(K11))*(Fk-X);
Fk=(K11*Du)+(K12*KDOF);
Fu=(K21*Du)+(K22*KDOF);

function U=TaimoorrazaOELmb(E,A,cord)
x1=cord([1],[1]);
x2=cord([2],[1]);
y1=cord([1],[2]);
y2=cord([2],[2]);
L=sqrt((x2-x1)^2+(y2-y1)^2);
b=E*A/L;
ls=(x2-x1)/L;
lm=(y2-y1)/L;
U=(E*A/L)*([1 -1;-1 1])*([ls lm 0 0;0 0 ls lm]);
--------------------------------------------------------------------------------------------------------------------
-----------------------
E=1000
A=1e-6
element=9;
K1=zeros(12,12);
cord=[0 0;3 3;6 3;9 3;6 -2;3 0];
lmm=[1 2 3 4;3 4 5 6;5 6 7 8;7 8 9 10;1 2 9 10;1 2 11 12;3 4 11 12;5 6 11 12;5 6 9 10];
conn=[1,2;2,3;3,4;4,5;1,5;1,6;2,6;3,6;3,5];
for i=1:element
con=conn(i,:);
coord=cord(con,:);
[K]=TaimoorrazaOEL(E,A,coord);
lm=lmm(i,:);
K1(lm,lm)=K1(lm,lm)+K
end
F=zeros(12,1);
F([4])=-4;
F([2])=-28;
KLDOF=[7;8;10];
KDOF=[0;0;-0.025];
[Du,Fu,Fk]=taimoorrazaa(K1,F,KDOF,KLDOF)
D=zeros(12,1);
B=size(D);
ULDOF=setdiff(1:B,KLDOF);
D(KLDOF,1)=KDOF;
D(ULDOF,1)=Du;
for i=1:element
con=conn(i,:);
coord=cord(con,:);
U=TaimoorrazaOELmb(E,A,cord);
lm=lmm(i,:);
MF=U*D(lm)
End
RESULTS:
Global Stiffness Matrix=K1

Unknown Displacements = Du
Known Forces = Fk
Unknown Forces = Fu

Member Forces = MF

You might also like