0% found this document useful (0 votes)
70 views3 pages

Programme Matlab

The document describes functions for calculating: 1) The length of truss elements based on node coordinates 2) The stiffness matrix of planar truss elements 3) Assembling element stiffness matrices into a global stiffness matrix It also describes functions for calculating: 4) Forces on truss elements from displacements 5) Stresses on truss elements from displacements

Uploaded by

Bader Ed
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)
70 views3 pages

Programme Matlab

The document describes functions for calculating: 1) The length of truss elements based on node coordinates 2) The stiffness matrix of planar truss elements 3) Assembling element stiffness matrices into a global stiffness matrix It also describes functions for calculating: 4) Forces on truss elements from displacements 5) Stresses on truss elements from displacements

Uploaded by

Bader Ed
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
You are on page 1/ 3

Calcul de la longueur de l’élément en fonction des coordonnées du

premier nœud(x1,y1) et du second nœud(x1,y2).

function y= Truss2dLength(x1,y1,x2,y2)
y=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)) ;

Calcul de la matrice de rigidité de chaque élément plan du treillis :

function y= Truss2dstiffness (E,A,L,theta)


% E module d’élasticité, L Longueur , angle theta (en degré), A section
de l’élément
% La dimension de la matrice de rigidité est 4x4
X=theta*pi/180 ;
C=cos(X);
S=sin(X);
y=E*A/L*[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] ;

Assemblage :
function y=Beamassemble(K,k,i,j)
K(2*i-1 , 2*i-1 ) = K(2*i-1 , 2*i-1 )+k(1,1) ;
K(2*i-1 , 2*i)= K(2*i-1 , 2*i )+k(1,2) ;
K(2*i-1 , 2*j-1 ) = K(2*i-1 , 2*j-1 )+k(1, 3) ;
K(2*i-1 , 2*j) = K(2*i-1 , 2*j )+k(1,4) ;
K(2*i , 2*i-1 ) = K(2*i , 2*i-1 )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2*i )+k(4,2) ;
K(2*j , 2*j-1 ) = K(2*j , 2*j-1 )+k(4,3) ;
K(2*j , 2*j ) = K(2*j , 2*j )+k(4,4) ;
Y=K ;

Calcul des forces :


function y = Truss2dforce [E, L, theta, u]
% E module d’élasticité, L longueur, angle thêta (en degré), u vecteur
de déplacement
X=theta*pi/180 ;
C=cos(X) ;
S=sin(X) ;
y=E*A/L*[-C -S C S]*u ;

Calcul des contraintes


function y = Truss2dStress [E, L, theta, u]
% E module d’élasticité, L longueur, angle thêta (en degré), u vecteur
de déplacement
X=theta*pi/180;
C=cos(X);
S=sin(X);
y=E/L*[-C -S C S] *u;

You might also like