0% found this document useful (0 votes)
62 views13 pages

Solution #2

The document contains 5 problems involving calculating the global stiffness matrix and other properties for bar elements. The problems are solved using MATLAB code that defines element stiffness matrices in local coordinates, applies transformation matrices, assembles the global stiffness matrix, applies boundary conditions, and calculates displacements, strains, stresses, and reactions.

Uploaded by

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

Solution #2

The document contains 5 problems involving calculating the global stiffness matrix and other properties for bar elements. The problems are solved using MATLAB code that defines element stiffness matrices in local coordinates, applies transformation matrices, assembles the global stiffness matrix, applies boundary conditions, and calculates displacements, strains, stresses, and reactions.

Uploaded by

tanyac2043
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Problem #1

Find the global stiffness matrix in the following bar elements.

Problem Matlab Solution


A=1;
E=15e6;
L=15;
tet=2*pi/3;

ke=(A*E/L)*[1 -1;-1 1];

lam=[cos(tet) sin(tet) 0
0;0 0 cos(tet) sin(tet)];

kb=transpose(lam)*ke*lam

Final Answer
Problem Matlab Solution
A=2e-4;
E=70e9;
L=1;
tet=-pi/9;

ke=(A*E/L)*[1 -1;-1 1];

lam=[cos(tet) sin(tet) 0
0;0 0 cos(tet) sin(tet)];

kb=transpose(lam)*ke*lam

Final Answer
Problem #2

Problem Matlab Solution

tet=pi/6;

lam=[cos(tet) sin(tet) 0
0;0 0 cos(tet) sin(tet)];

u=lam*[0.5;0;0.25;0.75]

Final Answer
Problem #3

Solution
Matlab Solution

clear all
clc
format long

A=2.3;
E=10e6;
L=3*12;

% Angles of orientation
tet1=pi/3;
tet2=2*pi/3;

% Stiffness Matrix in Local Coordinate System


ke=(A*E/L)*[1 -1;-1 1];

% Transformation Matrices
lam1=[cos(tet1) sin(tet1) 0 0;0 0 cos(tet1) sin(tet1)];
lam2=[cos(tet2) sin(tet2) 0 0;0 0 cos(tet2) sin(tet2)];

% Stiffness Matrix in Global Coordinate System


kb1=transpose(lam1)*ke*lam1;
kb2=transpose(lam2)*ke*lam2;

% Assembly Matrices
ae1=[1 0 0 0 0 0 ;0 1 0 0 0 0 ;0 0 0 0 1 0;0 0 0 0 0
1];
ae2=[0 0 1 0 0 0 ;0 0 0 1 0 0 ;0 0 0 0 1 0;0 0 0 0 0
1];

% Assembling Matrices
kh1=transpose(ae1)*kb1*ae1;
kh2=transpose(ae2)*kb2*ae2;

k=kh1+kh2;

kbefore=k;

% Applying Boundary Condition


k([1,2,3,4],:)=[];
k(:,[1,2,3,4])=[];

% Force Vector
fb=[0;-200];

inv(k)*fb

% Local Nodal Displacements

u1=lam1*[0;0;0;-0.000208695652173913];
u2=lam2*[0;0;0;-0.000208695652173913];

% Strain

strain1=(-0.000180735736441970-0)/L;
strain2=(-0.000180735736441970-0)/L;

% Stress

Stress1=E*strain1;
Stress2=E*strain2;

% Reaction Force

R=kbefore*[0;0;0;0;0;-0.000208695652173913]-
[0;0;0;0;0;-200]
Problem #4
Matlab Solution

clear all
clc
format long

A=0.0008;
E=200e9;
L1=1;
L2=1.25;
L3=1.6;

% Angles of orientation
tet1=0;
tet2=0;
tet3=-0.8905;
tet4=-pi/2;
tet5=4.0376;

% Stiffness Matrix in Local Coordinate System


ke1=(A*E/L1)*[1 -1;-1 1];
ke2=(A*E/L2)*[1 -1;-1 1];
ke3=(A*E/L3)*[1 -1;-1 1];

% Transformation Matrices
lam1=[cos(tet1) sin(tet1) 0 0;0 0 cos(tet1) sin(tet1)];
lam2=[cos(tet2) sin(tet2) 0 0;0 0 cos(tet2) sin(tet2)];
lam3=[cos(tet3) sin(tet3) 0 0;0 0 cos(tet3) sin(tet3)];
lam4=[cos(tet4) sin(tet4) 0 0;0 0 cos(tet4) sin(tet4)];
lam5=[cos(tet5) sin(tet5) 0 0;0 0 cos(tet5) sin(tet5)];

% Stiffness Matrix in Global Coordinate System


kb1=transpose(lam1)*ke1*lam1;
kb2=transpose(lam2)*ke1*lam2;
kb3=transpose(lam3)*ke3*lam3;
kb4=transpose(lam4)*ke2*lam4;
kb5=transpose(lam5)*ke3*lam5;

