You are on page 1of 28

% author: Gafita Constantin-Flavian

07.06.2016

SEISMIC RESPONSE DISPLAY ON A nDOF structure


Requirements for a 3DOF structure:
1. Draw the frame drawn on the blackboard/physical support order number 2.
2. Choose the NS component of Vrancea Earthquaqe 1977 and draw:
a) the displacement;
b) velocity;
c) accelerations response;
3. Choose the EW component of Vrancea Earthquaqe 1977 and draw:
a) the displacement;
b) velocity
c) accelerations response;
4. Choose the Up-Down (UD) component of Vrancea Earthquaqe 1977 and draw:
a) the displacement;
b) velocity;
c) acceleration response;

T1=0,208190511279744 s
T2=0,0913175262451025 s
T3=0,0594127365370903
s

A1=0.080 m^2
A2=0.3969 m^2
A3=0.3467 m^2
The Frame will be verified with Robot
Structural Analysis

ROBOT STRUCTURAL ANALYSIS


1

%
%
%
%
%

author: Gafita Constantin-Flavian


master: Structural Engineering
topic: Advanced Earthquake Engineering
academic year: 2015-2016
SYSTEM THEORY

close all
clear all
disp('Seismic Response of a n-DOF Structure')

Input Data
% the structure is a in-plane frame
% input data
% Modulus of elasticity (Young Modulus)
E=2.1e11; %N/m^2
% mass
m1=1e5; %kg
m2=m1;
m3=2*m1;
% the mass matrix
M=[m1 0 0;
0 m2 0;
0 0 m3;];
% no. of dynamic degrees of freedom
ndof=length(diag(M));
% damping
niu=0.05; % 5% damping
% section dimensions
bs=0.2; %meters
hs=0.40; %meters
% Calculus
% moment of inertia
I=bs*hs^3/12;

% The main goal is to get K with FEM

% introduce the topology


nnodes=8; % no. of nodes (as in the notebook drawing)
nbeams=7; % no. of beams/elements (as in the notebook drawing)
% coordinates of the nodes (in metres, in coordonate XOY)
xn(1)=0;
xn(2)=0;
xn(3)=6;
xn(4)=4.5;
xn(5)=3;
xn(6)=9;
xn(7)=9;
xn(8)=9;

yn(1)=0; % node 1
yn(2)=4;
yn(3)=4;
yn(4)=2;
yn(5)=0;
yn(6)=4;
yn(7)=2;
yn(8)=0;

% equation's numbering - look for the table in the notebook


eqx(1)=24;
(rotation)
eqx(2)=1;
eqx(3)=6;
eqx(4)=2;
eqx(5)=21;
eqx(6)=11;
eqx(7)=3;
eqx(8)=18;

eqy(1)=23; eqt(1)=22; % eqt=equation for theta


eqy(2)=4;
eqy(3)=7;
eqy(4)=9;
eqy(5)=20;
eqy(6)=12;
eqy(7)=14;
eqy(8)=17;

eqt(2)=5;
eqt(3)=8;
eqt(4)=10;
eqt(5)=15;
eqt(6)=13;
eqt(7)=15;
eqt(8)=16;

% beams description
A1=bs*hs; A2=bs*(24*I/bs)^(-1/3); A3=bs*(36*I/bs)^(-1/3); %
cross-section areas of the beams, as in the notebook drawing
node1(1)=1;
of the beam
node1(2)=2;
node1(3)=3;
node1(4)=4;
node1(5)=3;
node1(6)=6;
node1(7)=7;

node2(1)=2; bI(1)=2*I;
1; moment of inertia I
node2(2)=3; bI(2)=2*I;
node2(3)=4; bI(3)=3*I;
node2(4)=5; bI(4)=3*I;
node2(5)=6; bI(5)=I;
node2(6)=7; bI(6)=2*I;
node2(7)=8; bI(7)=2*I;

% explination of beam types


% 1. fixed-fixed
% 2. fixed-pinned

bA(1)=A2; type(1)=1; % nodes


