PROGRAM free_fall ! no air resistance CALL initial(y,v,a,g,t,dt) ! initial conditions and parameters CALL print_table(y,v,a,t,nshow) ! print initial conditions LET counter = 0 DO while y >= 0 CALL Euler(y,v,a,g,t,dt) LET counter = counter + 1 IF mod(counter,nshow) = 0 then CALL print_table(y,v,a,t,nshow) END IF LOOP CALL print_table(y,v,a,t,nshow) ! print values at surface END SUB initial(y,v,a,g,t,dt) LET t = 0 ! initial time (sec) LET y = 10 ! initial height (m) LET v = 0 ! initial velocity LET g = 9.8 ! (magnitude) of accel due to gravity LET a = -g INPUT prompt "time step dt = ": dt END SUB SUB Euler(y,v,a,g,t,dt) LET y = y + v*dt ! use velocity at beginning of interval ! following included to remind us that acceleration is constant LET a = -g ! y positive upward LET v = v + a*dt LET t = t + dt END SUB SUB print_table(y,v,a,t,nshow) IF t = 0 then INPUT prompt "number of time steps between output = ": nshow CLEAR ! might want to omit this graphics statement PRINT "time (s)", "y (m)", "velocity (m/s)", "accel (m/s^2)" PRINT END IF PRINT t,y,v,a END SUB