0% found this document useful (0 votes)
19 views

Global: %matlab System Treillis % - Donne Du Systeme

This document contains code for analyzing a structural system modeled as a truss. It defines the node coordinates, element connectivity, applied loads, and member properties. It then calculates the stiffness matrix and solves for deformations and internal forces. The results are plotted to show the deformed truss structure.

Uploaded by

Bassite Nassa
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Global: %matlab System Treillis % - Donne Du Systeme

This document contains code for analyzing a structural system modeled as a truss. It defines the node coordinates, element connectivity, applied loads, and member properties. It then calculates the stiffness matrix and solves for deformations and internal forces. The results are plotted to show the deformed truss structure.

Uploaded by

Bassite Nassa
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

%MATLAB SYSTEM TREILLIS

clear global;clc;

%---DONNE DU SYSTEME---
COORD= [ 0 0; 10 0; 20 0; 0 12; 10 12; 20 12];
CON= [1 2; 2 3; 4 5; 5 6; 1 4; 2 4; 1 5; 2 5; 3 5; 2 6; 3 6];
EQ= [10 11; 1 2; 3 12; 4 5; 6 7; 8 9];
NR = 3;
NE = size(CON,1);
NN = size(COORD,1);
EA = [ 2 3 3 3 2 2 3 2 3 4 2 ]'*10^3;
Pf = [0 0 0 0 0 0 -10 0 0]';
Ur = [0 0 0]';

%---CALCULES---
%STRUCTURAL INFORMATIONS
NOS = NE+NR-2*NN;
NOK = 2*NN-NR;

%LENGTH OF ELEMENT
L = zeros(NE,1);
for k = 1:NE
i = CON(k,1);
j = CON(k,2);
dx = COORD(j,1) - COORD(i,1);
dy = COORD(j,2) - COORD(i,2);
L(k) = sqrt(dx^2+dy^2);
end

%ID
ID = zeros(NE,4);
for k = 1:NE
i = CON(k,1);
j = CON(k,2);
ID(k,1:2) = EQ(i,1:2);
ID(k,3:4) = EQ(j,1:2);
end

%STIFFNESS MATRIX
NDOF = 2*NN;
K = zeros(NDOF,NDOF);
for k = 1:NE
i = CON(k,1);
j = CON(k,2);
dx = COORD(j,1) - COORD(i,1);
dy = COORD(j,2) - COORD(i,2);
a = [-dx/L(k) -dy/L(k) dx/L(k) dy/L(k)];
ES = a'.*EA(k)/L(k)*a;
for m = 1:4
for n = 1:4
mi = ID(k,m);
ni = ID(k,n);
K(mi,ni) = K(mi,ni) + ES(m,n);
end
end
end
Kff(1:NOK,1:NOK) = K(1:NOK,1:NOK);
Kfr(1:NOK,1:NDOF-NOK) = K(1:NOK,NOK+1:NDOF);
Krf = Kfr';
Krr(1:NDOF-NOK,1:NDOF-NOK) = K(NOK+1:NDOF,NOK+1:NDOF);

%DEFORMATION
Uf = Kff\Pf;
U = [Uf; Ur];

%INTERNAL FORCES
N = zeros(NE,1);
for k = 1:NE
i = CON(k,1);
j = CON(k,2);
dx = COORD(j,1) - COORD(i,1);
dy = COORD(j,2) - COORD(i,2);
a = [-dx/L(k) -dy/L(k) dx/L(k) dy/L(k)];
u = zeros(4,1);
for m = 1:4
u(m) = U(ID(k,m));
end
N(k) = EA(k)/L(k).*a*u;
end
%SUPPORT REACTIONS
R = Krf*Uf+Krr*Ur

%---PLOT STRUCTURE---
f1 = figure();
f1.WindowState = 'maximized';
for k = 1:NE
i = CON(k,1);
j = CON(k,2);
x = [COORD(i,1) COORD(j,1)];
y = [COORD(i,2) COORD(j,2)];
plot(x,y);
hold on
end

You might also like