on beam 1; area of beam 1
bA(2)=A2; type(2)=1;
bA(3)=A3; type(3)=1;
bA(4)=A3; type(4)=2;
bA(5)=A1; type(5)=1;
bA(6)=A2; type(6)=1;
bA(7)=A2; type(7)=1;

% beam lengths
for i=1:nbeams
bL(i)=sqrt((xn(node2(i))-xn(node1(i)))^2+...
(yn(node2(i))-yn(node1(i)))^2);
end

1. Draw the frame drawn on the


blackboard/physical support order number 2
h11=figure;
set(h11,'color',[0.8 0.6 0.5]);
% draw the beams
hold on
for i=1:nbeams
h12=plot([xn(node1(i)),xn(node2(i))],...
[yn(node1(i)),yn(node2(i))]); % xn beginning/end, yn
beginning/end of the nodes of the beam1; basically from node to
node, as in the notebook drawing
set(h12,'LineWidth',1.5,'color',[0.8 0.1 0.1]);
h16=text((xn(node1(i))+xn(node2(i)))/2,...
(yn(node1(i))+yn(node2(i)))/2,...
['beam',num2str(i)]);
set(h16,'FontName','Times','FontSize',12)
end
for i=1:nnodes
h17=text(xn(i),yn(i),['node',num2str(i)]);
set(h17,'FontName','Arial','FontSize',10,'color',[0.2 0.3
0.8]);
end
hold off

h13=xlabel('X(m)');
4

set(h13,'FontName','Times','FontSize',14)
h14=ylabel('Y(m)');
set(h14,'FontName','Times','FontSize',14)
h15=title('In-Plane Frame');
set(h15,'FontName','Times','FontSize',18)
ax=axis;
procx=0.05*abs(ax(2)-ax(1));
procy=0.05*abs(ax(4)-ax(3));
ax(1)=ax(1)-procx;
ax(2)=ax(2)+procx;
ax(3)=ax(3)-procy;
ax(4)=ax(4)+procy;
axis(ax);
set(gca,'color',[0.6 0.6 0.0]);

InPlaneFrame
4

beam2

node2

beam5

node3

node6

3.5

beam3

beam6

Y(m)

2.5
2

beam1

node4

node7

1.5

beam4

beam7

0.5
0

node1
0

node5
1

node8
4

X(m)

% total no. of DOFs


tndof=nnodes*3;
% initialize total stiffness matrix
Ktot=zeros(tndof,tndof);
% processing each beam
for i=1:nbeams
disp(['beam no.',num2str(i)]);
kloc=zeros(6,6); % local K stiffness matrix
switch type(i) % function for different cases - mai multe
ramuri pt. grinzile diferite
case 1
disp('type 1, fixed-fixed')
kloc(1,1)=E*bA(i)/bL(i); % local K stiffness matrix
of each beam
kloc(1,4)=-kloc(1,1);
kloc(2,2)=12*E*bI(i)/bL(i)^3;
kloc(2,3)=6*E*bI(i)/bL(i)^2;
kloc(2,5)=-kloc(2,2);
kloc(2,6)=kloc(2,3);
kloc(3,3)=4*E*bI(i)/bL(i);
kloc(3,5)=-kloc(2,3);
kloc(3,6)=kloc(3,3)/2;
kloc(4,4)=kloc(1,1);
kloc(5,5)=kloc(2,2);
kloc(5,6)=-kloc(2,3);
kloc(6,6)=kloc(3,3);
% symmetrisation
kloc=kloc+kloc';
for j=1:6
kloc(j,j)=kloc(j,j)/2;
end

case 2
6