% Assembly Matrices
ae1=[1 0 0 0 0 0 0 0;0 1 0 0 0 0 0 0 ;0 0 1 0 0 0 0 0;0
0 0 1 0 0 0 0];
ae2=[0 0 1 0 0 0 0 0;0 0 0 1 0 0 0 0 ;0 0 0 0 1 0 0 0;0
0 0 0 0 1 0 0];
ae3=[1 0 0 0 0 0 0 0;0 1 0 0 0 0 0 0 ;0 0 0 0 0 0 1 0;0
0 0 0 0 0 0 1];
ae4=[0 0 1 0 0 0 0 0;0 0 0 1 0 0 0 0 ;0 0 0 0 0 0 1 0;0
0 0 0 0 0 0 1];
ae5=[0 0 0 0 1 0 0 0;0 0 0 0 0 1 0 0 ;0 0 0 0 0 0 1 0;0
0 0 0 0 0 0 1];

% Assembling Matrices
kh1=transpose(ae1)*kb1*ae1;
kh2=transpose(ae2)*kb2*ae2;
kh3=transpose(ae3)*kb3*ae3;
kh4=transpose(ae4)*kb4*ae4;
kh5=transpose(ae5)*kb5*ae5;

k=kh1+kh2+kh3+kh4+kh5;
kbefore=k;

% Applying Boundary Condition


k([1,2,5,6],:)=[];
k(:,[1,2,5,6])=[];

% Force Vector
fb=[-2000*sin(15*pi/180);-2000*cos(15*pi/180);-
2000*sin(15*pi/180);-2000*cos(15*pi/180)];

inv(k)*fb

% % Local Nodal Displacements

u1=lam1*[0;0;-0.0000016176190318908;-
0.0000469242373240418];
u2=lam2*[-0.0000016176190318908;-
0.0000469242373240418;0;0];
u3=lam3*[0;0;-0.0000066337928926877;-
0.0000318316462882751];
u4=lam4*[-0.0000016176190318908;-
0.0000469242373240418;-0.0000066337928926877;-
0.0000318316462882751];
u3=lam3*[0;0;-0.0000066337928926877;-
0.0000318316462882751];
% % Reaction Force in Support

R=kbefore*[0;0;-0.0000016176190318908;-
0.0000469242373240418;0;0;-0.0000066337928926877;-
0.0000318316462882751]-[0;0;-2000*sin(15*pi/180);-
2000*cos(15*pi/180);0;0;-2000*sin(15*pi/180);-
2000*cos(15*pi/180)]
Problem #5

Find displacement of node 1 and normal stress components in each member.

Matlab Solution
clear all
clc
format long

A=1;
E=10e6;
L1=100/cos(pi/3);
L2=100;
L3=100/cos(pi/6);

% Angles of orientation
tet1=2*pi/3;
tet2=pi;
tet3=7*pi/6;

% Stiffness Matrix in Local Coordinate System


ke1=(A*E/L1)*[1 -1;-1 1];
ke2=(A*E/L2)*[1 -1;-1 1];
ke3=(A*E/L3)*[1 -1;-1 1];

% Transformation Matrices
lam1=[cos(tet1) sin(tet1) 0 0;0 0 cos(tet1) sin(tet1)];
lam2=[cos(tet2) sin(tet2) 0 0;0 0 cos(tet2) sin(tet2)];
lam3=[cos(tet3) sin(tet3) 0 0;0 0 cos(tet3) sin(tet3)];

% Stiffness Matrix in Global Coordinate System


kb1=transpose(lam1)*ke1*lam1;
kb2=transpose(lam2)*ke2*lam2;
kb3=transpose(lam3)*ke3*lam3;

% Assembly Matrices
ae1=[1 0 0 0 0 0 0 0;0 1 0 0 0 0 0 0 ;0 0 1 0 0 0 0 0;0
0 0 1 0 0 0 0];
ae2=[1 0 0 0 0 0 0 0;0 1 0 0 0 0 0 0 ;0 0 0 0 1 0 0 0;0
0 0 0 0 1 0 0];
ae3=[1 0 0 0 0 0 0 0;0 1 0 0 0 0 0 0 ;0 0 0 0 0 0 1 0;0
0 0 0 0 0 0 1];

% Assembling Matrices
kh1=transpose(ae1)*kb1*ae1;
kh2=transpose(ae2)*kb2*ae2;
kh3=transpose(ae3)*kb3*ae3;

k=kh1+kh2+kh3;
kbefore=k;

% Applying Boundary Condition


k([3,4,5,6,7,8],:)=[];
k(:,[3,4,5,6,7,8])=[];
% Force Vector
fb=[1000;1000];

inv(k)*fb

% % % Local Nodal Displacements

u1=lam1*[0.004226497308104;0.015773502691896;0;0];
u2=lam2*[0.004226497308104;0.015773502691896;0;0];
u3=lam3*[0.004226497308104;0.015773502691896;0;0];

% % % Reaction Force in Support

R=kbefore*[0.004226497308104;0.015773502691896;0;0;0;0;
0;0]-[1000;1000;0;0;0;0;0;0]

You might also like