MATLAB Examples

## Contents

clear all close all clc 

## Statement of the problem

• Chopra (2012), Example 10.6: Figure 9.5.1 shows the plan view of a one-story building. The structure consists of a roof, idealized as a rigid diaphragm, supported on three frames, A, B, and C, as shown. The roof weight is uniformly distributed and has a magnitude of . The lateral stiffnesses of the frames are for frame A, and for frames B and C. The plan dimensions are and , the eccentricity is , and the height of the building is . Determine the natural periods and modes of vibration of the structure.
• Chopra (2012), Example 13.12: Determine the peak values of the response of the one-story unsymmetric-plan system of Examples 13.7 and 10.6 with modal damping ratios to the El Centro ground motion in the y-direction, directly from the response spectrum for this ground motion.

## Initialization of structural input data

Set the dimensions of the rigid slab (ft).

b=30; d=20; 

Set the height of the building (ft).

h=12; 

Set the eccentricity (ft).

e=1.5; 

Set the lateral stiffnesses of the frames (kips/ft).

ky=75; kx=40; 

Set the mass of the slab (kips*sec^2/ft).

m=1.863; 

Set the moment of inertia of the roof about its center of mass (kips*ft*sec^2).

Io=m*(b^2+d^2)/12; 

## Calculation of structural properties

Calculate the stiffness matrix of the structure according to eq.(9.5.17).

K=[2*kx,0,0;0,ky,e*ky;0,e*ky,e^2*ky+(d^2/2)*kx]; 

Calculate the mass matrix of the structure.

M=[m,0,0;0,m,0;0,0,Io]; 

Calculate the length of the semi-diagonal.

rbd=sqrt(b^2+d^2)/2; 

Set the spatial distribution of the effective earthquake forces. Earthquake forces are applied only at dof No 2 of the structure.

r=[0;1;0]; 

## Calculation of response spectrum ordinates

Open file elcentro.dat.

fid=fopen('elcentro.dat','r'); 

Read the text contained in the file elcentro.dat.

text=textscan(fid,'%f %f'); 

Close file elcentro.dat.

fclose(fid); 

Set the time step of the input acceleration time history.

time=text{1,1}; dt=time(2)-time(1); 

Set the input acceleration time history () in ft/sec^2.

xgtt=9.81*3.281*text{1,2}; 

Set the critical damping ratio of the response spectra to be calculated ()

ksi=0.05; 

Dynamic Response Spectrum Analysis

[U,V,A,f,omega,Eigvec] = DRSA(K,M,r,dt,xgtt,ksi); 

Set the number of eigenmodes of the structure.

neig=numel(omega); 

Plot the natural modes of vibration of the structure

FigHandle=figure('Name','Natural Modes','NumberTitle','off'); set(FigHandle,'Position',[50, 50, 1000, 500]); for i=1:neig subplot(1,neig,i) plot([0;b;b;0;0],[0;0;d;d;0],'LineWidth',2.,'Marker','.',... 'MarkerSize',20,'Color',[0 0 1],'markeredgecolor','k'); hold on phi=10*Eigvec(3,i); plot([10*Eigvec(1,i)+(rbd*sin(phi)*cos(pi/4+phi/2)/cos(phi/2)); b+10*Eigvec(1,i)+(rbd*sin(phi)*cos(pi/4+phi/2)/cos(phi/2)); b+10*Eigvec(1,i)-(rbd*sin(phi)*cos(pi/4+phi/2)/cos(phi/2)); 10*Eigvec(1,i)-(rbd*sin(phi)*cos(pi/4+phi/2)/cos(phi/2)); 10*Eigvec(1,i)+(rbd*sin(phi)*cos(pi/4+phi/2)/cos(phi/2))],... [10*Eigvec(2,i)-(rbd*sin(phi)*sin(pi/4+phi/2)/cos(phi/2)); 10*Eigvec(2,i)+(rbd*sin(phi)*sin(pi/4+phi/2)/cos(phi/2)); d+10*Eigvec(2,i)+(rbd*sin(phi)*sin(pi/4+phi/2)/cos(phi/2)); d+10*Eigvec(2,i)-(rbd*sin(phi)*sin(pi/4+phi/2)/cos(phi/2)); 10*Eigvec(2,i)-(rbd*sin(phi)*sin(pi/4+phi/2)/cos(phi/2))],... 'LineWidth',2.,'Marker','.','MarkerSize',20,'Color',[1 0 0],... 'markeredgecolor','k'); hold off axis equal grid on title(['Mode ',num2str(i)],'FontSize',13) end 

Compare the eigenmodes with those shown in Figure E10.6. in Chopra (2012).

