Excel VBA (Macro)Sample Programming Codes

Macro for computation of acceleration, velocity and displacement response spectra

 

The VBA macro implemented in the enclosed spreadsheet calculates: (1) the time histories of velocity and displacement of the input acceleration time history, and (2) the spectral responses of acceleration (Sa), velocity (Sv), and displacement (Sd). The code is formulated based on the Newmark-bata numerical integration method. Note that C++ format of this code is also available here in this link.

You can download the spreadsheet here:  Calculate_Response_Spectrum.xlsm

The code is verified and validated, however it is  recommended that you carry out your own sanity check.

I look forward to hearing your feedback.

Note:
Compared to the C++ version posted in this link, the VBA macro can be much slower especially for long duration ground motions. 

Leave a Reply

Your email address will not be published. Required fields are marked *