Free and forced response of nearly periodic multi-span beams and multi-bay trusses