Advertisement
Guest User

square wave list making

a guest
Oct 16th, 2015
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import math
  2.  
  3. def kecur(rad):
  4. return 1.50335 * (10 ** - 10) * (- 1 + math.sqrt(1 + 0.146603 * rad ** 2))
  5.  
  6.  
  7. def timearound(rad):
  8. return 2.73682 * (10 ** - 8) * math.sqrt(1 + 0.146603 * rad ** 2)
  9.  
  10.  
  11. def radfromke(ke):
  12. return 427.933 * math.sqrt(ke) * math.sqrt(495534. + 1.6481 * (10 ** 15) * ke)
  13.  
  14.  
  15. q = 1.60 * (10 ** -19)
  16. vol = 5000
  17. kdiff = q * vol
  18. rad = .15
  19. r = radfromke(kdiff)
  20. t = 0
  21. print(t)
  22. f = open("swaptimes.txt","w")
  23. while (r < rad):
  24. t = t + (timearound(r) / 2)
  25. r = radfromke(kecur(r) + kdiff)
  26. t = t + (timearound(t) / 2)
  27. print(t)
  28. f.write(str(t)+"\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement