Global Stiffness Matrix 8×8
% Declaring all the variables
E1 = 200e9; % Young’s modulus for elements 1 and 2 in Pa
A1 = 0.000006; % Cross-sectional area for elements 1 and 2 in m^2
E3 = 200e9; % Young’s modulus for element 3 in Pa
A3 = 0.000006; % Cross-sectional area for element 3 in m^2
L = 0.5; % Length of each element in m
F = 5000; % Applied force at node 2 in N
disp(‘E1(Pa) = ‘),disp(E1);
disp(‘E3(Pa) = ‘),disp(E3);
disp(‘A1(m^2) = ‘),disp(A1);
disp(‘A3(m^2) = ‘),disp(A3);
disp(‘L(m) = ‘),disp(L);
disp(‘θ(°) = 5 ‘);
C=cos(5*pi/180);
S=sin(5*pi/180);
disp(‘ Local Stiffness Matrixs :’)
k1=E1*A1*[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]/0.25
k2=E1*A1*[0 0 0 0
0 1 0 -1
0 0 0 0
0 -1 0 1]/0.0218
k3=E3*A3*[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]/0.25
disp(‘ Global Stiffness Matrix :’)
K=[k1(1,1) k1(1,2) k1(1,3) k1(1,4) 0 0 0 0
k1(2,1) k1(2,2) k1(2,3) k1(2,4) 0 0 0 0
k1(3,1) k1(3,2) k1(3,3)+k2(1,1) k1(3,4)+k2(1,2) k2(1,3) k2(1,4) 0 0
k1(4,1) k1(4,2) k1(4,3)+k2(2,1) k1(4,4)+k2(2,2) k2(2,3) k2(2,4) 0 0
0 0 k2(3,1) k2(3,2) k2(3,3)+k3(1,1) k2(3,4)+k3(1,2) k3(1,3) k3(1,4)
0 0 k2(4,1) k2(4,2) k2(4,3)+k3(2,1) k2(4,4)+k3(2,2) k3(2,3) k3(2,4)
0 0 0 0 k3(3,1) k3(3,2) k3(3,3) k3(3,4)
0 0 0 0 k3(4,1) k3(4,2) k3(4,3) k3(4,4) ]
disp(‘ Transformation matrix :’)
T= [ C S 0 0 0 0 0 0
-S C 0 0 0 0 0 0
0 0 C S 0 0 0 0
0 0 -S C 0 0 0 0
0 0 0 0 C S 0 0
0 0 0 0 -S C 0 0
0 0 0 0 0 0 C S
0 0 0 0 0 0 -S C ]
disp(‘ Inverse of Transformation matrix :’)
TT= inv(T)
disp(‘ [T][K][TT] :’)
M=T*K*TT
disp(‘ Applying the boundary condition’)
U1=0
V1=0
U3=0
V3=0
V4=0
disp(‘Force at node 2 :’);
Fx2=[0,5000];
IK=[M(3,3), M(5,3); M(5,3), M(5,5)];
sol=Fx2/IK;
disp (5000);
disp(‘Displacement of node 2 and 3 at local coordinate(m) (0°):’);
U2=sol(1);
U3=sol(2);
t=[C,S;-S,C];
u=[U2; U3];
disp(‘d2x = ‘),disp(U2);
disp(‘d3x = ‘),disp(U3);
disp(‘Displacement of node 2 and 3 at Global coordinate(m) (5°):’);
t=[C,S;-S,C];
u=[U2; U3];
solu=tu;
u2=solu(1);
u3=solu(2);
disp(‘d2x = ‘),disp(u2);
disp(‘d3x = ‘),disp(u3);
I don’t know if the Global Stiffness Matrix arrangement is correct can someone help me?% Declaring all the variables
E1 = 200e9; % Young’s modulus for elements 1 and 2 in Pa
A1 = 0.000006; % Cross-sectional area for elements 1 and 2 in m^2
E3 = 200e9; % Young’s modulus for element 3 in Pa
A3 = 0.000006; % Cross-sectional area for element 3 in m^2
L = 0.5; % Length of each element in m
F = 5000; % Applied force at node 2 in N
disp(‘E1(Pa) = ‘),disp(E1);
disp(‘E3(Pa) = ‘),disp(E3);
disp(‘A1(m^2) = ‘),disp(A1);
disp(‘A3(m^2) = ‘),disp(A3);
disp(‘L(m) = ‘),disp(L);
disp(‘θ(°) = 5 ‘);
C=cos(5*pi/180);
S=sin(5*pi/180);
disp(‘ Local Stiffness Matrixs :’)
k1=E1*A1*[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]/0.25
k2=E1*A1*[0 0 0 0
0 1 0 -1
0 0 0 0
0 -1 0 1]/0.0218
k3=E3*A3*[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]/0.25
disp(‘ Global Stiffness Matrix :’)
K=[k1(1,1) k1(1,2) k1(1,3) k1(1,4) 0 0 0 0
k1(2,1) k1(2,2) k1(2,3) k1(2,4) 0 0 0 0
k1(3,1) k1(3,2) k1(3,3)+k2(1,1) k1(3,4)+k2(1,2) k2(1,3) k2(1,4) 0 0
k1(4,1) k1(4,2) k1(4,3)+k2(2,1) k1(4,4)+k2(2,2) k2(2,3) k2(2,4) 0 0
0 0 k2(3,1) k2(3,2) k2(3,3)+k3(1,1) k2(3,4)+k3(1,2) k3(1,3) k3(1,4)
0 0 k2(4,1) k2(4,2) k2(4,3)+k3(2,1) k2(4,4)+k3(2,2) k3(2,3) k3(2,4)
0 0 0 0 k3(3,1) k3(3,2) k3(3,3) k3(3,4)
0 0 0 0 k3(4,1) k3(4,2) k3(4,3) k3(4,4) ]
disp(‘ Transformation matrix :’)
T= [ C S 0 0 0 0 0 0
-S C 0 0 0 0 0 0
0 0 C S 0 0 0 0
0 0 -S C 0 0 0 0
0 0 0 0 C S 0 0
0 0 0 0 -S C 0 0
0 0 0 0 0 0 C S
0 0 0 0 0 0 -S C ]
disp(‘ Inverse of Transformation matrix :’)
TT= inv(T)
disp(‘ [T][K][TT] :’)
M=T*K*TT
disp(‘ Applying the boundary condition’)
U1=0
V1=0
U3=0
V3=0
V4=0
disp(‘Force at node 2 :’);
Fx2=[0,5000];
IK=[M(3,3), M(5,3); M(5,3), M(5,5)];
sol=Fx2/IK;
disp (5000);
disp(‘Displacement of node 2 and 3 at local coordinate(m) (0°):’);
U2=sol(1);
U3=sol(2);
t=[C,S;-S,C];
u=[U2; U3];
disp(‘d2x = ‘),disp(U2);
disp(‘d3x = ‘),disp(U3);
disp(‘Displacement of node 2 and 3 at Global coordinate(m) (5°):’);
t=[C,S;-S,C];
u=[U2; U3];
solu=tu;
u2=solu(1);
u3=solu(2);
disp(‘d2x = ‘),disp(u2);
disp(‘d3x = ‘),disp(u3);
I don’t know if the Global Stiffness Matrix arrangement is correct can someone help me? % Declaring all the variables
E1 = 200e9; % Young’s modulus for elements 1 and 2 in Pa
A1 = 0.000006; % Cross-sectional area for elements 1 and 2 in m^2
E3 = 200e9; % Young’s modulus for element 3 in Pa
A3 = 0.000006; % Cross-sectional area for element 3 in m^2
L = 0.5; % Length of each element in m
F = 5000; % Applied force at node 2 in N
disp(‘E1(Pa) = ‘),disp(E1);
disp(‘E3(Pa) = ‘),disp(E3);
disp(‘A1(m^2) = ‘),disp(A1);
disp(‘A3(m^2) = ‘),disp(A3);
disp(‘L(m) = ‘),disp(L);
disp(‘θ(°) = 5 ‘);
C=cos(5*pi/180);
S=sin(5*pi/180);
disp(‘ Local Stiffness Matrixs :’)
k1=E1*A1*[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]/0.25
k2=E1*A1*[0 0 0 0
0 1 0 -1
0 0 0 0
0 -1 0 1]/0.0218
k3=E3*A3*[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]/0.25
disp(‘ Global Stiffness Matrix :’)
K=[k1(1,1) k1(1,2) k1(1,3) k1(1,4) 0 0 0 0
k1(2,1) k1(2,2) k1(2,3) k1(2,4) 0 0 0 0
k1(3,1) k1(3,2) k1(3,3)+k2(1,1) k1(3,4)+k2(1,2) k2(1,3) k2(1,4) 0 0
k1(4,1) k1(4,2) k1(4,3)+k2(2,1) k1(4,4)+k2(2,2) k2(2,3) k2(2,4) 0 0
0 0 k2(3,1) k2(3,2) k2(3,3)+k3(1,1) k2(3,4)+k3(1,2) k3(1,3) k3(1,4)
0 0 k2(4,1) k2(4,2) k2(4,3)+k3(2,1) k2(4,4)+k3(2,2) k3(2,3) k3(2,4)
0 0 0 0 k3(3,1) k3(3,2) k3(3,3) k3(3,4)
0 0 0 0 k3(4,1) k3(4,2) k3(4,3) k3(4,4) ]
disp(‘ Transformation matrix :’)
T= [ C S 0 0 0 0 0 0
-S C 0 0 0 0 0 0
0 0 C S 0 0 0 0
0 0 -S C 0 0 0 0
0 0 0 0 C S 0 0
0 0 0 0 -S C 0 0
0 0 0 0 0 0 C S
0 0 0 0 0 0 -S C ]
disp(‘ Inverse of Transformation matrix :’)
TT= inv(T)
disp(‘ [T][K][TT] :’)
M=T*K*TT
disp(‘ Applying the boundary condition’)
U1=0
V1=0
U3=0
V3=0
V4=0
disp(‘Force at node 2 :’);
Fx2=[0,5000];
IK=[M(3,3), M(5,3); M(5,3), M(5,5)];
sol=Fx2/IK;
disp (5000);
disp(‘Displacement of node 2 and 3 at local coordinate(m) (0°):’);
U2=sol(1);
U3=sol(2);
t=[C,S;-S,C];
u=[U2; U3];
disp(‘d2x = ‘),disp(U2);
disp(‘d3x = ‘),disp(U3);
disp(‘Displacement of node 2 and 3 at Global coordinate(m) (5°):’);
t=[C,S;-S,C];
u=[U2; U3];
solu=tu;
u2=solu(1);
u3=solu(2);
disp(‘d2x = ‘),disp(u2);
disp(‘d3x = ‘),disp(u3);
I don’t know if the Global Stiffness Matrix arrangement is correct can someone help me? stiffness matrix MATLAB Answers — New Questions