disp('type 2, fixed-pinned')
kloc(1,1)=E*bA(i)/bL(i);
kloc(1,4)=-kloc(1,1);
kloc(2,2)=3*E*bI(i)/bL(i)^3;
kloc(2,3)=3*E*bI(i)/bL(i)^2;
kloc(2,5)=-kloc(2,2);
kloc(3,3)=3*E*bI(i)/bL(i);
kloc(3,5)=-kloc(2,3);
kloc(4,4)=kloc(1,1);
kloc(5,5)=kloc(2,2);
kloc(5,6)=-kloc(2,3);
% symmetrisation
kloc=kloc+kloc';
for j=1:6
kloc(j,j)=kloc(j,j)/2;
end
otherwise
disp('mistake')
end
sd=(yn(node2(i))-yn(node1(i)))/bL(i); % cosine direction
cd=(xn(node2(i))-xn(node1(i)))/bL(i); % sine direction
tt=[cd sd 0; -sd cd 0; 0 0 1;]; % time matrix
tm=[tt zeros(3,3); zeros(3,3) tt;]; % transformation matrix
kgen=tm'*kloc*tm; % general kloc matrix
%vector of equations for beam i
veq=[eqx(node1(i)) eqy(node1(i)) eqt(node1(i))...
eqx(node2(i)) eqy(node2(i)) eqt(node2(i))];

% assembling the total stiffness matrix


for il=1:6
for ic=1:6
Ktot(veq(il),veq(ic))=...
Ktot(veq(il),veq(ic))+kgen(il,ic); % il,ic=index of
line, index of column
end
end
end
% number of equations to be ignored ((8)reactions+(1)hinges)
7

