1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
close all;
clear all;
clc;
% Caractéristique géométriques et matérielles
l =90;
e =10;
h = 30;
Iz = e*h*h*h/12;
E = 210000;
A =e*h;
P = -100;
nu = 0.3;
alpha = 3/2;
G = E/(2+2*nu);
coeff = E*Iz/(l^3);
nbreElements = 3
coordNoeuds=linspace(0,l,nbreElements+1)';
x=coordNoeuds;
nbreNoeuds=size(coordNoeuds,1);
x=coordNoeuds(:,1);
Ddl=2*nbreNoeuds % deux degres de liberté par noeuds
force=zeros(Ddl,1);
force(Ddl)= P;
deplacement=zeros(Ddl,1);
Ke=[12,6*l,-12,6*l;6*l,4*l^2,-6*l,2*l^2;-12,-6*l,12,-6*l;6*l,2*l^2,-6*l,4*l^2] %la matrice de raideur pour un element
Ne = 2;
nnodes = (Ne-1)*nbreElements+1 %nombre totale de noeuds
coords = zeros(1,nnodes);
for i= 1 : nnodes
coords(i) = l*(i-1)/(nnodes-1);
end;
connect = zeros(Ne,nbreElements);
for lmn=1:nbreElements
connect(1,lmn) = lmn;
connect(2,lmn) = lmn+1;
end;
for lmn = 1 : nbreElements
lmncoords = zeros(Ne);
for a = 1 : Ne
lmncoords(a) = coords(connect(a,lmn));
end
end
K = zeros(nnodes*2,nnodes*2);
for i=1 : 4
for j =1 :4
K(i,j) = Ke(i,j);
end
end
for a = 1 : Ne
rw = connect(a,lmn);
for b = 1 : Ne
cl = connect(b,lmn);
K(rw,cl) = K(rw,cl)+Ke(a,b);
end
end |
Partager