tronds

Physics - Find v and t values

Sep 20th, 2012
310
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.65 KB | None | 0 0
  1. time = [0.1059,0.2060,0.3061,0.4062,0.5063,0.6064,0.7065,0.8066,0.9067,1.0068,1.1069,1.2069,1.3066,1.4063,1.5060,1.6057,1.7054,1.8051,1.9049,2.0047,2.1045,2.2043,2.3042,2.4040,2.5039,2.6039,2.7038,2.8038,2.9038,3.0039,3.1040,3.2041,3.3042,3.4043,3.5044,3.6045,3.7046,3.8047,3.9048,4.0049,4.1050,4.2052,4.3054,4.4057,4.5059,4.6062,4.7065,4.8068,4.9072,5.0075,5.1079,5.2083,5.3087,5.4092,5.5096,5.6101,5.7106,5.8111,5.9116,6.0119,6.1121,6.2122,6.3123,6.4123,6.5124,6.6125,6.7126,6.8127,6.9128,7.0129,7.1130,7.2131,7.3132,7.4133,7.5134]
  2. position = [1.009,1.008,1.005,1.003,1.001,1.001,1.001,1.003,1.006,1.008,1.003,0.979,0.921,0.846,0.774,0.705,0.640,0.579,0.521,0.467,0.416,0.370,0.326,0.289,0.252,0.222,0.200,0.179,0.162,0.165,0.163,0.156,0.155,0.154,0.154,0.153,0.155,0.160,0.165,0.161,0.165,0.182,0.199,0.222,0.249,0.283,0.316,0.358,0.397,0.442,0.490,0.541,0.596,0.653,0.713,0.777,0.843,0.912,0.980,1.014,1.030,1.035,1.032,1.028,1.026,1.027,1.028,1.028,1.027,1.026,1.024,1.023,1.023,1.023,1.022]
  3.  
  4. newtime = []
  5. v = []
  6. #count = 1
  7.  
  8. while len(time) >1:
  9.         numtime = (time[0]+time[1])/int(2)
  10.         numpos = (position[1]-position[0])/(time[1]-time[0])
  11.  
  12.         #lets round them up
  13.         numtime = "%.5f" % numtime
  14.         numpos = "%.5f" % numpos
  15.         #and append to array
  16.         newtime.append(numtime)
  17.         v.append(numpos)
  18.         time.pop(0)#remove first in array
  19.         position.pop(0)
  20.         #print count #debug
  21.         #count = count+1
  22. #print "New time list is", newtime
  23. #print "v list is", v
  24. for x in range(len(v)):
  25.         print newtime[x], v[x]
  26. if len(v) != len(newtime):
  27.                  print "Unequal length of arrays"
  28. print "Job done"
Advertisement
Comments
  • Comment was deleted
Add Comment
Please, Sign In to add comment