c c 3414 Summer 2002 c HW4, Problem 2(a) c read *, nstep h = 2.0/nstep c h = 0.05 vcur = 16.0 print *, 'Euler' do i = 1, nstep vold = vcur tcur = h*i vcur = vold + h * f(vold) print 1000, tcur, vcur 1000 format(f5.2,f8.4) enddo stop end function f(v) c c Note that f() does not depend explicitly on t. c real m, g, k m = 0.11 g = -9.8 k = 0.002 f = g - k*v*abs(v)/m return end