Advertisement
Geometrian

Inductor Calculator

Jan 31st, 2018
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. from math import *
  2.  
  3.  
  4. density = 11340.0 #lead
  5.  
  6. breakdown_amps = 4e8 #1e9 with future tech
  7.  
  8. mu0 = 1.2566370614e-6
  9.  
  10. def inductor( area_wire, diameter_coil, turns ):
  11.     current = area_wire * breakdown_amps
  12.  
  13.     #radius_wire = (area_wire/pi)**0.5 #circular
  14.     radius_wire = (area_wire ** 0.5)*0.5 #square
  15.     radius_coil = 0.5*diameter_coil - 0.5*radius_wire
  16.     #square coil
  17.     #length = 4.0*(area_coil**0.5) * turns
  18.     #circular coil
  19.     length = 2.0*pi*radius_coil * turns
  20.     area_coil = pi * radius_coil*radius_coil
  21.    
  22.     mass = length * area_wire * density
  23.    
  24.     energy = mu0 * turns*turns * area_coil * current*current / (2.0*length)
  25.    
  26.     print("Mass:   %f\nEnergy: %f\nLength: %f,\nCurrent: %f"%(mass,energy,length,current))
  27.  
  28. inductor( 0.01*0.01, 0.1, 10 )
  29. inductor( 0.0002, 1.0, 500 )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement