Advertisement
maple-tac

Magnetic Field A-B Difference Code

Apr 21st, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. # IMPORTING FUNCTIONS FOR USE
  2.  
  3. from math import cos
  4. from math import radians
  5. from math import sqrt
  6.  
  7. # DEFINING OWN FUNCTIONS. IT'S A TANGLED MESS
  8.  
  9. def wft(n,y):
  10.         for x in range(1,n):
  11.                 Z=mycathie2(wad(x,y),n)
  12.         return(mycathie2(wad(x,y),n))
  13.  
  14. def mycathie2(n,d):
  15.     return(mycathie(wad(n,y),d))
  16.  
  17. def wad(n,f):
  18.         return(f/6480)**(n-1)
  19.  
  20. def mycathie(c,d):
  21.         return((1/c)**(-3/2)+cos(radians(d))*c)
  22.  
  23.  
  24.  
  25. # EXECUTING:
  26.  
  27. y=29 # shouldnt but must be defined to work.
  28.  
  29. x=wft(8,29) # starting the chain of events. 8 is depth of calculation.
  30.             # 29 is as in 29 above i thought.
  31.  
  32. print("Difference between field A and B;",x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement