You are on page 1of 2

clear

clc
% First bar element
% Transformation matrix
phi = 150*pi/180;
s = sin(phi);
c = cos(phi);
T_1 = [
-s
0
0
%
E
A
L

c s
c 0
0 c
0 -s

0 0;
0;
s;
c];

Compute element matrix in global coordinates


= 200000*10^6;
= 0.005;
= 3/sin(phi);

kloc = E*A/L*[ 1
0
-1
0

0
0
0
0

-1
0
1
0

0;
0;
0;
0];

kglob_1 = T_1'*kloc*T_1
% Second bar element
% Transformation matrix
phi = 45*pi/180;
s = sin(phi);
c = cos(phi);
T_2 = [
-s
0
0
%
E
A
L

c s
c 0
0 c
0 -s

0 0;
0;
s;
c];

Compute element matrix in global coordinates


= 200000*10^6;
= 0.003;
= 3/sin(phi);

kloc = E*A/L*[ 1
0
-1
0

0
0
0
0

-1
0
1
0

0;
0;
0;
0];

kglob_2 = T_2'*kloc*T_2;
% Evaluate stiffness relation and compute displacement
f_ext = 1000*10^3 * 0.5;
u_x2 = f_ext/(kglob_1(1,1) + kglob_2(1,1));
% Augment
kaug_1(1:2,1:2) = kglob_1(3:4,3:4);
kaug_1(3:4,3:4) = kglob_1(1:2,1:2);

kaug_1(1:2,3:4) = kglob_1(1:2,3:4);
kaug_1(3:4,1:2) = kglob_1(3:4,1:2);
kaug_1(5:6,5:6) = zeros(2);
kaug_1;
kaug_2(3:6,3:6) = kglob_2;
BIGK = kaug_1 + kaug_2;
u = zeros(6,1);
u(3) = f_ext/BIGK(3,3);
% Find complete external force vector
f_ext = BIGK*u;
% Find internal forces for element 1
% Identify suitable elements of the global displacement vector
uglob_1 = zeros(4,1);
uglob_1(1:2) = u(3:4);
uglob_1(3:4) = u(1:2)
uloc_1 = T_1*uglob_1
E = 200000*10^6;
A = 0.005;
L = 3/sin(phi);
Fint1 = E*A/L *(uloc_1(3)-uloc_1(1))

You might also like