neqig=8+1;
Kred=Ktot(1:tndof-neqig,1:tndof-neqig); % reduced matrix
r11=Kred(1:ndof,1:ndof);
r12=Kred(1:ndof,ndof+1:end);
r21=Kred(ndof+1:end,1:ndof);
r22=Kred(ndof+1:end,ndof+1:end);
% dynamic stiffness matrix (along the masses vibration
directions)
K=r11-r12*inv(r22)*r21;
% classical eigenproblem
[U,W]=eig(K,M);
omegasq=diag(W);
omega=sqrt(omegasq);
T=2*pi./omega;
% frequency
fr=1./T; % Hz
% Generation of Damped Omega
omegad=omega*sqrt(1-niu^2);
% Generation of Damping Coefficient
Mg=U'*M*U; % generalized mass matrix
Cg=diag(2*niu*omega.*diag(Mg)); % generalized damping matrix
C=inv(U')*Cg*inv(U);

System Theory
% System Matrices
8

A=[zeros(ndof) eye(ndof); % eye este matricea I


-inv(M)*K -inv(M)*C];
B=[zeros(ndof);
inv(M)];
C=[eye(2*ndof);
-inv(M)*K -inv(M)*C];
D=[zeros(ndof);
zeros(ndof);
inv(M)];
% Make the System
frame=ss(A,B,C,D); % state system
% Verify the System through the Eigenvalues
[U,W]=eig(A);
dW=diag(W);
rp=real(dW(1:2:end)); % extragerea partii reale si a celei
imaginare
ip=imag(dW(1:2:end));
rat=rp.^2./ip.^2; % raport
nniu=sqrt(rat./(1+rat)); % new niu
nomega=-rp./nniu; % new omega
% load into memory the earthquake data
load vran.acc
% obtain the size of the file data
[n,m]=size(vran);
% sampling time
step=0.01; % seconds
time=0:step:(n-1)*step; % time interval

2 Select the North-South earthquake component


9

ns=vran(:,2); % acceleration
h11=figure;
set(h11,'color',[0.7 0.5 0.7]) % culoarea exteriorului
graficului
h12=plot(time,ns,[0,time(end)],[0,0]);
set(h12(1),'LineWidth',1.5,'color',[0.2 0.7 0.1]) % coloreaza
linia care defineste graficul
set(h12(2),'LineWidth',2.5,'LineStyle','-.')
h13=xlabel('Time(sec)');
set(h13,'FontName','Times','FontSize',14)
h14=ylabel('Acceleration (cm/sec^2)');
set(h14,'FontName','Times','FontSize',14)
h15=title('Vrancea Earthquake 1977, North-South Component');
set(h15,'FontName','Times','FontSize',18)
[maxy,imax]=max(ns); % min and max of values
[miny,imin]=min(ns);
maxabs=max(abs(ns)); % max absolut
ax=axis; % variabila care stocheaza axele
ax(2)=time(end);
ax(3)=miny-maxabs/15; % spatiul de sus sa fie la fel ca spatiul
de jos in varfurile graficului
ax(4)=maxy+maxabs/15;
axis(ax); % scurtarea din dreapta a graficului
h16=text(time(imax),maxy,['-- max=',num2str(maxy),'cm/s^2 at
time=',num2str(time(imax))]); % valoarea maximului de pe grafic
cu fct num2str si timpul inregistrat
set(h16,'FontName','Times','FontSize',12)
h17=text(time(imin),miny,['-- min=',num2str(miny),'cm/s^2 at
time=',num2str(time(imin))]); % valoarea minimului de pe grafic
cu fct num2str si timpul inregistrat
set(h17,'FontName','Times','FontSize',12)
set(gca,'color',[0.4 0.4 0.8])

10

VranceaEarthquake1977,NorthSouthComponent
2

max=177.62cm/s attime=3.43

100

Acceleration(cm/sec )

150

50
0
-50
-100
-150
-200

min=194.927cm/s attime=3.06
0

10

12

Time(sec)

14

16

18

20

% Simulation of the Response to the Seismic Action


f=(diag(M)*ns'/100);
y=lsim(frame,f,time);
t=time;
u=y(:,1); % doua puncte inseamna toate liniile, o coloana

2.a Draw the Graphic of Displacement


% Draw the Graphic of Displacement
h21=figure;
set(h21,'color',[0.7 0.5 0.7]) % culoarea exteriorului
graficului
h22=plot(t,u,[0,t(end)],[0,0]); %%%%%%%%%% poate fi si acesta
handle ex. h12=plot...
set(h22(1),'LineWidth',1.5,'color',[0.2 0.7 0.1]) % coloreaza
linia care defineste graficul
set(h22(2),'LineWidth',2.5,'LineStyle','-.')
h23=xlabel('Time(sec)');
set(h23,'FontName','Times','FontSize',14)
h24=ylabel('Displacement(m)');
11

set(h24,'FontName','Times','FontSize',14)
h25=title('Seismic response of the frame Vrancea NS, M1
direction');
set(h25,'FontName','Times','FontSize',18)

%[maxy,imax]=max(u); % min and max of values


%[miny,imin]=min(u);
%maxabs=max(abs(u)); % max absolut
ax=axis; % variabila care stocheaza axele
ax(2)=t(end);
%ax(3)=miny-maxabs/15; % spatiul de sus sa fie la fel ca
spatiul de jos in varfurile graficului
%ax(4)=maxy+maxabs/15;
axis(ax); % scurtarea din dreapta a graficului
set(gca,'color',[0.4 0.4 0.8]) % culoarea interiorului
graficului
ud=y(:,2); % doua puncte inseamna toate liniile, o coloana

SeismicresponseoftheframeVranceaNS,M1direction
x 10
-3

Displacement(m)

6
4
2
0
-2
-4
-6

10

12

Time(sec)

14

16

18

2.b Draw The Graphic of Velocity


12

20

% Draw the Graphic of Velocity


h31=figure;
set(h31,'color',[0.7 0.5 0.7]) % culoarea exteriorului
graficului
h32=plot(t,ud,[0,t(end)],[0,0]); %%%%%%%%%%
set(h32(1),'LineWidth',1.5,'color',[0.2 0.7 0.1]) % coloreaza
linia care defineste graficul
set(h32(2),'LineWidth',2.5,'LineStyle','-.')
h33=xlabel('Time(sec)');
set(h33,'FontName','Times','FontSize',14)
h34=ylabel('Velocity(m/s)');
set(h34,'FontName','Times','FontSize',14)
h35=title('Seismic response of the frame Vrancea NS, M1
direction');
set(h35,'FontName','Times','FontSize',18)

%[maxy,imax]=max(u); % min and max of values


%[miny,imin]=min(u);
%maxabs=max(abs(u)); % max absolut
ax=axis; % variabila care stocheaza axele
ax(2)=t(end);
%ax(3)=miny-maxabs/15; % spatiul de sus sa fie la fel ca
spatiul de jos in varfurile graficului
%ax(4)=maxy+maxabs/15;
axis(ax); % scurtarea din dreapta a graficului
set(gca,'color',[0.4 0.4 0.8]) % culoarea interiorului
graficului
udd=y(:,3); % doua puncte inseamna toate liniile, o coloana

13

SeismicresponseoftheframeVranceaNS,M1direction
x 10
-3

6
5
4

Velocity(m/s)

3
2
1
0
-1
-2
-3
-4

10

12

Time(sec)

14

16

18

20

2.c Draw The Graphic of Acceleration


% Draw the Graphic of Acceleration
h41=figure;
set(h41,'color',[0.7 0.5 0.7]) % culoarea exteriorului
graficului
h42=plot(t,udd,[0,t(end)],[0,0]); %%%%%%%%%%
set(h42(1),'LineWidth',1.5,'color',[0.2 0.7 0.1]) % coloreaza
linia care defineste graficul
set(h42(2),'LineWidth',2.5,'LineStyle','-.')
h43=xlabel('Time(sec)');
set(h43,'FontName','Times','FontSize',14)
h44=ylabel('Acceleration(m/s^2)');
set(h44,'FontName','Times','FontSize',14)
h45=title('Seismic response of the frame Vrancea NS, M1
Direction');
set(h45,'FontName','Times','FontSize',18)

14

SeismicresponseoftheframeVranceaNS,M1Direction
x 10
-3

Acceleration(m/s )

3
2
1
0
-1
-2
-3

10

12

Time(sec)

14

16

18

20

%[maxy,imax]=max(u); % min and max of values


%[miny,imin]=min(u);
%maxabs=max(abs(u)); % max absolut
ax=axis; % variabila care stocheaza axele
ax(2)=t(end);
%ax(3)=miny-maxabs/15; % spatiul de sus sa fie la fel ca
spatiul de jos in varfurile graficului
%ax(4)=maxy+maxabs/15;
axis(ax); % scurtarea din dreapta a graficului
set(gca,'color',[0.4 0.4 0.8]) % culoarea interiorului
graficului

3. Select the East-West earthquake component


15

% select the East-West earthquake component


ew=vran(:,1);
h51=figure;
set(h51,'color',[0.7 0.5 0.7]) % culoarea exteriorului
graficului
h52=plot(time,ew,[0,time(end)],[0,0]);
set(h52(1),'LineWidth',1.5,'color',[0.2 0.7 0.1]) % coloreaza
linia care defineste graficul
set(h52(2),'LineWidth',2.5,'LineStyle','-.')
h53=xlabel('Time(sec)');
set(h53,'FontName','Times','FontSize',14)
h54=ylabel('Acceleration (cm/sec^2)');
set(h54,'FontName','Times','FontSize',14)
h55=title('Vrancea Earthquake 1977, East-West Component');
set(h55,'FontName','Times','FontSize',18)
[maxy,imax]=max(ew); % min and max of values
[miny,imin]=min(ew);
maxabs=max(abs(ew)); % max absolut
ax=axis; % variabila care stocheaza axele
ax(2)=time(end);
ax(3)=miny-maxabs/15; % spatiul de sus sa fie la fel ca spatiul
de jos in varfurile graficului
ax(4)=maxy+maxabs/15;
axis(ax); % scurtarea din dreapta a graficului
h56=text(time(imax),maxy,['-- max=',num2str(maxy),'cm/s^2 at
time=',num2str(time(imax))]); % valoarea maximului de pe grafic
cu fct num2str si timpul inregistrat
set(h56,'FontName','Times','FontSize',12)
h57=text(time(imin),miny,['-- min=',num2str(miny),'cm/s^2 at
time=',num2str(time(imin))]); % valoarea minimului de pe grafic
cu fct num2str si timpul inregistrat
set(h57,'FontName','Times','FontSize',12)
set(gca,'color',[0.4 0.4 0.8])

16

VranceaEarthquake1977,EastWestComponent
2

max=162.338cm/s attime=2.8

100

Acceleration(cm/sec )

150

50

-50

-100
2

min=126.12cm/s attime=3.07
0

10

12

Time(sec)

14

16

18

20

% Simulation of the Response to the Seismic Action


f=(diag(M)*ns'/100);
y=lsim(frame,f,time);

t=time;
u=y(:,1); % doua puncte inseamna toate liniile, o coloana

3.a Draw The Graphic of Displacement


% Draw the Graphic of Displacement
h61=figure;
set(h61,'color',[0.7 0.5 0.7]) % culoarea exteriorului
graficului
h62=plot(t,u,[0,t(end)],[0,0]); %%%%%%%%%% poate fi si acesta
handle ex. h12=plot...
set(h62(1),'LineWidth',1.5,'color',[0.2 0.7 0.1]) % coloreaza
linia care defineste graficul
set(h62(2),'LineWidth',2.5,'LineStyle','-.')
h63=xlabel('Time(sec)');
set(h63,'FontName','Times','FontSize',14)
17

h64=ylabel('Displacement(m)');
set(h64,'FontName','Times','FontSize',14)
h65=title('Seismic response of the frame Vrancea EW, M1
direction');
set(h65,'FontName','Times','FontSize',18)

%[maxy,imax]=max(u); % min and max of values


%[miny,imin]=min(u);
%maxabs=max(abs(u)); % max absolut
ax=axis; % variabila care stocheaza axele
ax(2)=t(end);
%ax(3)=miny-maxabs/15; % spatiul de sus sa fie la fel ca
spatiul de jos in varfurile graficului
%ax(4)=maxy+maxabs/15;
axis(ax); % scurtarea din dreapta a graficului
set(gca,'color',[0.4 0.4 0.8]) % culoarea interiorului
graficului
ud=y(:,2); % doua puncte inseamna toate liniile, o coloana

SeismicresponseoftheframeVranceaEW,M1direction
x 10
-3

6
5
4

Velocity(m/s)

3
2
1
0
-1
-2
-3
-4

10

12

Time(sec)

18

14

16

18

20

3.b Draw The Graphic of Velocity


% Draw the Graphic of Velocity
h71=figure;
set(h71,'color',[0.7 0.5 0.7]) % culoarea exteriorului
graficului
h72=plot(t,ud,[0,t(end)],[0,0]); %%%%%%%%%%
set(h72(1),'LineWidth',1.5,'color',[0.2 0.7 0.1]) % coloreaza
linia care defineste graficul
set(h72(2),'LineWidth',2.5,'LineStyle','-.')
h73=xlabel('Time(sec)');
set(h73,'FontName','Times','FontSize',14)
h74=ylabel('Velocity(m/s)');
set(h74,'FontName','Times','FontSize',14)
h75=title('Seismic response of the frame Vrancea EW, M1
direction');
set(h75,'FontName','Times','FontSize',18)

%[maxy,imax]=max(u); % min and max of values


%[miny,imin]=min(u);
%maxabs=max(abs(u)); % max absolut
ax=axis; % variabila care stocheaza axele
ax(2)=t(end);
%ax(3)=miny-maxabs/15; % spatiul de sus sa fie la fel ca
spatiul de jos in varfurile graficului
%ax(4)=maxy+maxabs/15;
axis(ax); % scurtarea din dreapta a graficului
set(gca,'color',[0.4 0.4 0.8]) % culoarea interiorului
graficului

udd=y(:,3); % doua puncte inseamna toate liniile, o coloana

19

SeismicresponseoftheframeVranceaEW,M1direction
x 10
-3

6
5
4

Velocity(m/s)

3
2
1
0
-1
-2
-3
-4

10

12

Time(sec)

14

16

18

20

3.c Draw The Graphic of Acceleration


% Draw the Graphic of Acceleration
h81=figure;
set(h81,'color',[0.7 0.5 0.7]) % culoarea exteriorului
graficului
h82=plot(t,udd,[0,t(end)],[0,0]); %%%%%%%%%%
set(h82(1),'LineWidth',1.5,'color',[0.2 0.7 0.1]) % coloreaza
linia care defineste graficul
set(h82(2),'LineWidth',2.5,'LineStyle','-.')
h83=xlabel('Time(sec)');
set(h83,'FontName','Times','FontSize',14)
h84=ylabel('Acceleration(m/s^2)');
set(h84,'FontName','Times','FontSize',14)
h85=title('Seismic response of the frame Vrancea EW, M1
Direction');
set(h85,'FontName','Times','FontSize',18)

%[maxy,imax]=max(u); % min and max of values


%[miny,imin]=min(u);
%maxabs=max(abs(u)); % max absolut
ax=axis; % variabila care stocheaza axele
20

ax(2)=t(end);
%ax(3)=miny-maxabs/15; % spatiul de sus sa fie la fel ca
spatiul de jos in varfurile graficului
%ax(4)=maxy+maxabs/15;
axis(ax); % scurtarea din dreapta a graficului
set(gca,'color',[0.4 0.4 0.8]) % culoarea interiorului
graficului

SeismicresponseoftheframeVranceaEW,M1Direction
x 10
-3

Acceleration(m/s )

3
2
1
0
-1
-2
-3

10

12

Time(sec)

21

14

16

18

20

4 Select the Up-Down earthquake component


% select the Up-Down earthquake component
uddd=vran(:,3);
h111=figure;
set(h111,'color',[0.7 0.5 0.7]) % culoarea exteriorului
graficului
h112=plot(time,uddd,[0,time(end)],[0,0]);
set(h112(1),'LineWidth',1.5,'color',[0.2 0.7 0.1]) % coloreaza
linia care defineste graficul
set(h112(2),'LineWidth',2.5,'LineStyle','-.')
h113=xlabel('Time(sec)');
set(h113,'FontName','Times','FontSize',14)
h114=ylabel('Acceleration (cm/sec^2)');
set(h114,'FontName','Times','FontSize',14)
h115=title('Vrancea Earthquake 1977, Up-Down Component');
set(h15,'FontName','Times','FontSize',18)
[maxy,imax]=max(uddd); % min and max of values
[miny,imin]=min(uddd);
maxabs=max(abs(uddd)); % max absolut
ax=axis; % variabila care stocheaza axele
ax(2)=time(end);
ax(3)=miny-maxabs/15; % spatiul de sus sa fie la fel ca spatiul
de jos in varfurile graficului
ax(4)=maxy+maxabs/15;
axis(ax); % scurtarea din dreapta a graficului
h116=text(time(imax),maxy,['-- max=',num2str(maxy),'cm/s^2 at
time=',num2str(time(imax))]); % valoarea maximului de pe grafic
cu fct num2str si timpul inregistrat
set(h116,'FontName','Times','FontSize',12)
h117=text(time(imin),miny,['-- min=',num2str(miny),'cm/s^2 at
time=',num2str(time(imin))]); % valoarea minimului de pe grafic
cu fct num2str si timpul inregistrat
set(h117,'FontName','Times','FontSize',12)
set(gca,'color',[0.4 0.4 0.8])
% Simulation of the Response to the Seismic Action
f=(diag(M)*ns'/100);
y=lsim(frame,f,time);
t=time;
u=y(:,1); % doua puncte inseamna toate liniile, o coloana
22

Vrancea Earthquake 1977, Up-Down Component


2

max=66.407cm/s attime=2.64

60

Acceleration(cm/sec )

40
20
0
-20
-40
-60
-80
-100
0

min=105.763cm/s attime=2.5
2

10

12

Time(sec)

14

16

18

20

4.a Draw The Graphic of Displacement


% Draw the Graphic of Displacement
h211=figure;
set(h211,'color',[0.7 0.5 0.7]) % culoarea exteriorului
graficului
h212=plot(t,u,[0,t(end)],[0,0]); %%%%%%%%%% poate fi si acesta
handle ex. h12=plot...
set(h212(1),'LineWidth',1.5,'color',[0.2 0.7 0.1]) % coloreaza
linia care defineste graficul
set(h212(2),'LineWidth',2.5,'LineStyle','-.')
h213=xlabel('Time(sec)');
set(h213,'FontName','Times','FontSize',14)
h214=ylabel('Displacement(m)');
set(h214,'FontName','Times','FontSize',14)
h215=title('Seismic response of the frame Vrancea UD, M1
direction');
set(h215,'FontName','Times','FontSize',18)

23

%[maxy,imax]=max(u); % min and max of values


%[miny,imin]=min(u);
%maxabs=max(abs(u)); % max absolut
ax=axis; % variabila care stocheaza axele
ax(2)=t(end);
%ax(3)=miny-maxabs/15; % spatiul de sus sa fie la fel ca
spatiul de jos in varfurile graficului
%ax(4)=maxy+maxabs/15;
axis(ax); % scurtarea din dreapta a graficului
set(gca,'color',[0.4 0.4 0.8]) % culoarea interiorului
graficului
ud=y(:,2); % doua puncte inseamna toate liniile, o coloana

SeismicresponseoftheframeVranceaUD,M1direction
x 10
-3

Displacement(m)

6
4
2
0
-2
-4
-6

10

12

Time(sec)

24

14

16

18

20

4.b Draw The Graphic of Velocity


% Draw the Graphic of Velocity
h311=figure;
set(h311,'color',[0.7 0.5 0.7]) % culoarea exteriorului
graficului
h312=plot(t,ud,[0,t(end)],[0,0]); %%%%%%%%%%
set(h312(1),'LineWidth',1.5,'color',[0.2 0.7 0.1]) % coloreaza
linia care defineste graficul
set(h312(2),'LineWidth',2.5,'LineStyle','-.')
h313=xlabel('Time(sec)');
set(h313,'FontName','Times','FontSize',14)
h314=ylabel('Velocity(m/s)');
set(h314,'FontName','Times','FontSize',14)
h315=title('Seismic response of the frame Vrancea UD, M1
direction');
set(h315,'FontName','Times','FontSize',18)

%[maxy,imax]=max(u); % min and max of values


%[miny,imin]=min(u);
%maxabs=max(abs(u)); % max absolut
ax=axis; % variabila care stocheaza axele
ax(2)=t(end);
%ax(3)=miny-maxabs/15; % spatiul de sus sa fie la fel ca
spatiul de jos in varfurile graficului
%ax(4)=maxy+maxabs/15;
axis(ax); % scurtarea din dreapta a graficului
set(gca,'color',[0.4 0.4 0.8]) % culoarea interiorului
graficului
udd=y(:,3); % doua puncte inseamna toate liniile, o coloana

25

SeismicresponseoftheframeVranceaUD,M1direction
x 10
-3

6
5
4

Velocity(m/s)

3
2
1
0
-1
-2
-3
-4

10

12

Time(sec)

26

14

16

18

20

4.c Draw The Graphic of Acceleration


% Draw the Graphic of Acceleration
h411=figure;
set(h411,'color',[0.7 0.5 0.7]) % culoarea exteriorului
graficului
h412=plot(t,udd,[0,t(end)],[0,0]); %%%%%%%%%%
set(h412(1),'LineWidth',1.5,'color',[0.2 0.7 0.1]) % coloreaza
linia care defineste graficul
set(h412(2),'LineWidth',2.5,'LineStyle','-.')
h413=xlabel('Time(sec)');
set(h413,'FontName','Times','FontSize',14)
h414=ylabel('Acceleration(m/s^2)');
set(h414,'FontName','Times','FontSize',14)
h415=title('Seismic response of the frame Vrancea UD, M1
Direction');
set(h415,'FontName','Times','FontSize',18)

%[maxy,imax]=max(u); % min and max of values


%[miny,imin]=min(u);
%maxabs=max(abs(u)); % max absolut
ax=axis; % variabila care stocheaza axele
ax(2)=t(end);
%ax(3)=miny-maxabs/15; % spatiul de sus sa fie la fel ca
spatiul de jos in varfurile graficului
%ax(4)=maxy+maxabs/15;
axis(ax); % scurtarea din dreapta a graficului
set(gca,'color',[0.4 0.4 0.8]) % culoarea interiorului
graficului

27

SeismicresponseoftheframeVranceaUD,M1Direction
x 10
-3

Acceleration(m/s )

3
2
1
0
-1
-2
-3

10

12

Time(sec)

28

14

16

18

20

You might also like