Multimodal system for harvesting magnetic and mechanical energy