Hello,
I have a two-column discrete data file with 10,000 rows. The first column is the time (t) and the second is the velocity data (v) where time increment, Delta-T = 0.0001. I am trying to find the time gradient of the velocity (dv/dt). Can someone help me with the coding below? Many thanks!
OPEN (UNIT=100, FILE=data.txt, STATUS='OLD', ACTION='READ', IOSTAT=ierr)
DO i = 1, size(y)
READ (3,*,IOSTAT=ierr) xdummy, vel(i)
if (ierr /=0) exit
END DO
n=i-1
tgrad = 0.
DO i = 1,n
tgrad = tgrad+(vel(i+1)-vel(i))/(0.0001)
if (i>n) exit
ENDDO
write(*,'Time gradient is ') tgrad/n*0.0001
CLOSE(UNIT=100, FILE=data.txt, STATUS='OLD', ACTION='WRITE', IOSTAT=ierr)