Sie sind auf Seite 1von 4

CODE:-

close all
clear all
clc

syms P real;

%Length of elements
L1=1.0;
L2=1.0;
L3=1.0;

Width=0.2;
Thickness=0.005;
Modulus=200e3; %Steel (MPa)

Imoment=Width*Thickness*Thickness*Thickness/12;

%Local stiffness matrices


L=L1;
K1= ((Modulus*Imoment)/L^3)*[12 6*L -12 6*L;
6*L 4*L*L -6*L 2*L*L;
-12 -6*L 12 -6*L;
6*L 2*L*L -6*L 4*L*L];

L=L2;
K2= ((Modulus*Imoment)/L^3)*[12 6*L -12 6*L;
6*L 4*L*L -6*L 2*L*L;
-12 -6*L 12 -6*L;
6*L 2*L*L -6*L 4*L*L];

L=L3;
K3= ((Modulus*Imoment)/L^3)*[12 6*L -12 6*L;
6*L 4*L*L -6*L 2*L*L;
-12 -6*L 12 -6*L;
6*L 2*L*L -6*L 4*L*L];

%Assemblage matrix
KA= zeros(8,8); % Defining a null stiffness assemblage matrix
for i=1:2
for j=1:2
KA(i,j) = K1(i,j);
KA(i,j+2) = K1(i,j+2);
KA(i+2,j) = K1(i+2,j);
KA(i+2,j+2) = K1(i+2,j+2) + K2(i,j);
KA(i+2,j+4) = K2(i,j+2);

KA(i+4,j+2) = K2(i+2,j);
KA(i+4,j+4) = K2(i+2,j+2) + K3(i,j);
KA(i+4,j+6) = K3(i,j+2);

KA(i+6,j+4) = K3(i+2,j);
KA(i+6,j+6) = K3(i+2,j+2);
end
end
KA(8,8) = KA(8,8)
% BC's, loading and solution, Method 3
[~,nd] = size(KA);

% Initial list of degree of freedom


dof = (1:nd)';

% Degree of freedom to be removed due to BC's


bc = [1,7];
dof(bc) = [];

% K contains only the desired degree of freedom


K = KA(dof,dof)
F3 = [0 -P 0 -P 0 0];

F3 = F3'
U3 = vpa([K\F3],4)

K1 = inv(K)
U1 = vpa([K1*F3],4)

% Verfification of result
UA = vpa([0;U3(1,1);U3(2,1);U3(3,1);U3(4,1);U3(5,1);0;U3(6,1)],4)
FA = vpa(KA*UA,4)

RESULT

KA =

0.0050 0.0025 -0.0050 0.0025 0 0 0 0


0.0025 0.0017 -0.0025 0.0008 0 0 0 0
-0.0050 -0.0025 0.0100 0 -0.0050 0.0025 0 0
0.0025 0.0008 0 0.0033 -0.0025 0.0008 0 0
0 0 -0.0050 -0.0025 0.0100 0 -0.0050 0.0025
0 0 0.0025 0.0008 0 0.0033 -0.0025 0.0008
0 0 0 0 -0.0050 -0.0025 0.0050 -0.0025
0 0 0 0 0.0025 0.0008 -0.0025 0.0017

K =

0.0017 -0.0025 0.0008 0 0 0


-0.0025 0.0100 0 -0.0050 0.0025 0
0.0008 0 0.0033 -0.0025 0.0008 0
0 -0.0050 -0.0025 0.0100 0 0.0025
0 0.0025 0.0008 0 0.0033 0.0008
0 0 0 0.0025 0.0008 0.0017

F3 =
0
-P
0
-P
0
0

U3 =

-2400.0*P
-2000.0*P
-1200.0*P
-2000.0*P
1200.0*P
2400.0*P

K1 =

1.0e+03 *

2.4000 1.3333 0.4000 1.0667 -0.8000 -1.2000


1.3333 1.0667 0.5333 0.9333 -0.6667 -1.0667
0.4000 0.5333 0.8000 0.6667 -0.4000 -0.8000
1.0667 0.9333 0.6667 1.0667 -0.5333 -1.3333
-0.8000 -0.6667 -0.4000 -0.5333 0.8000 0.4000
-1.2000 -1.0667 -0.8000 -1.3333 0.4000 2.4000

U1 =

-2400.0*P
-2000.0*P
-1200.0*P
-2000.0*P
1200.0*P
2400.0*P

UA =

0
-2400.0*P
-2000.0*P
-1200.0*P
-2000.0*P
1200.0*P
0
2400.0*P

FA =

1.0*P
0
-1.0*P
0
-1.0*P
0
1.0*P
0