clc; t=40*1e-2; //pulse covers 2x distance in arriving back //so, 30*1e-6=2*x/v //and, 2nd pulse will cover a distance of 2*40 cm in 80*1e-6 seconds //therfore, 80*1e-6=(2*40*1e-2)/v //compare both equation e1=30; e2=40*2 x=e1*t*2/(2*e2); disp(+'m',x,'distanc of the flow from near end =')