Synthesis and characterization of two series of polyimides as nonlinear optical materials