Here is a Matlab script that performs this calculation for enforced acceleration for the case of modal damping. The script converts the system to an uncoupled system via the normal modes for a modal transient analysis.