Study on reverse calculation for unidirectional waves from shallow water