from em_examples.EMcircuit import Mijfun, Cfun, Qfun
import numpy as np
import matplotlib.pyplot as plt
L = 1.
R = 2000.
xc = 0.
yc = 0.
zc = 2.
incl = 0.
decl = 90.
S = 4.
ht = 0.
f = 10000.
xmin = -10.
xmax = 10.
dx = 0.25
xp = np.linspace(xmin, xmax, 101)
yp = xp.copy()
zp = np.r_[-ht]
xyz_profile = np.c_[xp, np.zeros_like(xp), np.ones_like(xp)*ht]
c_profile, m12_profile, m23_profile, m13_profile = Cfun(L,R,xc,yc,zc,incl,decl,S,ht,f,xyz_profile)
fig = plt.figure(figsize=(5,3))
plt.plot(xp, c_profile, 'k', lw=2)
plt.plot(xp, np.zeros_like(xp), 'k--', lw=1)
plt.ticklabel_format(style='sci', axis='y', scilimits=(0,0))
plt.xlabel("Mid point between Tx and Rx (m)")
plt.ylabel("Coupling Coefficient")
plt.grid()
plt.tight_layout()
plt.show()