Convert peak modal displacements from ft to inch. Only displacements are multiplied. The rotation angles are given in rad.

U(1:2,:)=12*U(1:2,:); 

Calculate the peak modal base shear of frame A (kips).

VbA=zeros(1,neig); for i=1:neig VbA(i)=[0 ky e*ky]*U(:,i); end VbA 
VbA = 157.5917 0 156.6312 

Calculate the peak modal base shear of frame B (kips).

VbB=zeros(1,neig); for i=1:neig VbB(i)=[kx 0 -d/2*kx]*U(:,i); end VbB 
VbB = 6.6835 0 -6.7320 

## Verification of table E13.12a of Chopra (Dynamics of Structures, 2012)

Compare the peak modal responses with those shown in table E13.12a in Chopra (2012). Mode 1 corresponds to translation in y direction (here as mode 1) and mode 2 corresponds to rotation about z axis (here as mode 3).

## Modal combination with the ABSolute SUM (ABSSUM) method.

Peak displacement in y direction (inch).

uyAbsSum=ABSSUM(U(2,:)); 

uthAbsSum=ABSSUM(U(3,:)); 

Peak base shear of the whole structure (kips).

VbAbsSum=ABSSUM(f(2,:)); 

Peak base torsional moment of the whole structure (kips*ft).

TbAbsSum=ABSSUM(f(3,:)); 

Peak base shear of frame A (kips).

VbAAbsSum=ABSSUM(VbA); 

Peak base shear of frame B (kips).

VbBAbsSum=ABSSUM(VbB); 

## Modal combination with the Square Root of Sum of Squares (SRSS) method.

Peak displacement in y direction (inch).

uySRSS=SRSS(U(2,:)); 

uthSRSS=SRSS(U(3,:)); 

Peak base shear of the whole structure (kips).

VbSRSS=SRSS(f(2,:)); 

Peak base torsional moment of the whole structure (kips*ft).

TbSRSS=SRSS(f(3,:)); 

Peak base shear of frame A (kips).

VbASRSS=SRSS(VbA); 

Peak base shear of frame B (kips).

VbBSRSS=SRSS(VbB); 

## Modal combination with the Complete Quadratic Combination (CQC) method.

Peak displacement in y direction (inch).

uyCQC=CQC(U(2,:),omega,ksi); 

uthCQC=CQC(U(3,:),omega,ksi); 

Peak base shear of the whole structure (kips).

VbCQC=CQC(f(2,:),omega,ksi); 

Peak base torsional moment of the whole structure (kips*ft).

TbCQC=CQC(f(3,:),omega,ksi); 

Peak base shear of frame A (kips).

VbACQC=CQC(VbA,omega,ksi); 

Peak base shear of frame B (kips).

VbBCQC=CQC(VbB,omega,ksi); 

## Assemble values of peak response in a table.

Assemble values of peak response in a cell.

C{1,2}='uy (in)'; C{1,3}='(b/2)uth (in)'; C{1,4}='Vb (kips)'; C{1,5}='Tb (kip-ft)'; C{1,6}='VbA (kips)'; C{1,7}='VbB (kips)'; C{2,1}='ABSSUM'; C{2,2}=uyAbsSum; C{2,3}=(b/2)*uthAbsSum*12; C{2,4}=VbAbsSum; C{2,5}=TbAbsSum; C{2,6}=VbAAbsSum; C{2,7}=VbBAbsSum; C{3,1}='SRSS'; C{3,2}=uySRSS; C{3,3}=(b/2)*uthSRSS*12; C{3,4}=VbSRSS; C{3,5}=TbSRSS; C{3,6}=VbASRSS; C{3,7}=VbBSRSS; C{4,1}='CQC'; C{4,2}=uyCQC; C{4,3}=(b/2)*uthCQC*12; C{4,4}=VbCQC; C{4,5}=TbCQC; C{4,6}=VbACQC; C{4,7}=VbBCQC; C 
C = Columns 1 through 5 [] 'uy (in)' '(b/2)uth (in)' 'Vb (kips)' 'Tb (kip-ft)' 'ABSSUM' [ 4.1895] [ 6.0370] [ 26.1977] [ 273.3793] 'SRSS' [ 2.9627] [ 4.2688] [ 18.6780] [ 195.3940] 'CQC' [ 3.4061] [ 3.5154] [ 21.3886] [ 162.5222] Columns 6 through 7 'VbA (kips)' 'VbB (kips)' [ 314.2229] [ 13.4156] [ 222.1902] [ 9.4863] [ 255.4536] [ 7.8121] 

## Verification of table E13.12b of Chopra (Dynamics of Structures, 2012)

Compare the peak responses with those shown in table E13.12b of Chopra (2012).