Advertisement
maple-tac

Magnetic Field A-B Difference Code 2 with iteration output

Apr 24th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.94 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.                 print('wft-4',Z)
  13.         return(mycathie2(wad(x,y),n))
  14.  
  15. def mycathie2(n,d):
  16.         out=(mycathie(wad(n,y),d))
  17.         print('mycathie2-2',out)
  18.         return(out)
  19.  
  20. def wad(n,f):
  21.         out=(f/6480)**(n-1)
  22.         print('wad-1',out)
  23.         return(out)
  24.  
  25. def mycathie(c,d):
  26.         out=((1/c)**(-3/2)+cos(radians(d))*c)
  27.         print('mycathie-3',out)
  28.         return(out)
  29.  
  30.  
  31.  
  32. # EXECUTING:
  33.  
  34. y=29 # shouldnt but must be defined to work.
  35.  
  36. x=wft(8,29) # starting the chain of events. 8 is depth of calculation.
  37.             # 29 is as in 29 above i thought.
  38.  
  39.  
  40. z=(sqrt(x)*2.572173)**2 #converting measures
  41.  
  42.  
  43. print(z,"megnetic lines per square geodetic inch in difference")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement