Electroabsorption and nonlinear optical constants of trans-polyacetylene and poly(3-hexylthiophene)