Variational approximations to homoclinic snaking.