mirror of
https://github.com/wassname/simpeg.git
synced 2026-10-29 13:40:11 +08:00
more reliable way of taking the sqrt of a complex number in defn of k
This commit is contained in:
1 parent
1240d65eaf
commit
678d8611d8
1 file changed
+4
-1
@@ -7,8 +7,11 @@ def omega(freq):
|
||||
return 2.*np.pi*freq
|
||||
|
||||
def k(freq, sigma, mu=mu_0, eps=epsilon_0):
|
||||
""" Eq 1.47 - 1.49 in Ward and Hohmann """
|
||||
w = omega(freq)
|
||||
return np.sqrt(mu * eps * w**2 - 1j * w* mu * sigma)
|
||||
alp = w * np.sqrt( mu*eps/2 * ( np.sqrt(1. + (sigma / (eps*w))**2 ) + 1) )
|
||||
beta = w * np.sqrt( mu*eps/2 * ( np.sqrt(1. + (sigma / (eps*w))**2 ) - 1) )
|
||||
return alp - 1j*beta
|
||||
|
||||
# Constitutive relations
|
||||
def e_from_j(prob,j):
|
||||
|
||||
Reference in new issue
Block a user