Methods for controlling positions of guided modes of photonic-crystal waveguides