Memristor Circuits: Pulse Programming via Invariant Manifolds