MATLAB Examples

# Clough & Penzien: Elcentro earthquake (California, May 18, 1940, NS component)

## Initial definitions

The following initial definitions are made (in the order presented below):

Open file elcentro.dat.

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

Read the text contained in the accelerogram 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 ().

xgtt=text{1,2}; 

Set the eigenperiod range for which the response spectra will be calculated.

Tspectra=logspace(log10(0.1),log10(3),1000)'; 

Set four distinct values for the critical damping ratio () of the response spectra to be calculated.

ksi1=0; ksi2=0.02; ksi3=0.2; ksi4=0.4; 

Set the minimum absolute value of the eigenvalues of the amplification. matrix

rinf=1; 

Set the algorithm to be used for the integration.

AlgID='U0-V0-Opt'; 

Set the initial displacement of all SDOF oscillators analysed.

u0=0; 

Set the initial velocity of all SDOF oscillators analysed.

ut0=0; 

## Processing

Extraction of elastic response spectra and pseudospectra for the three values of the critical damping ratio

[~,PSv1,~,~,~]=LERS(dt,xgtt,Tspectra,ksi1); [~,PSv2,~,~,~]=LERS(dt,xgtt,Tspectra,ksi2); [~,PSv3,~,~,~]=LERS(dt,xgtt,Tspectra,ksi3); [~,PSv4,~,~,~]=LERS(dt,xgtt,Tspectra,ksi4); 

## Validation

Verification of FIGURE 25-2 of Clough & Penzien (Dynamics of Structures).

Plot the four pseudo-velocity response spectra.

figure('Name','FIGURE 25-2','NumberTitle','off') plot(Tspectra,30*PSv1,'-b','LineWidth',1.) hold on plot(Tspectra,30*PSv2,'-r','LineWidth',1.) plot(Tspectra,30*PSv3,'-g','LineWidth',1.) plot(Tspectra,30*PSv4,'-m','LineWidth',1.) hold off grid on xlabel('T_n','FontSize',13); ylabel('PS_V','FontSize',13); title('FIGURE 25-2 of Clough & Penzien','FontSize',13) xlim([0,3]); legend('\xi=0','\xi=0.02','\xi=0.2','\xi=0.4') 

Original FIGURE 25-2 of Clough & Penzien (Dynamics of Structures)