logancberrypie

Untitled

Feb 17th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. V1 = [0,2.08914,2.09140,2.61142,1.87594,2.01939,3.04507,2.43586,2.85422,2.40610,2.2348,2.10261,3.06490,3.02176,3.15124,3.52609,4.01823,4.48565,3.41086,3.23834,3.82458]
  2. d = [0,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.4,0.4,0.4,0.4,0.6,0.6,0.6,0.6,0.6]
  3. a = []
  4. total = 0
  5. calc = 0
  6.  
  7. for i in range(0,len(V1)):
  8. for j in range(i+1,len(V1)):
  9. if (d[i] != d[j] and d[i] != 0):
  10. calc += 1
  11. temp = (V1[j]**2 - V1[i]**2) / (2*(d[j]-d[i]))
  12. total += temp
  13. a.append(temp)
  14.  
  15. print(total/calc)
Advertisement
Add Comment
Please, Sign In to add comment