Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #rutenburgs stuff, doubling N
  2. for a in arange(8):
  3. N1 = N1*2
  4. print N1
  5. for i in arange(N1):
  6. x1 = random()
  7. y1 = random()
  8. z1 = random()
  9. a1 = random()
  10. b1 = random()
  11. c1 = random()
  12. d1 = random()
  13. e1 = random()
  14. f1 = random()
  15. g1 = random()
  16. variable1 = x1**2.0+y1**2.0+z1**2.0+a1**2.0+b1**2.0+c1**2.0+d1**2.0+e1**2.0+f1**2.0+g1**2.0
  17. if variable1 <= 1.0:
  18. count1 += 1.0
  19. I1 = cube/N1*count1
  20. print I1
  21. #I dont know why this isnt working....
  22.  
  23. Nlist.append(N1)
  24. Ilist.append(I1)
  25.  
  26. print Ilist
  27.  
  28. plot(Ilist,Nlist)
  29. xlabel("Volume")
  30. ylabel("Number of iterations")
  31. show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement