A dynamic reanalysis technique for general structural modifications under deterministic or stochastic input