Inaccuracy problems with resistive background and closer to Tx.

Need to be tackled.
This commit is contained in:
seogi
2014-04-08 18:48:16 -07:00
parent beb2fa1a58
commit 8326c50d56
+23 -12
View File
@@ -3,16 +3,17 @@ from SimPEG import *
import simpegEM as EM
from scipy.constants import mu_0
from simpegEM.Utils.Ana import hzAnalyticDipoleT
import matplotlib.pyplot as plt
class TDEM_bTests(unittest.TestCase):
def setUp(self):
cs = 5.
ncx = 20
ncy = 6
cs = 10.
ncx = 15
ncy = 10
npad = 20
hx = Utils.meshTensors(((0,cs), (ncx,cs), (npad,cs)))
hx = Utils.meshTensors(((0,cs), (ncx,cs), (npad,cs)))
hy = Utils.meshTensors(((npad,cs), (ncy,cs), (npad,cs)))
mesh = Mesh.Cyl1DMesh([hx,hy], -hy.sum()/2)
@@ -23,27 +24,37 @@ class TDEM_bTests(unittest.TestCase):
opts = {'txLoc':0.,
'txType':'VMD_MVP',
'rxLoc':np.r_[150., 0.],
'rxLoc':np.r_[30., 0.],
'rxType':'bz',
'timeCh':np.logspace(-4,-2,20),
'timeCh':np.logspace(-4,-2.5, 21),
}
self.dat = EM.TDEM.SurveyTDEM1D(**opts)
self.dat = EM.TDEM.SurveyTDEM1D(**opts)
self.prb = EM.TDEM.ProblemTDEM_b(model)
self.prb.setTimes([1e-5, 5e-5, 2.5e-4], [150, 150, 150])
self.prb.setTimes([1e-6, 5e-6, 1e-5, 5e-5, 1e-4, 5e-4], [40, 40, 40, 40, 40, 40])
self.sigma = np.ones(mesh.nCz)*1e-8
self.sigma[mesh.vectorCCz<0] = 1e-1
self.sigma[mesh.vectorCCz<0] = 1e-3
self.sigma = np.log(self.sigma[active])
self.showIt = True
self.prb.pair(self.dat)
def test_analitic_b(self):
bz_calc = self.dat.dpred(self.sigma)
bz_ana = mu_0*hzAnalyticDipoleT(self.dat.rxLoc[0], self.prb.times, np.exp(self.sigma[0]))
ind = self.prb.times > 1e-5
diff = np.linalg.norm(bz_calc[ind].flatten() - bz_ana[ind].flatten())/np.linalg.norm(bz_ana[ind].flatten())
if self.showIt == True:
plt.loglog(self.prb.times[bz_calc>0], bz_calc[bz_calc>0], 'b', self.prb.times[bz_calc<0], -bz_calc[bz_calc<0], 'b--')
plt.loglog(self.prb.times, abs(bz_ana), 'b*')
plt.xlim(1e-5, 1e-2)
plt.show()
print diff
self.assertTrue(diff < 0.10)
diff = np.linalg.norm(bz_calc.flatten() - bz_ana.flatten())/np.linalg.norm(bz_ana.flatten())
self.assertTrue(diff<0.05)
if __name__ == '__main__':