A Barrier Certificate-based Simplex Architecture for Systems with Approximate and Hybrid Dynamics