Professional Documents
Culture Documents
Assignment No.2
Title: Computer program for stress analysis of 2-D truss subjected to plane forces.
Aim: To perform displacement and stress analysis for the given 2D truss using MATLAB and
analytical expressions.
Problem Description:
For the Truss shown in Figure No.1 find the displacement of nodes, support reactions and
elemental stresses. Assume young modulus for truss material, E=210GPa and cross section
of each member is, A= 10*10^4 mm2. Also, solve the above truss problem using ANSYS to
validate the results.
`
Figure 1.1: 2D truss
Node Nos. x-coordinate (m) Y-coordinate (m)
1 0 0
2 1500 0
3 3000 0
4 2250 1250
5 750 1250
E = 210*10^3;
A = 10*10^4;
L1 = ElementLength(0,0,1500,0)
L2 = ElementLength(1500,0,3000,0)
L3 = ElementLength(3000,0,2250,1250)
L4 = ElementLength(2250,1250,1500,0)
L5 = ElementLength(2250,1250,750,1250)
L6 = ElementLength(750,1250,1500,0)
L7 = ElementLength(750,1250,0,0)
theta1 = 0;
theta2 = 0;
theta3 = pi-tan(1250/750);
theta4 = tan(1250/750);
theta5 = 0;
theta6 = pi -tan(1250/750);
theta7 = tan(1250/750);
kk1=zeros(10,10);
kk2=zeros(10,10);
kk3=zeros(10,10);
kk4=zeros(10,10);
kk5=zeros(10,10);
kk6=zeros(10,10);
kk7=zeros(10,10);
x=1;
kk1=make10by10(x,K1);
x=2;
kk2=make10by10(x,K2);
x=3;
kk3=make10by10(x,K3);
x=4;
kk4=make10by10(x,K4);
x=5;
kk5=make10by10(x,K5);
x=6;
kk6=make10by10(x,K6);
x=7;
kk7=make10by10(x,K7);
Kg=kk1+kk2+kk3+kk4+kk5+kk6+kk7
% Boundary Conditions
Kr=[Kg(3,3) Kg(3,4) Kg(3,5) Kg(3,7) Kg(3,8) Kg(3,9) Kg(3,10);
Kg(4,3) Kg(4,4) Kg(4,5) Kg(4,7) Kg(4,8) Kg(4,9) Kg(4,10);
Kg(5,3) Kg(5,4) Kg(5,5) Kg(5,7) Kg(5,8) Kg(5,9) Kg(5,10);
Kg(7,3) Kg(7,4) Kg(7,5) Kg(7,7) Kg(7,8) Kg(7,9) Kg(7,10);
Kg(8,3) Kg(8,4) Kg(8,5) Kg(8,7) Kg(8,8) Kg(8,9) Kg(8,10);
Kg(9,3) Kg(9,4) Kg(9,5) Kg(9,7) Kg(9,8) Kg(9,9) Kg(9,10);
Kg(10,3) Kg(10,4) Kg(10,5) Kg(10,7) Kg(10,8) Kg(10,9) Kg(10,10)]
%Force Vector
F=[0;-8000;0;0;-5000;0;-10000];
%Displacement Vector
u=Kr\F
%Support Reaction
F=Kg*U
%Local Displacement Vectors
u1=U(1:4);
u2=U(3:6);
u3=U(5:8);
u4=[U(3,1);U(4,1);U(7,1);U(8,1)];
u5=U(7:10);
u6=[U(3,1);U(4,1);U(9,1);U(10,1)];
u7=[U(1,1);U(2,1);U(9,1);U(10,1)];
%Element Stresses
sigma1=ElementStress(E,L1,theta1,u1)
sigma2=ElementStress(E,L2,theta2,u2)
sigma3=ElementStress(E,L3,theta3,u3)
sigma4=ElementStress(E,L3,theta4,u4)
sigma5=ElementStress(E,L4,theta5,u5)
sigma6=ElementStress(E,L5,theta6,u6)
sigma7=ElementStress(E,L7,theta7,u7)
%Functions%
1. Element length
function [y] = ElementLength(x1,y1,x2,y2)
y = sqrt((x2-x1)^2+(y2-y1)^2);
end
2. Element stiffness
function [y] = ElementStiffness(E,A,L,theta)
c = cos(theta);
s = sin(theta);
y = ((E*A)/L)*[c*c c*s -c*c -c*s; c*s s*s -c*s -s*s; -c*c -c*s c*c c*s; -c*s -s*s c*s s*s];
end
3. Makek10by10
function [y] = make10by10(x,K)
if (x==1)
i=1;j=2;m=3;n=4;
else
if (x==2)
i=3;j=4;m=5;n=6;
else
if (x==3)
i=5;j=6;m=7;n=8;
else
if (x==4)
i=3;j=4;m=7;n=8;
else
if (x==5)
i=7;j=8;m=9;n=10;
else
if (x==6)
i=3;j=4;m=9;n=10;
else
i=1;j=2;m=9;n=10;
end
end
end
end
end
end
kk=zeros(10,10);
kk(i,i)=K(1,1);
kk(i,j)=K(1,2);
kk(i,m)=K(1,3);
kk(i,n)=K(1,4);
kk(j,i)=K(2,1);
kk(j,j)=K(2,2);
kk(j,m)=K(2,3);
kk(j,n)=K(2,4);
kk(m,i)=K(3,1);
kk(m,j)=K(3,2);
kk(m,m)=K(3,3);
kk(m,n)=K(3,4);
kk(n,i)=K(4,1);
kk(n,j)=K(4,2);
kk(n,m)=K(4,3);
kk(n,n)=K(4,4);
y=kk;
end
4. Element Stress
function [y] = ElementStress(E,L,theta,u)
C=cos(theta);
S=sin(theta);
y=(E/L)*[-C -S C S]*u;
end
OUTPUT
E = 2.1000e+11
A = 1.0000e-03
L1 = 1500
L2 = 1500
L3 = 1.4577e+03
L4 = 1.4577e+03
L5 = 1500
L6 = 1.4577e+03
L7 = 1.4577e+03
K1 =
14000000 0 -14000000 0
0 0 0 0
-14000000 0 14000000 0
0 0 0 0
K2 =
14000000 0 -14000000 0
0 0 0 0
-14000000 0 14000000 0
0 0 0 0
K3 = 1.0e+06 *
K4 = 1.0e+06 *
K5 =
14000000 0 -14000000 0
0 0 0 0
-14000000 0 14000000 0
0 0 0 0
K6 = 1.0e+06 *
K7 = 1.0e+06 *
Kg = 1.0e+07 *
Kr = 1.0e+07 *
u=
-0.0006
-0.0025
-0.0011
-0.0002
-0.0017
-0.0010
-0.0019
U=
-0.0006
-0.0025
-0.0011
-0.0002
-0.0017
-0.0010
-0.0019
F = 1.0e+04 *
-0.0000
1.2750
0.0000
-0.8000
1.0250
-0.5000
0.0000
-1.0000
sigma1 = -0.0866
sigma2 = -0.0696
sigma3 = -0.1239
sigma4 = 0.0635
sigma5 = -0.1084
sigma6 = 0.0323
sigma7 = -0.1541
ANSYS REPORT
1. Modeling:-
a. Generation of Key points:
Preprocessor>Modeling>Create>Key points>In active CS.
Sr.No. Key point No. Co-ordinates (x,y)
1 1 (0,0)
2 2 (1500,0)
3 3 (3000,0)
4 4 (2250,1250)
5 5 (750,1250)
b. Create Lines:
Preprocessor>Modeling>Create>Lines>Straight Line>In active CS.
5. Meshing:
Preprocessor>Meshing>Mesh>Line>Select the Lines>Mesh>OK.
1
ELEMENTS
MAR 14 2018
10:43:40
Y
Z X
B) Solver:-In this step the solution type and loads are defined.
1
E-N
U
F
MAR 14 2018
09:44:47
Y
Z X
C)Post processing:-In the post processing step the Deflection and stress plot are taken
and also the reaction values are taken.
THE FOLLOWING DEGREE OF FREEDOM RESULTS ARE IN THE GLOBAL COORDINATE SYSTEM
NODE UX UY UZ USUM
1 0.0000 0.0000 0.0000 0.0000
2 0.54643E-03-0.21576E-02 0.0000 0.22257E-02
3 0.98571E-03 0.0000 0.0000 0.98571E-03
4 0.18750E-03-0.14466E-02 0.0000 0.14587E-02
5 0.85179E-03-0.17147E-02 0.0000 0.19147E-02
MAXIMUM ABSOLUTE VALUES
NODE 3 2 0 2
VALUE 0.98571E-03-0.21576E-02 0.0000 0.22257E-02
b. Support Reactions:
NODE FX FY FZ
1 -0.18190E-11 12750. 0.0000
3 10250.
TOTAL VALUES
VALUE -0.18190E-11 23000. 0.0000
c. Elemental stresses:
PRINT ELEMENT TABLE ITEMS PER ELEMENT
STAT CURRENT
ELEM LS1
1 0.76500E-01
2 0.61500E-01
3 -0.11953
4 0.61225E-01
5 -0.93000E-01
6 0.32070E-01
7 -0.14869
MINIMUM VALUES
ELEM 7
VALUE -0.14869
MAXIMUM VALUES
ELEM 1
VALUE 0.76500E-01
Conclusion:-
Support Reaction Rx Ry Rx Ry
Node 1 0 12750 -0.18190E-11 12750
Node 3 0 10250 0 10250