MATLAB Examples

# Chopra (2012): Shock response spectrum of rectangular pulse excitation

## Initial definitions

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

Set the time step of the rectangular pulse.

dt=0.0001; 

Set the duration of the rectangular pulse.

td=100*dt; 

Set the peak acceleration value of the rectangular pulse.

p0=50; 

Set the input acceleration time history (). A rectangular pulse acceleration time history is defined with maximum input acceleration equal to and duration (forced vibration phase) for the time period from to . After the rectangular pulse, zero acceleration is specified for time period from to (free vibration phase).

t=(0:dt:100*td)'; xgtt=[0;p0*ones(round(td/dt),1);zeros(99*round(td/dt),1)]; 

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

T=10.^(0:1/1000*log10(td/5):log10(td/5))'; 

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

ksi=0; 

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; 

Plot the input rectangular pulse excitation.

figure('Name','Rectangular pulse excitation','NumberTitle','off') plot(t(1:round(2*td/dt)),xgtt(1:round(2*td/dt)),'LineWidth',2.) grid on xlabel('t','FontSize',13); ylabel('a_g','FontSize',13); title('Rectangular pulse excitation','FontSize',13) 

## Processing

Find the spectral displacement of an undamped SDOF system with eigenperiod using default parameters.

T0=2; [~,~,Sd0,~,~]=LERS(dt,xgtt,T0,0); 

Calculation of elastic response spectra and pseudospectra using nondefault parameters.

[PSa,PSv,Sd,Sv,Sa]=LERS(dt,xgtt,T,ksi); 

## Post processing

Plot displacement spectrum.

figure('Name','Spectral Displacement','NumberTitle','off') plot(T,Sd,'LineWidth',2.) grid on xlabel('T_n','FontSize',13); ylabel('S_D','FontSize',13); title('Displacement Spectrum','FontSize',13) 

Plot velocity spectrum.

figure('Name','Spectral Velocity','NumberTitle','off') semilogx(T,Sv,'LineWidth',2.) grid on xlabel('T_n','FontSize',13); ylabel('S_V','FontSize',13); title('Velocity Spectrum','FontSize',13) 

Plot acceleration spectrum.

figure('Name','Spectral Acceleration','NumberTitle','off') semilogx(T,Sa,'LineWidth',2.) grid on xlabel('T_n','FontSize',13); ylabel('S_A','FontSize',13); title('Acceleration Spectrum','FontSize',13) 

Plot pseudo-velocity spectrum.

figure('Name','Pseudo Velocity Spectrum','NumberTitle','off') semilogx(T,PSv,'LineWidth',2.) grid on xlabel('T_n','FontSize',13); ylabel('PS_V','FontSize',13); title('Pseudo Velocity Spectrum','FontSize',13) 

Plot pseudo-acceleration spectrum.

figure('Name','Pseudo Acceleration Spectrum','NumberTitle','off') semilogx(T,PSa,'LineWidth',2.) grid on xlabel('T_n','FontSize',13); ylabel('PS_A','FontSize',13); title('Pseudo Acceleration Spectrum','FontSize',13) 

## Validation

• Verification of the value of Sd0 (spectral displacement of an undamped SDOF with eigenperiod using default parameters).

Calculate the static deformation.

ust00=p0*T0^2/(4*pi^2); 

For rectangular pulse the following applies

if td<T0/4 Sd0ver=ust00*2*pi*td/T0 end 
Sd0ver = 0.1592 

Check with Sd0

Sd0 
Sd0 = 0.1591 
• Verification of the shock response spectrum of the rectangular pulse.

Calculate the static deformation.

ust0=p0*T.^2/(4*pi^2); 

Plot the spectrum

figure('Name','Shock Response Spectrum','NumberTitle','off') plot(td./T,Sd./ust0,'LineWidth',2.) grid on xlabel('t_d/T_n','FontSize',13); ylabel('R_d=S_D/(u_s_t)_0','FontSize',13); title('Shock Response Spectrum','FontSize',13) 

Original figure 4.7.3 of Chopra (Dynamics of Structures, 2012).