Dynamical switching of an electromagnetically driven compliant bistable mechanism