JTvec is working but not converging.

This commit is contained in:
GudniRos
2015-06-24 12:33:08 -07:00
parent f2a8cf0a62
commit e3a2ec6c8d
3 changed files with 35 additions and 73 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ class BaseMTProblem(BaseFDEMProblem):
# Get the
dA_duIT = ATinv * PTv
dA_dmT = self.getADeriv_m(freq, u_src, dA_duIT, adjoint=True)
dRHS_dmT = self.getRHSDeriv_m(src, dA_duIT, adjoint=True)
dRHS_dmT = self.getRHSDeriv_m(freq, dA_duIT, adjoint=True)
# Make du_dmT
if dRHS_dmT is None:
du_dmT = - dA_dmT
+8 -6
View File
@@ -146,9 +146,10 @@ class RxMT(Survey.BaseRx):
Pbx = mesh.getInterpolationMat(self.locs,'Ex')
# ex = Pex*mkvc(f[src,'e_1d'],2)
# bx = Pbx*mkvc(f[src,'b_1d'],2)/mu_0
dP_de = Utils.sdiag(1./(Pbx*mkvc(f[src,'b_1d'],2)/mu_0))*(Pex*v)
dP_db = - Utils.sdiag(Pex*mkvc(f[src,'e_1d'],2))*(Utils.sdiag(1./(Pbx*mkvc(f[src,'b_1d'],2)/mu_0)).T*Utils.sdiag(1./(Pbx*mkvc(f[src,'b_1d'],2)/mu_0)))*(Pbx*f._bDeriv_u(src,v)/mu_0)
PDeriv_complex = np.sum((dP_de,dP_db))
dP_de = mkvc(Utils.sdiag(1./(Pbx*mkvc(f[src,'b_1d'],2)/mu_0))*(Pex*v),2)
dP_db = mkvc(- Utils.sdiag(Pex*mkvc(f[src,'e_1d'],2))*(Utils.sdiag(1./(Pbx*mkvc(f[src,'b_1d'],2)/mu_0)).T*Utils.sdiag(1./(Pbx*mkvc(f[src,'b_1d'],2)/mu_0)))*(Pbx*f._bDeriv_u(src,v)/mu_0),2)
PDeriv_complex = np.sum(np.hstack((dP_de,dP_db)),1)
# raise Exception('Debug error')
# elif self.projType is 'Z2D
elif self.projType is 'Z3D':
raise NotImplementedError('Has not be implement for full impedance tensor')
@@ -160,9 +161,10 @@ class RxMT(Survey.BaseRx):
# ex = Pex*mkvc(f[src,'e_1d'],2)
# bx = Pbx*mkvc(f[src,'b_1d'],2)/mu_0
dP_deTv = mkvc(Pex.T*Utils.sdiag(1./(Pbx*mkvc(f[src,'b_1d'],2)/mu_0)).T*v,2)
db_duv = Pbx.T/mu_0*Utils.sdiag(1./(Pbx*mkvc(f[src,'b_1d'],2)/mu_0))*(Utils.sdiag(1./(Pbx*mkvc(f[src,'b_1d'],2)/mu_0))).T*Utils.sdiag(Pex*mkvc(f[src,'e_1d'],2)).T
dP_dbTv = -mkvc(f._bDeriv_u(src,db_duv,adjoint=True)*v,2)
PDeriv_complex = np.sum((dP_deTv,dP_dbTv))
db_duv = Pbx.T/mu_0*Utils.sdiag(1./(Pbx*mkvc(f[src,'b_1d'],2)/mu_0))*(Utils.sdiag(1./(Pbx*mkvc(f[src,'b_1d'],2)/mu_0))).T*Utils.sdiag(Pex*mkvc(f[src,'e_1d'],2)).T*v
dP_dbTv = -mkvc(f._bDeriv_u(src,db_duv,adjoint=True),2)
PDeriv_complex = np.sum(np.hstack((dP_deTv,dP_dbTv)),1)
# raise Exception('Debug error')
elif self.projType is 'Z3D':
raise NotImplementedError('must be real or imag')
Pv = np.array(getattr(PDeriv_complex, real_or_imag))