Analysis and control of unsteady flow in pipelines