You are on page 1of 23

3D Structures

Computer program
// calculate the stiffness matrix for a regular plan frame
// author F. Paulet-Crainiceanu
// version 1.0 / December 2006
clear
mode(0)
disp('')
disp('')
disp('
disp('
disp('
disp('')
disp('')

*******************************************')
*** CALCULATION OF THE STIFFNESS MATRIX ***')
*******************************************')

n=0;
while n<1
n=input('Number of levels = ');
if n<1 then
disp('error, no.of levels should be >= 1')
disp('')
end
end
disp('')
m=0;
while m<1
m=input('Number of spans = ');
if m<1 then
disp('error, no.of spans should be >= 1')
disp('')
end
end
disp('')
EI=0;
while EI<=0
EI=input('E*I = ');
if EI<=0 then
disp('error, E*I should be > 0')
disp('')
end
end
disp('')
disp('')
disp('
** LEVEL HEIGHTS:')
disp('')
for i=1:n
h(i)=0;
while h(i)<=0
h(i)=input(['Height of the level no.' + string(i) + '= ']);
if h(i)<=0 then
disp('error, height of the level should be > 0')
disp('')
end
end
end
disp('')

disp('')
disp('
** SPAN LENGTHS:')
disp('')
for j=1:m
l(j)=0;
while l(j)<=0
l(j)=input(['Length of the span no.' + string(j) + '= ']);
if l(j)<=0 then
disp('error, length of the span should be > 0')
disp('')
end
end
end
disp('')
disp('')
disp('
** E*I ratio for COLUMNS:')
for i=1:n
disp('')
disp([' * E*I ratio for columns at LEVEL no.' + string(i)])
disp('')
for j=1:m+1
c(i,j)=0;
while c(i,j)<=0
c(i,j)=input(['Level '+string(i)+', column '+string(j)+',
E*I ratio = ']);
if c(i,j)<=0 then
disp('error, E*I ratio should be > 0')
disp('')
end
end
end
end
disp('')
disp('')
disp('
** E*I ratio for BEAMS:')
for i=1:n
disp('')
disp([' * E*I ratio for beams at FLOOR no.' + string(i)])
disp('')
for j=1:m
b(i,j)=0;
while b(i,j)<=0
b(i,j)=input(['Floor '+string(i)+', span '+string(j)+', E*I
ratio = ']);
if b(i,j)<=0 then
disp('error, E*I ratio should be > 0')
disp('')
end
end
end
end
disp('')
disp('')

// stiffness from floor displacements


// first floor
r(1,1)=0;
if n==1 then // first floor = last floor, one floor structure
for j=1:m+1
// translation dof
r(1,1)=r(1,1)+12*c(1,j)/h(1)^3;
p=n+j;
// rotational dof
r(p,1)=-6*c(1,j)/h(1)^2;
end
else // first floor, more than one floor structure
r(2,1)=0;
for j=1:m+1
// translation dof
r(1,1)=r(1,1)+12*(c(1,j)/h(1)^3+c(2,j)/h(2)^3);
r(2,1)=r(2,1)-12*c(2,j)/h(2)^3;
p=n+j;
// rotational dof
r(p,1)=6*(c(2,j)/h(2)^2-c(1,j)/h(1)^2);
r(p+m+1,1)=6*c(2,j)/h(2)^2;
end
end
// stiffness from floor displacements
// last floor
if n~=1 then // last floor, more than one floor structure
r(n,n)=0;
r(n-1,n)=0;
for j=1:m+1
// translation dof
r(n,n)=r(n,n)+12*c(n,j)/h(n)^3;
r(n-1,n)=r(n-1,n)-12*c(n,j)/h(n)^3;
// rotational dof
p=n+(n-1)*(m+1)+j;
r(p,n)=-6*c(n,j)/h(n)^2;
r(p-m-1,n)=-6*c(n,j)/h(n)^2;
end
end
// stiffness from floor displacements
// current floors
for i=2:n-1
r(i,i)=0;
r(i-1,i)=0;
r(i+1,i)=0;
for j=1:m+1
// translation dof
r(i,i)=r(i,i)+12*(c(i,j)/h(i)^3+c(i+1,j)/h(i+1)^3);
r(i-1,i)=r(i-1,i)-12*c(i,j)/h(i)^3;
r(i+1,i)=r(i+1,i)-12*c(i+1,j)/h(i+1)^3;
p=n+(i-1)*(m+1)+j;
// rotational dof
r(p,i)=6*(c(i+1,j)/h(i+1)^2-c(i,j)/h(i)^2);
r(p+m+1,i)=6*c(i+1,j)/h(i+1)^2;
r(p-m-1,i)=-6*c(i,j)/h(i)^2;
end
end

// stiffness from node rotation


// first floor
if n==1 then // first floor = last floor, one floor structure
// left node, j=1
// translation dof
r(1,2)=-6*c(1,1)/h(1)^2;
// rotational dof
r(2,2)=4*(c(1,1)/h(1)+b(1,1)/l(1));
r(3,2)=2*b(1,1)/l(1);
// right node, j=m+1
// translation dof
p=m+2;
r(1,p)=-6*c(1,m+1)/h(1)^2;
// rotational dof
r(p,p)=4*(c(1,m+1)/h(1)+b(1,m)/l(m));
r(p-1,p)=2*b(1,m)/l(m);
// current node
for j=2:m
// translation dof
p=n+j;
r(1,p)=-6*c(1,j)/h(1)^2;
// rotational dof
r(p,p)=4*(c(1,j)/h(1)+b(1,j-1)/l(j-1)+b(1,j)/l(j));
r(p-1,p)=2*b(1,j-1)/l(j-1);
r(p+1,p)=2*b(1,j)/l(j);
end
else // first floor, more than one floor structure
// left node, j=1
// translation dof
p=n+1;
r(1,p)=6*(-c(1,1)/h(1)^2+c(2,1)/h(2)^2);
r(2,p)=-6*c(2,1)/h(2)^2;
// rotational dof
r(p,p)=4*(c(1,1)/h(1)+c(2,1)/h(2)+b(1,1)/l(1));
r(p+1,p)=2*b(1,1)/l(1);
r(p+m+1,p)=2*c(2,1)/h(2);
// right node, j=m+1
// translation dof
p=n+m+1;
r(1,p)=6*(-c(1,m+1)/h(1)^2+c(2,m+1)/h(2)^2);
r(2,p)=-6*c(2,m+1)/h(2)^2;
// rotational dof
r(p,p)=4*(c(1,m+1)/h(1)+c(2,m+1)/h(2)+b(1,m)/l(m));
r(p-1,p)=2*b(1,m)/l(m);
r(p+m+1,p)=2*c(2,m+1)/h(2);
// current node
for j=2:m
// translation dof
p=n+j;
r(1,p)=6*(-c(1,j)/h(1)^2+c(2,j)/h(2)^2);
r(2,p)=-6*c(2,j)/h(2)^2;
// rotational dof
r(p,p)=4*(c(1,j)/h(1)+c(2,j)/h(2)+b(1,j-1)/l(j1)+b(1,j)/l(j));
r(p-1,p)=2*b(1,j-1)/l(j-1);
r(p+1,p)=2*b(1,j)/l(j);
r(p+m+1,p)=2*c(2,j)/h(2);
end

end
// stiffness from node rotation
// last floor
if n~=1 then // last floor, more than one floor structure
// left node, j=1
p=n+(n-1)*(m+1)+1;
// translation dof
r(n,p)= -6*c(n,1)/h(n)^2;
r(n-1,p)= 6*c(n,1)/h(n)^2;
// rotational dof
r(p,p)=4*(c(n,1)/h(n)+b(n,1)/l(1));
r(p+1,p)=2*b(n,1)/l(1);
r(p-m-1,p)=2*c(n,1)/h(n);
// right node, j=m+1
// translation dof
p=n*(m+2);
r(n,p)= -6*c(n,m+1)/h(n)^2;
r(n-1,p)= 6*c(n,m+1)/h(n)^2;
// rotational dof
r(p,p)=4*(c(n,m+1)/h(n)+b(n,m)/l(m));
r(p-1,p)=2*b(n,m)/l(m);
r(p-m-1,p)=2*c(n,m+1)/h(n);
// right node, j=m+1
for j=2:m
p=n+(n-1)*(m+1)+j;
// translation dof
r(n,p)= -6*c(n,j)/h(n)^2;
r(n-1,p)= 6*c(n,j)/h(n)^2;
// rotational dof
r(p,p)=4*(c(n,j)/h(n)+b(n,j-1)/l(j-1)+b(n,j)/l(j));
r(p-1,p)=2*b(n,j-1)/l(j-1);
r(p+1,p)=2*b(n,j)/l(j);
r(p-m-1,p)=2*c(n,j)/h(n);
end
end
// stiffness from node rotation
// current floor
for i=2:n-1
// left node, j=1
p=n+(i-1)*(m+1)+1;
// lateral dof
r(i,p)=6*(-c(i,1)/h(i)^2+c(i+1,1)/h(i+1)^2);
r(i+1,p)=-6*c(i+1,1)/h(i+1)^2;
r(i-1,p)=6*c(i,1)/h(i)^2;
// rotational dof
r(p,p)=4*(c(i,1)/h(i)+c(i+1,1)/h(i+1)+b(i,1)/l(1));
r(p+1,p)=2*b(i,1)/l(1);
r(p-m-1,p)=2*c(i,1)/h(i);
r(p+m+1,p)=2*c(i+1,1)/h(i+1);
// right node, j=m+1
p=n+i*(m+1);
// lateral dof
r(i,p)=6*(-c(i,m+1)/h(i)^2+c(i+1,m+1)/h(i+1)^2);
r(i+1,p)=-6*c(i+1,m+1)/h(i+1)^2;
r(i-1,p)=6*c(i,m+1)/h(i)^2;
// rotational dof
r(p,p)=4*(c(i,m+1)/h(i)+c(i+1,m+1)/h(i+1)+b(i,m)/l(m));

r(p-1,p)=2*b(i,m)/l(m);
r(p-m-1,p)=2*c(i,m+1)/h(i);
r(p+m+1,p)=2*c(i+1,m+1)/h(i+1);
//current node
for j=2:m
p=n+(i-1)*(m+1)+j;
// lateral dof
r(i,p)=6*(-c(i,j)/h(i)^2+c(i+1,j)/h(i+1)^2);
r(i+1,p)=-6*c(i+1,j)/h(i+1)^2;
r(i-1,p)= 6*c(i,j)/h(i)^2;
// rotational dof
r(p,p)=4*(c(i,j)/h(i)+c(i+1,j)/h(i+1)+b(i,j-1)/l(j1)+b(i,j)/l(j));
r(p-1,p)=2*b(i,j-1)/l(j-1);
r(p+1,p)=2*b(i,j)/l(j);
r(p-m-1,p)=2*c(i,j)/h(i);
r(p+m+1,p)=2*c(i+1,j)/h(i+1);
end
end
// verifying the symmetry
v=r-r';
vm=max(max(abs(v)));
disp(['maximum of the difference between simmetrical elements
is ' + string(vm)])
// calculation of the stiffness matrix
R11=r(1:n,1:n);
R12=r(1:n,(n+1):(n*(m+2)));
R21=r((n+1):(n*(m+2)),1:n);
R22=r((n+1):(n*(m+2)),(n+1):(n*(m+2)));
K=(R11-R12*inv(R22)*R21)*EI

Bibliography

Static

1.

(Statics, Stability and Structural Dynamics. II.1. Structural Statics. Statically undetermined
structures. Works),
(in Romanian)
2. Atanasiu, G.M.: Structural Dynamics and Stability, Editura "G
(Dynamics and Stability of Structures),

3. Brsan, G.M.:

Romanian)
4. Chopra, A. K.: Dynamics of Structures. Theory and Applications to Earthquake Engineering,
Prentice Hall International, Inc., London, 1995
5. Ciongradi, I., Schrf, F.:
(Structural Dynamics
nian)
6. Clough, W.R., Penzien, J.: Dynamics of Structures, Second Edition, McGraw-Hill, Inc., New
York, 1993
7. Dimoiu, I., I
(Earthquake Engineering)
1999 (in Romanian)
8. Fujino, Y, Shoji, G.: The Great Hanshin Earthquake - Seismic, Structural, Economic and Social
Aspects, Proceedings of the Fifth Asia Pacific Conference on Structural Engineering and
Construction, 1995
9. Fujino, Y, Shoji, G.: The Great Hanshin Earthquake - Seismic, Structural, Economic and Social
Aspects, Proceedings of the Fifth Asia Pacific Conference on Structural Engineering and
Construction, 1995
10. Honshu-Shikoku Bridge Authority: Akashi-Kaikyo Bridge. Engineering Note, 1995
11. Ifrim, M., Dobrescu, Al.:
(Applications in Dynamic Analysis and Earthquake Engineering
eanu, F., Dinamica structurilor (Structural Dynamics), Editura
-Teiu Bo
(in Romanian)
Ivan, M., Botici, A., Dogaru, E., Ivan, A., Balekics, G., Negru, A.:
(Statics, Stability, and Dynamics of Structures.
Theory and Applications
1997(in Romanian)
Meirovitch, L.: Dynamics and Control of Structures, John Wiley & Sons, New York, 1990
orapciu, M.:
-Romn (Illustrated English-Romanian Dictionary of Constructions and
Construction Materials
(Ministry of Transportation,
Constructions and Tourism). Cod de proiectare P100. Partea I - p100-1/2006 prevederi de
, (Design Code P100. Part I p100-1/2006 design provisions for
buildings). (in Romanian)
, Al. (coord.), A
e (Applications in Earthquake Engineering),
(in Romanian)

12. Ionescu,C.,
13.

14.
15.

16.

17.

18.
(Earthquake Engineering
19. Nikkei Construction, No. 2-24 (1995) (in Japanese)
20. Nikkei Construction, No. 6-9 (1995) (in Japanese)
21.
Earthquake Engineering,

Active Control Approach For Long Span Bridge Responses To Strong


Earthquakes, Doctoral Thesis, Yokohama National University, Japan, 1997
23.
, Stere, C.:
hidrotehnice (The Earthquake Engineering of Hydro-technical Constructions
22.

24.
25.
26.
27.
28.
29.

, D., D
(Structural Dynamics and Earthquake
Engineering), Editura
(in Romanian)
Strat,
Structural Statics, Editura Gh. Asachi
1995
Tada, K., Jin, H., Kitagawa, M., Nitta, A., Toriumi, R.: Effect of the Southern Hyogo Earthquake
on the Akashi-Kaikyo Bridge, Structural Engineering International, 1995
The MathWorks Inc.: MATLAB, Reference Guide
Yamaguchi, H.: Structural Dynamics, Asian Institute of Technology, 1992
Zienkiewicz, O. C., Taylor, R. L.: The Finite Element Method, 4th edition, McGraw-Hill , 1989

You might also like