From 97d36f1796c76b35d4b06b6e57b4b31cdb8e40f4 Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Mon, 8 Feb 2016 18:20:08 +0000 Subject: [PATCH] Constants now imported from scipy. --- gprMax/constants.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/gprMax/constants.py b/gprMax/constants.py index 438ed5b1..16ec223b 100644 --- a/gprMax/constants.py +++ b/gprMax/constants.py @@ -17,6 +17,12 @@ # along with gprMax. If not, see . import numpy as np +from scipy.constants import c +from scipy.constants import mu_0 as m0 +from scipy.constants import epsilon_0 as e0 + +# Impedance of free space (Ohms) +z0 = np.sqrt(m0 / e0) # Data types: # Solid and ID arrays use 32-bit integers (0 to 4294967295) @@ -25,16 +31,4 @@ import numpy as np # Main field arrays use floats (floattype) and complex numbers (complextype) floattype = np.float32 -complextype = np.complex64 - -# Speed of light in vacuum (m/s) -c = 2.9979245e8 - -# Permittivity of free space (F/m) -e0 = 8.854187e-12 - -# Permeability of free space (H/m) -m0 = 1.256637e-6 - -# Impedance of free space (Ohms) -z0 = 376.7303134 \ No newline at end of file +complextype = np.complex64 \ No newline at end of file