One dimensional soil consolidation using spectral method