The Eckhaus equation in an external potential