#Simulating falling (without air resistance)
t=0 #initial time in seconds
x=0 #initial depth in meters
v=0 #initial velocity in meters/second
dt=.1 #small time step
a=9.8 #constant acceleration of 9.8 m/s^2
print 'simulated (t, x, v), exact (t, x, v)'
print t, x, v
for i in range(30):
dv = a * dt #a = dv/dt (exact as limit dt-->0)
v = v + dv #dv is approximately delta v
#but when a is constant, it's exact
dx = v * dt #v = dx/dt (exact as limit dt-->0)
#v is not constant, so not exact
x = x + dx #dx is approximatly delta x
t = t + dt
print (round(t,4), round(x,4), round(v,4)),
print (round(t,4), round(.5 * a * t**2,4), round(a * t,4))