Application of variational calculus to propagation of coupled pulses in optical fibers