Coupled mode formulation for directional couplers with longitudinal perturbation