InductionLoop.py 文件源码

python
阅读 41 收藏 0 点赞 0 评论 0

项目:em_examples 作者: geoscixyz 项目源码 文件源码
def calc_PrimaryRegion(self,X,Z):
        """Predicts magnitude and direction of primary field in region"""

        # CALCULATES INDUCING FIELD WITHIN REGION AND RETURNS AT LOCATIONS

        # Initiate Variables from object
        I   = self.I
        a1  = self.a1
        eps = 1e-6
        mu0 = 4*np.pi*1e-7   # 1e9*mu0

        s = np.abs(X)   # Define Radial Distance

        k = 4*a1*s/(Z**2 + (a1+s)**2)

        Bpx  = mu0*np.sign(X)*(Z*I/(2*np.pi*s + eps))*(1/np.sqrt(Z**2 + (a1+s)**2))*(-sp.ellipk(k) + ((a1**2 + Z**2 + s**2)/(Z**2 + (s-a1)**2))*sp.ellipe(k))
        Bpz  = mu0*           (  I/(2*np.pi           ))*(1/np.sqrt(Z**2 + (a1+s)**2))*( sp.ellipk(k) + ((a1**2 - Z**2 - s**2)/(Z**2 + (s-a1)**2))*sp.ellipe(k))
        Bpx[(X>-1.025*a1) & (X<-0.975*a1) & (Z>-0.025*a1) & (Z<0.025*a1)] = 0.
        Bpx[(X<1.025*a1) & (X>0.975*a1) & (Z>-0.025*a1) & (Z<0.025*a1)] = 0.
        Bpz[(X>-1.025*a1) & (X<-0.975*a1) & (Z>-0.025*a1) & (Z<0.025*a1)] = 0.
        Bpz[(X<1.025*a1) & (X>0.975*a1) & (Z>-0.025*a1) & (Z<0.025*a1)] = 0.
        Babs = np.sqrt(Bpx**2 + Bpz**2)

        return Bpx,Bpz,Babs
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号