Inverse method for the reconstruction of refractive index profile and power management in gradient index optical waveguides