Skip to content

Instantly share code, notes, and snippets.

@anielsen001
Created August 22, 2019 12:28
Show Gist options
  • Save anielsen001/f0f03f0a77ddfcdf04bc4906273d2a47 to your computer and use it in GitHub Desktop.
Save anielsen001/f0f03f0a77ddfcdf04bc4906273d2a47 to your computer and use it in GitHub Desktop.
Generate skin depths in copper and aluminum as a function of frequency
"""
Permeabilities can be found here:
https://www.engineeringtoolbox.com/permeability-d_1923.html
Resistivity can be found here:
http://hyperphysics.phy-astr.gsu.edu/hbase/Tables/rstiv.html
"""
import numpy as np
from numpy import pi
import pandas as pd
import seaborn as sns
from matplotlib import pylab as plt
plt.ion()
# magnetic permeability of free space
mu_0 = 4*pi*1e-7 # Henry/meter
def skin_depth( resistivity, # Ohms per meter
frequency, # Hertz
permeability ): # Henry/meter
delta = np.sqrt( resistivity/pi/frequency/permeability )
return delta
class Metal(object):
"""
abstract class to hold material properties
"""
resistivity = None
permeability = None
def __init__(self):
pass
@classmethod
def skin_depth(self, frequency):
return skin_depth( self.resistivity,
frequency,
self.permeability )
class Copper(Metal):
resistivity = 1.68e-8 # Ohm/meter
permeability = 1.256629e-6 # Henry/meter
def __init__(self):
pass
class Aluminum(Metal):
resistivity = 2.65e-8 # Ohm/meter
permeability = 1.256665e-6 # Henry/meter
def __init__(self):
pass
# generate a range of frequencies and plot the skin depth
# as a function of frequency
df = pd.DataFrame( columns = ['freq', 'Cu', 'Al' ])
df['freq'] = np.logspace(8, 12, num=100) # Hertz
df['Cu'] = Copper.skin_depth(df['freq'])
df['Al'] = Aluminum.skin_depth(df['freq'])
plt.figure(10)
plt.clf()
plt.loglog( df['freq']/1e9, df['Cu']/1e-6 )
plt.loglog( df['freq']/1e9, df['Al']/1e-6 )
plt.grid()
plt.xlabel('Freq [GHz]')
plt.ylabel('Skin depth [micron]')
plt.legend( ['Cu', 'Al'] )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment