Write exact solution for collapse1d problem